mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 03:35:57 +08:00
Set label width based on the column width
CURA-4428 - Remove the magic number solution - Use a fixed width for labels so the right side widgets can be properly left-aligned.
This commit is contained in:
parent
d1bee922ab
commit
666ee81fb3
@ -71,6 +71,7 @@ Cura.MachineAction
|
|||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||||
|
|
||||||
property real columnWidth: ((width - 3 * UM.Theme.getSize("default_margin").width) / 2) | 0
|
property real columnWidth: ((width - 3 * UM.Theme.getSize("default_margin").width) / 2) | 0
|
||||||
|
property real labelColumnWidth: columnWidth * 0.5
|
||||||
|
|
||||||
Tab
|
Tab
|
||||||
{
|
{
|
||||||
@ -247,13 +248,13 @@ Cura.MachineAction
|
|||||||
|
|
||||||
Row
|
Row
|
||||||
{
|
{
|
||||||
spacing: UM.Theme.getSize("default_margin").width * 4 / 5
|
spacing: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@label", "Number of Extruders")
|
text: catalog.i18nc("@label", "Number of Extruders")
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
width: Math.max(0, settingsTabs.columnWidth - 2 * UM.Theme.getSize("default_margin").width - extruderCountComboBox.width)
|
width: Math.max(0, settingsTabs.labelColumnWidth)
|
||||||
anchors.verticalCenter: extruderCountComboBox.verticalCenter
|
anchors.verticalCenter: extruderCountComboBox.verticalCenter
|
||||||
}
|
}
|
||||||
ComboBox
|
ComboBox
|
||||||
@ -562,7 +563,7 @@ Cura.MachineAction
|
|||||||
text: _label
|
text: _label
|
||||||
visible: _label != ""
|
visible: _label != ""
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
width: Math.max(0, settingsTabs.columnWidth - 2 * UM.Theme.getSize("default_margin").width - textFieldWithUnit.width)
|
width: Math.max(0, settingsTabs.labelColumnWidth)
|
||||||
anchors.verticalCenter: textFieldWithUnit.verticalCenter
|
anchors.verticalCenter: textFieldWithUnit.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -648,14 +649,14 @@ Cura.MachineAction
|
|||||||
|
|
||||||
Row
|
Row
|
||||||
{
|
{
|
||||||
spacing: UM.Theme.getSize("default_margin").width * 4 / 5
|
spacing: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: _label
|
text: _label
|
||||||
visible: _label != ""
|
visible: _label != ""
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
width: Math.max(0, settingsTabs.columnWidth - 2 * UM.Theme.getSize("default_margin").width - comboBox.width)
|
width: Math.max(0, settingsTabs.labelColumnWidth)
|
||||||
anchors.verticalCenter: comboBox.verticalCenter
|
anchors.verticalCenter: comboBox.verticalCenter
|
||||||
}
|
}
|
||||||
ComboBox
|
ComboBox
|
||||||
@ -787,7 +788,7 @@ Cura.MachineAction
|
|||||||
text: _label
|
text: _label
|
||||||
visible: _label != ""
|
visible: _label != ""
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
width: Math.max(0, settingsTabs.columnWidth - 2 * UM.Theme.getSize("default_margin").width - textFieldWithUnit.width)
|
width: Math.max(0, settingsTabs.labelColumnWidth)
|
||||||
anchors.verticalCenter: textFieldWithUnit.verticalCenter
|
anchors.verticalCenter: textFieldWithUnit.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user