Browse Source

Fix width of labels in machine settings

- Elide the titles in the columns.
- Give the width of a ratio so that it doesn't matter if the font renders differently or if we resize the window.

Fixes #5742.
Ghostkeeper 5 years ago
parent
commit
3ea68e6c7f
1 changed files with 8 additions and 4 deletions
  1. 8 4
      plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml

+ 8 - 4
plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml

@@ -20,14 +20,14 @@ Item
     anchors.right: parent.right
     anchors.top: parent.top
 
-    property int labelWidth: 120 * screenScaleFactor
-    property int controlWidth: (UM.Theme.getSize("setting_control").width * 3 / 4) | 0
-    property var labelFont: UM.Theme.getFont("default")
-
     property int columnWidth: ((parent.width - 2 * UM.Theme.getSize("default_margin").width) / 2) | 0
     property int columnSpacing: 3 * screenScaleFactor
     property int propertyStoreIndex: manager ? manager.storeContainerIndex : 1  // definition_changes
 
+    property int labelWidth: (columnWidth * 2 / 3 - UM.Theme.getSize("default_margin").width * 2) | 0
+    property int controlWidth: (columnWidth / 3) | 0
+    property var labelFont: UM.Theme.getFont("default")
+
     property string machineStackId: Cura.MachineManager.activeMachineId
 
     property var forceUpdateFunction: manager.forceUpdate
@@ -59,6 +59,8 @@ Item
                 font: UM.Theme.getFont("medium_bold")
                 color: UM.Theme.getColor("text")
                 renderType: Text.NativeRendering
+                width: parent.width
+                elide: Text.ElideRight
             }
 
             Cura.NumericTextFieldWithUnit  // "X (Width)"
@@ -175,6 +177,8 @@ Item
                 font: UM.Theme.getFont("medium_bold")
                 color: UM.Theme.getColor("text")
                 renderType: Text.NativeRendering
+                width: parent.width
+                elide: Text.ElideRight
             }
 
             Cura.PrintHeadMinMaxTextField  // "X min"