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.
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

View file

@ -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

View file

@ -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 "<a href=\"" + details.website + "\">" + details.author_name + "</a>"
}
}
text: details === null ? "" : "<a href=\"" + details.website + "\">" + details.author_name + "</a>"
onLinkActivated: UM.UrlUtil.openUrl(link, ["http", "https"])
}
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.
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
}
anchors.centerIn: parent
}

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.
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