Update some USB printing items to controls 2

This commit is contained in:
Jaime van Kessel 2022-02-22 11:58:14 +01:00
parent f347c6aedf
commit 2c6ba3cd5d
4 changed files with 25 additions and 36 deletions

View file

@ -3,7 +3,6 @@
import QtQuick 2.10
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
import UM 1.2 as UM
import Cura 1.0 as Cura

View file

@ -2,15 +2,13 @@
//Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import UM 1.5 as UM
import Cura 1.0 as Cura
Item
{
id: base;
id: base
UM.I18nCatalog { id: catalog; name: "cura"}
height: childrenRect.height + UM.Theme.getSize("thick_margin").height
@ -157,7 +155,7 @@ Item
}
}
Label
UM.Label
{
id: statusLabel
width: parent.width - 2 * UM.Theme.getSize("thick_margin").width
@ -170,7 +168,7 @@ Item
text: statusText
}
Label
UM.Label
{
id: percentageLabel
anchors.top: parent.top
@ -184,20 +182,20 @@ Item
UM.ProgressBar
{
id: progressBar;
minimumValue: 0;
maximumValue: 100;
value: 0;
id: progressBar
minimumValue: 0
maximumValue: 100
value: 0
//Doing this in an explicit binding since the implicit binding breaks on occasion.
Binding
{
target: progressBar;
property: "value";
value: base.progress;
target: progressBar
property: "value"
value: base.progress
}
visible: showProgress;
visible: showProgress
indeterminate:
{
if(!printerConnected)
@ -217,15 +215,15 @@ Item
return false;
}
}
property string backgroundColor: UM.Theme.getColor("progressbar_background");
property string controlColor: base.statusColor;
property string backgroundColor: UM.Theme.getColor("progressbar_background")
property string controlColor: base.statusColor
width: parent.width - 2 * UM.Theme.getSize("thick_margin").width;
height: UM.Theme.getSize("progressbar").height;
anchors.top: statusLabel.bottom;
anchors.topMargin: Math.round(UM.Theme.getSize("thick_margin").height / 4);
anchors.left: parent.left;
anchors.leftMargin: UM.Theme.getSize("thick_margin").width;
width: parent.width - 2 * UM.Theme.getSize("thick_margin").width
height: UM.Theme.getSize("progressbar").height
anchors.top: statusLabel.bottom
anchors.topMargin: Math.round(UM.Theme.getSize("thick_margin").height / 4)
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("thick_margin").width
}
Row

View file

@ -2,18 +2,16 @@
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1
import UM 1.2 as UM
import UM 1.5 as UM
import Cura 1.0 as Cura
Item
{
property string label: ""
property string value: ""
height: childrenRect.height;
height: childrenRect.height
property var connectedPrinter: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
@ -24,22 +22,20 @@ Item
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
Label
UM.Label
{
width: Math.floor(parent.width * 0.4)
anchors.verticalCenter: parent.verticalCenter
text: label
color: connectedPrinter != null && connectedPrinter.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
font: UM.Theme.getFont("default")
elide: Text.ElideRight
}
Label
UM.Label
{
width: Math.floor(parent.width * 0.6)
anchors.verticalCenter: parent.verticalCenter
text: value
color: connectedPrinter != null && connectedPrinter.acceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
font: UM.Theme.getFont("default")
elide: Text.ElideRight
}
}

View file

@ -2,10 +2,8 @@
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import UM 1.2 as UM
import UM 1.5 as UM
import Cura 1.0 as Cura
Item
@ -20,14 +18,12 @@ Item
width: base.width
height: UM.Theme.getSize("section").height
Label
UM.Label
{
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
text: label
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("setting_category_text")
}
}
}