Convert more items to controls 2 for toolbox

This commit is contained in:
Jaime van Kessel 2021-11-16 10:23:32 +01:00
parent ef9b5506ce
commit 82e2f038ac
5 changed files with 20 additions and 57 deletions

View file

@ -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. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 1.1 import QtQuick.Controls 2.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.1 import QtQuick.Dialogs 1.1
import QtQuick.Window 2.1 import QtQuick.Window 2.1

View file

@ -2,8 +2,7 @@
// Toolbox is released under the terms of the LGPLv3 or higher. // Toolbox is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 1.4 import QtQuick.Controls 2.1
import QtQuick.Controls.Styles 1.4
import UM 1.5 as UM import UM 1.5 as UM
import "../components" import "../components"
@ -44,7 +43,7 @@ Item
} }
} }
Label UM.Label
{ {
id: title id: title
anchors anchors
@ -62,13 +61,11 @@ Item
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
width: parent.width width: parent.width
height: UM.Theme.getSize("toolbox_property_label").height height: UM.Theme.getSize("toolbox_property_label").height
renderType: Text.NativeRendering
} }
Label UM.Label
{ {
id: description id: description
text: details && details.description ? details.description : "" text: details && details.description ? details.description : ""
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
anchors anchors
{ {
@ -76,7 +73,6 @@ Item
left: title.left left: title.left
topMargin: UM.Theme.getSize("default_margin").height topMargin: UM.Theme.getSize("default_margin").height
} }
renderType: Text.NativeRendering
} }
Column Column
{ {
@ -90,19 +86,17 @@ Item
spacing: Math.floor(UM.Theme.getSize("narrow_margin").height) spacing: Math.floor(UM.Theme.getSize("narrow_margin").height)
width: childrenRect.width width: childrenRect.width
Label UM.Label
{ {
text: catalog.i18nc("@label", "Website") + ":" text: catalog.i18nc("@label", "Website") + ":"
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
renderType: Text.NativeRendering
} }
Label UM.Label
{ {
text: catalog.i18nc("@label", "Email") + ":" text: catalog.i18nc("@label", "Email") + ":"
font: UM.Theme.getFont("default") font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
renderType: Text.NativeRendering
} }
} }
Column Column
@ -119,7 +113,7 @@ Item
} }
spacing: Math.floor(UM.Theme.getSize("narrow_margin").height) spacing: Math.floor(UM.Theme.getSize("narrow_margin").height)
Label UM.Label
{ {
text: text:
{ {
@ -131,14 +125,10 @@ Item
} }
width: parent.width width: parent.width
elide: Text.ElideRight 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"]) onLinkActivated: UM.UrlUtil.openUrl(link, ["https", "http"])
renderType: Text.NativeRendering
} }
Label UM.Label
{ {
text: text:
{ {
@ -148,11 +138,7 @@ Item
} }
return "" return ""
} }
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
linkColor: UM.Theme.getColor("text_link")
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)
renderType: Text.NativeRendering
} }
} }
Rectangle Rectangle

View file

@ -2,8 +2,7 @@
// Toolbox is released under the terms of the LGPLv3 or higher. // Toolbox is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 1.4 import QtQuick.Controls 2.1
import QtQuick.Controls.Styles 1.4
import UM 1.5 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
@ -120,6 +119,7 @@ Item
{ {
text: details === null ? "" : (details.version || catalog.i18nc("@label", "Unknown")) text: details === null ? "" : (details.version || catalog.i18nc("@label", "Unknown"))
} }
UM.Label UM.Label
{ {
text: text:
@ -134,17 +134,7 @@ Item
} }
UM.Label UM.Label
{ {
text: text: details === null ? "" : "<a href=\"" + details.website + "\">" + details.author_name + "</a>"
{
if (details === null)
{
return ""
}
else
{
return "<a href=\"" + details.website + "\">" + details.author_name + "</a>"
}
}
onLinkActivated: UM.UrlUtil.openUrl(link, ["http", "https"]) onLinkActivated: UM.UrlUtil.openUrl(link, ["http", "https"])
} }
UM.Label UM.Label

View file

@ -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. // Toolbox is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 1.4 import QtQuick.Controls 2.1
import QtQuick.Controls.Styles 1.4 import UM 1.5 as UM
Rectangle UM.Label
{ {
id: page text: catalog.i18nc("@info", "Could not connect to the Cura Package database. Please check your connection.")
width: parent.width anchors.centerIn: parent
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
}
} }

View file

@ -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. // Toolbox is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 1.4 import QtQuick.Controls 2.1
import QtQuick.Controls.Styles 1.4
import UM 1.3 as UM import UM 1.3 as UM
Rectangle Rectangle