diff options
author | casper <c.lamboo@ultimaker.com> | 2022-01-26 12:25:20 +0300 |
---|---|---|
committer | casper <c.lamboo@ultimaker.com> | 2022-01-26 12:25:20 +0300 |
commit | 200e4df0254a5a3f4907331da6ee82a3030ba575 (patch) | |
tree | 9ef872ae65696c6a27fe7c6b4be15109eeaa916e /plugins/SimulationView | |
parent | b51c787f622db64b964767754e932fb20d0ac183 (diff) |
Fix issues in simulation view
- Correctly display text in LayerType dropdown menu
- Use UM.Label component to reduce code duplication
- Don't display QtControls default dropdown icon
CURA-8684
Diffstat (limited to 'plugins/SimulationView')
-rw-r--r-- | plugins/SimulationView/SimulationViewMenuComponent.qml | 57 |
1 files changed, 27 insertions, 30 deletions
diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index e40f7d0e4b..0a5065abf0 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -93,7 +93,8 @@ Cura.ExpandableComponent spacing: UM.Theme.getSize("layerview_row_spacing").height - ListModel // matches SimulationView.py + // matches SimulationView.py + ListModel { id: layerViewTypes } @@ -129,6 +130,8 @@ Cura.ExpandableComponent ComboBox { id: layerTypeCombobox + textRole: "text" + valueRole: "type_id" width: parent.width model: layerViewTypes visible: !UM.SimulationView.compatibilityMode @@ -146,39 +149,33 @@ Cura.ExpandableComponent radius: UM.Theme.getSize("setting_control_radius").width } - contentItem: Item + indicator: UM.RecolorImage { - Label - { - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_lining").width - anchors.right: downArrow.left - anchors.rightMargin: UM.Theme.getSize("default_lining").width - anchors.verticalCenter: parent.verticalCenter + id: downArrow + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2 + anchors.verticalCenter: parent.verticalCenter - text: ladyerTypeCombobox.currentText - font: UM.Theme.getFont("default"); - color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text") + source: UM.Theme.getIcon("ChevronSingleDown") + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height + sourceSize.width: width + 5 * screenScaleFactor + sourceSize.height: width + 5 * screenScaleFactor - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - } - - UM.RecolorImage - { - id: downArrow - anchors.right: parent.right - anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2 - anchors.verticalCenter: parent.verticalCenter - - source: UM.Theme.getIcon("ChevronSingleDown") - width: UM.Theme.getSize("standard_arrow").width - height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width + 5 * screenScaleFactor - sourceSize.height: width + 5 * screenScaleFactor + color: UM.Theme.getColor("setting_control_button"); + } - color: UM.Theme.getColor("setting_control_button"); - } + contentItem: UM.Label + { + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_lining").width + anchors.right: downArrow.left + anchors.rightMargin: UM.Theme.getSize("default_lining").width + anchors.verticalCenter: parent.verticalCenter + + text: layerTypeCombobox.currentText + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter } onActivated: |