From 82e2f038ac056e30c597f89d35ca416728c90dd0 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 16 Nov 2021 10:23:32 +0100 Subject: [PATCH] Convert more items to controls 2 for toolbox --- .../ToolboxConfirmUninstallResetDialog.qml | 5 ++-- .../resources/qml/pages/ToolboxAuthorPage.qml | 28 +++++-------------- .../resources/qml/pages/ToolboxDetailPage.qml | 16 ++--------- .../resources/qml/pages/ToolboxErrorPage.qml | 23 ++++----------- .../qml/pages/ToolboxLoadingPage.qml | 5 ++-- 5 files changed, 20 insertions(+), 57 deletions(-) diff --git a/plugins/Toolbox/resources/qml/dialogs/ToolboxConfirmUninstallResetDialog.qml b/plugins/Toolbox/resources/qml/dialogs/ToolboxConfirmUninstallResetDialog.qml index 1b5e4d1d46..7f37d8c187 100644 --- a/plugins/Toolbox/resources/qml/dialogs/ToolboxConfirmUninstallResetDialog.qml +++ b/plugins/Toolbox/resources/qml/dialogs/ToolboxConfirmUninstallResetDialog.qml @@ -1,9 +1,8 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2021 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.1 import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.1 import QtQuick.Window 2.1 diff --git a/plugins/Toolbox/resources/qml/pages/ToolboxAuthorPage.qml b/plugins/Toolbox/resources/qml/pages/ToolboxAuthorPage.qml index 2fa4224388..e84ea6012c 100644 --- a/plugins/Toolbox/resources/qml/pages/ToolboxAuthorPage.qml +++ b/plugins/Toolbox/resources/qml/pages/ToolboxAuthorPage.qml @@ -2,8 +2,7 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick.Controls 2.1 import UM 1.5 as UM import "../components" @@ -44,7 +43,7 @@ Item } } - Label + UM.Label { id: title anchors @@ -62,13 +61,11 @@ Item wrapMode: Text.WordWrap width: parent.width height: UM.Theme.getSize("toolbox_property_label").height - renderType: Text.NativeRendering } - Label + UM.Label { id: description text: details && details.description ? details.description : "" - font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") anchors { @@ -76,7 +73,6 @@ Item left: title.left topMargin: UM.Theme.getSize("default_margin").height } - renderType: Text.NativeRendering } Column { @@ -90,19 +86,17 @@ Item spacing: Math.floor(UM.Theme.getSize("narrow_margin").height) width: childrenRect.width - Label + UM.Label { text: catalog.i18nc("@label", "Website") + ":" font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") - renderType: Text.NativeRendering } - Label + UM.Label { text: catalog.i18nc("@label", "Email") + ":" font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") - renderType: Text.NativeRendering } } Column @@ -119,7 +113,7 @@ Item } spacing: Math.floor(UM.Theme.getSize("narrow_margin").height) - Label + UM.Label { text: { @@ -131,14 +125,10 @@ Item } width: parent.width elide: Text.ElideRight - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - linkColor: UM.Theme.getColor("text_link") onLinkActivated: UM.UrlUtil.openUrl(link, ["https", "http"]) - renderType: Text.NativeRendering } - Label + UM.Label { text: { @@ -148,11 +138,7 @@ Item } return "" } - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - linkColor: UM.Theme.getColor("text_link") onLinkActivated: Qt.openUrlExternally(link) - renderType: Text.NativeRendering } } Rectangle diff --git a/plugins/Toolbox/resources/qml/pages/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/pages/ToolboxDetailPage.qml index 28091779a2..06c361abe1 100644 --- a/plugins/Toolbox/resources/qml/pages/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/pages/ToolboxDetailPage.qml @@ -2,8 +2,7 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick.Controls 2.1 import UM 1.5 as UM import Cura 1.1 as Cura @@ -120,6 +119,7 @@ Item { text: details === null ? "" : (details.version || catalog.i18nc("@label", "Unknown")) } + UM.Label { text: @@ -134,17 +134,7 @@ Item } UM.Label { - text: - { - if (details === null) - { - return "" - } - else - { - return "" + details.author_name + "" - } - } + text: details === null ? "" : "" + details.author_name + "" onLinkActivated: UM.UrlUtil.openUrl(link, ["http", "https"]) } UM.Label diff --git a/plugins/Toolbox/resources/qml/pages/ToolboxErrorPage.qml b/plugins/Toolbox/resources/qml/pages/ToolboxErrorPage.qml index e57e63dbb9..01428d039b 100644 --- a/plugins/Toolbox/resources/qml/pages/ToolboxErrorPage.qml +++ b/plugins/Toolbox/resources/qml/pages/ToolboxErrorPage.qml @@ -1,23 +1,12 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2021 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick.Controls 2.1 +import UM 1.5 as UM -Rectangle +UM.Label { - id: page - width: parent.width - height: parent.height - color: "transparent" - Label - { - text: catalog.i18nc("@info", "Could not connect to the Cura Package database. Please check your connection.") - anchors - { - centerIn: parent - } - renderType: Text.NativeRendering - } + text: catalog.i18nc("@info", "Could not connect to the Cura Package database. Please check your connection.") + anchors.centerIn: parent } diff --git a/plugins/Toolbox/resources/qml/pages/ToolboxLoadingPage.qml b/plugins/Toolbox/resources/qml/pages/ToolboxLoadingPage.qml index a30af6b335..77147e9ba9 100644 --- a/plugins/Toolbox/resources/qml/pages/ToolboxLoadingPage.qml +++ b/plugins/Toolbox/resources/qml/pages/ToolboxLoadingPage.qml @@ -1,9 +1,8 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2021 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick.Controls 2.1 import UM 1.3 as UM Rectangle