mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 03:07:53 -06:00
Create custom component for rows in WorkplaceDialog.
CURA-9424
This commit is contained in:
parent
b1e559ff1a
commit
8bb6083481
2 changed files with 64 additions and 132 deletions
|
@ -86,39 +86,16 @@ UM.Dialog
|
||||||
spacing: UM.Theme.getSize("default_margin").height
|
spacing: UM.Theme.getSize("default_margin").height
|
||||||
leftPadding: UM.Theme.getSize("medium_button_icon").width + UM.Theme.getSize("default_margin").width
|
leftPadding: UM.Theme.getSize("medium_button_icon").width + UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
Row
|
WorkspaceRow
|
||||||
{
|
{
|
||||||
width: parent.width
|
leftLabelText: catalog.i18nc("@action:label", "Type")
|
||||||
height: childrenRect.height
|
rightLabelText: manager.machineType
|
||||||
|
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@action:label", "Type")
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
}
|
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: manager.machineType
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row
|
WorkspaceRow
|
||||||
{
|
{
|
||||||
width: parent.width
|
leftLabelText: catalog.i18nc("@action:label", manager.isPrinterGroup ? "Printer Group" : "Printer Name")
|
||||||
height: childrenRect.height
|
rightLabelText: manager.machineName
|
||||||
|
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@action:label", manager.isPrinterGroup ? "Printer Group" : "Printer Name")
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
}
|
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: manager.machineName
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,79 +160,30 @@ UM.Dialog
|
||||||
spacing: UM.Theme.getSize("default_margin").height
|
spacing: UM.Theme.getSize("default_margin").height
|
||||||
leftPadding: UM.Theme.getSize("medium_button_icon").width + UM.Theme.getSize("default_margin").width
|
leftPadding: UM.Theme.getSize("medium_button_icon").width + UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
Row
|
WorkspaceRow
|
||||||
{
|
{
|
||||||
width: parent.width
|
leftLabelText: catalog.i18nc("@action:label", "Name")
|
||||||
height: childrenRect.height
|
rightLabelText: manager.qualityName
|
||||||
|
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@action:label", "Name")
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
}
|
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: manager.qualityName
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row
|
WorkspaceRow
|
||||||
{
|
{
|
||||||
width: parent.width
|
leftLabelText: catalog.i18nc("@action:label", "Intent")
|
||||||
height: childrenRect.height
|
rightLabelText: manager.intentName
|
||||||
|
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@action:label", "Intent")
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
}
|
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: manager.intentName
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row
|
WorkspaceRow
|
||||||
{
|
{
|
||||||
width: parent.width
|
leftLabelText: catalog.i18nc("@action:label", "Not in profile")
|
||||||
height: childrenRect.height
|
rightLabelText: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.numUserSettings).arg(manager.numUserSettings)
|
||||||
|
visible: manager.numUserSettings != 0
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@action:label", "Not in profile")
|
|
||||||
visible: manager.numUserSettings != 0
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
}
|
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.numUserSettings).arg(manager.numUserSettings)
|
|
||||||
visible: manager.numUserSettings != 0
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row
|
WorkspaceRow
|
||||||
{
|
{
|
||||||
width: parent.width
|
leftLabelText: catalog.i18nc("@action:label", "Derivative from")
|
||||||
height: childrenRect.height
|
rightLabelText: catalog.i18ncp("@action:label", "%1, %2 override", "%1, %2 overrides", manager.numSettingsOverridenByQualityChanges).arg(manager.qualityType).arg(manager.numSettingsOverridenByQualityChanges)
|
||||||
|
visible: manager.numSettingsOverridenByQualityChanges != 0
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@action:label", "Derivative from")
|
|
||||||
visible: manager.numSettingsOverridenByQualityChanges != 0
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
}
|
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: catalog.i18ncp("@action:label", "%1, %2 override", "%1, %2 overrides", manager.numSettingsOverridenByQualityChanges).arg(manager.qualityType).arg(manager.numSettingsOverridenByQualityChanges)
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
visible: manager.numSettingsOverridenByQualityChanges != 0
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -294,21 +222,10 @@ UM.Dialog
|
||||||
Repeater
|
Repeater
|
||||||
{
|
{
|
||||||
model: manager.materialLabels
|
model: manager.materialLabels
|
||||||
delegate: Row
|
delegate: WorkspaceRow
|
||||||
{
|
{
|
||||||
width: parent.width
|
leftLabelText: catalog.i18nc("@action:label", "Name")
|
||||||
height: childrenRect.height
|
rightLabelText: modelData
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@action:label", "Name")
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
}
|
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: modelData
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -346,36 +263,17 @@ UM.Dialog
|
||||||
spacing: UM.Theme.getSize("default_margin").height
|
spacing: UM.Theme.getSize("default_margin").height
|
||||||
leftPadding: UM.Theme.getSize("medium_button_icon").width + UM.Theme.getSize("default_margin").width
|
leftPadding: UM.Theme.getSize("medium_button_icon").width + UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
Row
|
WorkspaceRow
|
||||||
{
|
{
|
||||||
width: parent.width
|
leftLabelText: catalog.i18nc("@action:label", "Mode")
|
||||||
height: childrenRect.height
|
rightLabelText: manager.activeMode
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@action:label", "Mode")
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
}
|
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: manager.activeMode
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Row
|
|
||||||
|
WorkspaceRow
|
||||||
{
|
{
|
||||||
width: parent.width
|
leftLabelText: catalog.i18nc("@action:label", "%1 out of %2" ).arg(manager.numVisibleSettings).arg(manager.totalNumberOfSettings)
|
||||||
height: childrenRect.height
|
rightLabelText: manager.activeMode
|
||||||
visible: manager.hasVisibleSettingsField
|
visible: manager.hasVisibleSettingsField
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@action:label", "Visible settings:")
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
}
|
|
||||||
UM.Label
|
|
||||||
{
|
|
||||||
text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(manager.numVisibleSettings).arg(manager.totalNumberOfSettings)
|
|
||||||
width: (parent.width / 3) | 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
34
plugins/3MFReader/WorkspaceRow.qml
Normal file
34
plugins/3MFReader/WorkspaceRow.qml
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
// Copyright (c) 2022 Ultimaker B.V.
|
||||||
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
|
import QtQuick 2.10
|
||||||
|
import QtQuick.Controls 2.3
|
||||||
|
import QtQuick.Layouts 1.3
|
||||||
|
import QtQuick.Window 2.2
|
||||||
|
|
||||||
|
import UM 1.5 as UM
|
||||||
|
import Cura 1.1 as Cura
|
||||||
|
|
||||||
|
Row
|
||||||
|
{
|
||||||
|
property alias leftLabelText: leftLabel.text
|
||||||
|
property alias rightLabelText: rightLabel.text
|
||||||
|
|
||||||
|
width: parent.width
|
||||||
|
height: visible ? childrenRect.height : 0
|
||||||
|
|
||||||
|
UM.Label
|
||||||
|
{
|
||||||
|
id: leftLabel
|
||||||
|
text: catalog.i18nc("@action:label", "Type")
|
||||||
|
width: (parent.width / 4) | 0
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
}
|
||||||
|
UM.Label
|
||||||
|
{
|
||||||
|
id: rightLabel
|
||||||
|
text: manager.machineType
|
||||||
|
width: (parent.width / 3) | 0
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue