Replace more instances of label with UM.Label

This commit is contained in:
Jaime van Kessel 2021-11-10 17:42:23 +01:00
parent 8195b9be28
commit a68584cda1
6 changed files with 35 additions and 86 deletions

View file

@ -55,7 +55,7 @@ Item
} }
} }
Label UM.Label
{ {
id: title id: title
anchors anchors
@ -66,10 +66,8 @@ Item
} }
text: details === null ? "" : (details.name || "") text: details === null ? "" : (details.name || "")
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("text")
width: contentWidth width: contentWidth
height: contentHeight height: contentHeight
renderType: Text.NativeRendering
} }
Column Column
@ -84,33 +82,26 @@ 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
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: catalog.i18nc("@label", "Version") + ":" text: catalog.i18nc("@label", "Version") + ":"
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", "Last updated") + ":" text: catalog.i18nc("@label", "Last updated") + ":"
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", "Brand") + ":" text: catalog.i18nc("@label", "Brand") + ":"
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
renderType: Text.NativeRendering renderType: Text.NativeRendering
} }
Label UM.Label
{ {
text: catalog.i18nc("@label", "Downloads") + ":" text: catalog.i18nc("@label", "Downloads") + ":"
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
renderType: Text.NativeRendering
} }
} }
Column Column
@ -125,14 +116,11 @@ Item
} }
spacing: Math.floor(UM.Theme.getSize("narrow_margin").height) spacing: Math.floor(UM.Theme.getSize("narrow_margin").height)
height: childrenRect.height height: childrenRect.height
Label UM.Label
{ {
text: details === null ? "" : (details.version || catalog.i18nc("@label", "Unknown")) text: details === null ? "" : (details.version || catalog.i18nc("@label", "Unknown"))
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
} }
Label UM.Label
{ {
text: text:
{ {
@ -143,11 +131,8 @@ Item
var date = new Date(details.last_updated) var date = new Date(details.last_updated)
return date.toLocaleString(UM.Preferences.getValue("general/language")) return date.toLocaleString(UM.Preferences.getValue("general/language"))
} }
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
} }
Label UM.Label
{ {
text: text:
{ {
@ -160,18 +145,11 @@ Item
return "<a href=\"" + details.website + "\">" + details.author_name + "</a>" return "<a href=\"" + details.website + "\">" + details.author_name + "</a>"
} }
} }
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
linkColor: UM.Theme.getColor("text_link")
onLinkActivated: UM.UrlUtil.openUrl(link, ["http", "https"]) onLinkActivated: UM.UrlUtil.openUrl(link, ["http", "https"])
renderType: Text.NativeRendering
} }
Label UM.Label
{ {
text: details === null ? "" : (details.download_count || catalog.i18nc("@label", "Unknown")) text: details === null ? "" : (details.download_count || catalog.i18nc("@label", "Unknown"))
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
} }
} }
} }

View file

@ -5,7 +5,7 @@ import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import UM 1.2 as UM import UM 1.5 as UM
// The labelBar shows a set of labels that are evenly spaced from one another. // The labelBar shows a set of labels that are evenly spaced from one another.
// The first item is aligned to the left, the last is aligned to the right. // The first item is aligned to the left, the last is aligned to the right.
@ -34,13 +34,10 @@ Item
Layout.maximumWidth: Math.round(index + 1 === repeater.count || repeater.count <= 1 ? itemSize : base.width / (repeater.count - 1)) Layout.maximumWidth: Math.round(index + 1 === repeater.count || repeater.count <= 1 ? itemSize : base.width / (repeater.count - 1))
height: label.height height: label.height
Label UM.Label
{ {
id: label id: label
text: model[modelKey] text: model[modelKey]
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("default")
renderType: Text.NativeRendering
height: contentHeight height: contentHeight
anchors anchors
{ {

View file

@ -6,7 +6,7 @@ import QtQuick.Controls 2.3
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -77,46 +77,37 @@ Cura.ExpandablePopup
rightMargin: UM.Theme.getSize("default_margin").width rightMargin: UM.Theme.getSize("default_margin").width
} }
// Label for the brand of the material // Label for the brand of the material
Label UM.Label
{ {
id: materialBrandNameLabel id: materialBrandNameLabel
text: model.material_brand + " " + model.material_name text: model.material_brand + " " + model.material_name
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
width: parent.width width: parent.width
visible: !truncated visible: !truncated
} }
Label UM.Label
{ {
id: materialNameLabel id: materialNameLabel
text: model.material_name text: model.material_name
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
width: parent.width width: parent.width
visible: !materialBrandNameLabel.visible && !truncated visible: !materialBrandNameLabel.visible && !truncated
} }
Label UM.Label
{ {
id: materialTypeLabel id: materialTypeLabel
text: model.material_type text: model.material_type
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
width: parent.width width: parent.width
visible: !materialBrandNameLabel.visible && !materialNameLabel.visible visible: !materialBrandNameLabel.visible && !materialNameLabel.visible
} }
// Label that shows the name of the variant // Label that shows the name of the variant
Label UM.Label
{ {
id: variantLabel id: variantLabel
@ -125,8 +116,6 @@ Cura.ExpandablePopup
text: model.variant text: model.variant
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("default_bold") font: UM.Theme.getFont("default_bold")
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
} }
} }
@ -135,13 +124,11 @@ Cura.ExpandablePopup
} }
// Placeholder text if there is a configuration to select but no materials (so we can't show the materials per extruder). // Placeholder text if there is a configuration to select but no materials (so we can't show the materials per extruder).
Label UM.Label
{ {
text: catalog.i18nc("@label", "Select configuration") text: catalog.i18nc("@label", "Select configuration")
elide: Text.ElideRight elide: Text.ElideRight
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text")
renderType: Text.NativeRendering
visible: Cura.MachineManager.activeMachine ? !Cura.MachineManager.activeMachine.hasMaterials && (Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasVariantBuildplates) : false visible: Cura.MachineManager.activeMachine ? !Cura.MachineManager.activeMachine.hasMaterials && (Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasVariantBuildplates) : false

View file

@ -5,7 +5,7 @@ import QtQuick 2.7
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Window 2.1 import QtQuick.Window 2.1
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -72,7 +72,7 @@ UM.ManagementPage
visible: base.currentItem != null visible: base.currentItem != null
anchors.fill: parent anchors.fill: parent
Label UM.Label
{ {
id: machineName id: machineName
text: base.currentItem && base.currentItem.name ? base.currentItem.name : "" text: base.currentItem && base.currentItem.name ? base.currentItem.name : ""

View file

@ -7,7 +7,7 @@ import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.15 import QtQuick.Layouts 1.15
import QtQuick.Window 2.1 import QtQuick.Window 2.1
import Cura 1.1 as Cura import Cura 1.1 as Cura
import UM 1.4 as UM import UM 1.5 as UM
Window Window
{ {
@ -42,17 +42,15 @@ Window
anchors.fill: parent anchors.fill: parent
anchors.margins: UM.Theme.getSize("default_margin").width anchors.margins: UM.Theme.getSize("default_margin").width
Label UM.Label
{ {
text: catalog.i18nc("@title:header", "Sync materials with printers") text: catalog.i18nc("@title:header", "Sync materials with printers")
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("text")
} }
Label UM.Label
{ {
text: catalog.i18nc("@text", "Following a few simple steps, you will be able to synchronize all your material profiles with your printers.") text: catalog.i18nc("@text", "Following a few simple steps, you will be able to synchronize all your material profiles with your printers.")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text")
wrapMode: Text.Wrap wrapMode: Text.Wrap
width: parent.width width: parent.width
} }
@ -125,18 +123,16 @@ Window
anchors.fill: parent anchors.fill: parent
anchors.margins: UM.Theme.getSize("default_margin").width anchors.margins: UM.Theme.getSize("default_margin").width
Label UM.Label
{ {
text: catalog.i18nc("@title:header", "Sign in") text: catalog.i18nc("@title:header", "Sign in")
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("text")
Layout.preferredHeight: height Layout.preferredHeight: height
} }
Label UM.Label
{ {
text: catalog.i18nc("@text", "To automatically sync the material profiles with all your printers connected to Digital Factory you need to be signed in in Cura.") text: catalog.i18nc("@text", "To automatically sync the material profiles with all your printers connected to Digital Factory you need to be signed in in Cura.")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text")
wrapMode: Text.Wrap wrapMode: Text.Wrap
width: parent.width width: parent.width
Layout.maximumWidth: width Layout.maximumWidth: width
@ -223,13 +219,12 @@ Window
height: width height: width
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
Label UM.Label
{ {
id: printerListHeader id: printerListHeader
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
//Text is always defined by the states above. //Text is always defined by the states above.
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("text")
} }
} }
Row Row
@ -237,7 +232,7 @@ Window
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
Layout.preferredHeight: childrenRect.height Layout.preferredHeight: childrenRect.height
Label UM.Label
{ {
id: syncStatusLabel id: syncStatusLabel
@ -247,7 +242,6 @@ Window
elide: Text.ElideRight elide: Text.ElideRight
visible: text !== "" visible: text !== ""
text: "" text: ""
color: UM.Theme.getColor("text")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
} }
Cura.TertiaryButton Cura.TertiaryButton
@ -426,14 +420,13 @@ Window
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
Label UM.Label
{ {
id: printersMissingText id: printersMissingText
text: catalog.i18nc("@text Asking the user whether printers are missing in a list.", "Printers missing?") text: catalog.i18nc("@text Asking the user whether printers are missing in a list.", "Printers missing?")
+ "\n" + "\n"
+ catalog.i18nc("@text", "Make sure all your printers are turned ON and connected to Digital Factory.") + catalog.i18nc("@text", "Make sure all your printers are turned ON and connected to Digital Factory.")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text")
elide: Text.ElideRight elide: Text.ElideRight
} }
Cura.TertiaryButton Cura.TertiaryButton
@ -540,7 +533,7 @@ Window
running: true running: true
} }
} }
Label UM.Label
{ {
id: syncingLabel id: syncingLabel
anchors.left: syncingIcon.right anchors.left: syncingIcon.right
@ -561,11 +554,10 @@ Window
anchors.margins: UM.Theme.getSize("default_margin").width anchors.margins: UM.Theme.getSize("default_margin").width
visible: cloudPrinterList.count == 0 visible: cloudPrinterList.count == 0
Label UM.Label
{ {
text: catalog.i18nc("@title:header", "No printers found") text: catalog.i18nc("@title:header", "No printers found")
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("text")
Layout.preferredWidth: width Layout.preferredWidth: width
Layout.preferredHeight: height Layout.preferredHeight: height
} }
@ -577,7 +569,7 @@ Window
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: parent.width / 3 Layout.preferredWidth: parent.width / 3
} }
Label UM.Label
{ {
text: catalog.i18nc("@text", "It seems like you don't have access to any printers connected to Digital Factory.") text: catalog.i18nc("@text", "It seems like you don't have access to any printers connected to Digital Factory.")
width: parent.width width: parent.width
@ -642,18 +634,16 @@ Window
anchors.fill: parent anchors.fill: parent
anchors.margins: UM.Theme.getSize("default_margin").width anchors.margins: UM.Theme.getSize("default_margin").width
Label UM.Label
{ {
text: catalog.i18nc("@title:header", "Sync material profiles via USB") text: catalog.i18nc("@title:header", "Sync material profiles via USB")
font: UM.Theme.getFont("large_bold") font: UM.Theme.getFont("large_bold")
color: UM.Theme.getColor("text")
Layout.preferredHeight: height Layout.preferredHeight: height
} }
Label UM.Label
{ {
text: catalog.i18nc("@text In the UI this is followed by a list of steps the user needs to take.", "Follow the following steps to load the new material profiles to your printer.") text: catalog.i18nc("@text In the UI this is followed by a list of steps the user needs to take.", "Follow the following steps to load the new material profiles to your printer.")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text")
wrapMode: Text.Wrap wrapMode: Text.Wrap
width: parent.width width: parent.width
Layout.maximumWidth: width Layout.maximumWidth: width
@ -674,13 +664,12 @@ Window
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
sourceSize.width: width sourceSize.width: width
} }
Label UM.Label
{ {
text: "1. " + catalog.i18nc("@text", "Click the export material archive button.") text: "1. " + catalog.i18nc("@text", "Click the export material archive button.")
+ "\n2. " + catalog.i18nc("@text", "Save the .umm file on a USB stick.") + "\n2. " + catalog.i18nc("@text", "Save the .umm file on a USB stick.")
+ "\n3. " + catalog.i18nc("@text", "Insert the USB stick into your printer and launch the procedure to load new material profiles.") + "\n3. " + catalog.i18nc("@text", "Insert the USB stick into your printer and launch the procedure to load new material profiles.")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
color: UM.Theme.getColor("text")
wrapMode: Text.Wrap wrapMode: Text.Wrap
width: parent.width * 2 / 3 - UM.Theme.getSize("default_margin").width width: parent.width * 2 / 3 - UM.Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter

View file

@ -4,7 +4,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import UM 1.1 as UM import UM 1.5 as UM
SettingItem SettingItem
{ {
@ -90,7 +90,7 @@ SettingItem
opacity: !control.hovered ? 0 : propertyProvider.properties.validationState == "ValidatorState.Valid" ? 1.0 : 0.35 opacity: !control.hovered ? 0 : propertyProvider.properties.validationState == "ValidatorState.Valid" ? 1.0 : 0.35
} }
Label UM.Label
{ {
anchors anchors
{ {
@ -105,9 +105,7 @@ SettingItem
//However the setting value is aligned, align the unit opposite. That way it stays readable with right-to-left languages. //However the setting value is aligned, align the unit opposite. That way it stays readable with right-to-left languages.
horizontalAlignment: (input.effectiveHorizontalAlignment == Text.AlignLeft) ? Text.AlignRight : Text.AlignLeft horizontalAlignment: (input.effectiveHorizontalAlignment == Text.AlignLeft) ? Text.AlignRight : Text.AlignLeft
textFormat: Text.PlainText textFormat: Text.PlainText
renderType: Text.NativeRendering
color: UM.Theme.getColor("setting_unit") color: UM.Theme.getColor("setting_unit")
font: UM.Theme.getFont("default")
} }
TextInput TextInput