mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 07:03:56 -06:00
Use the Cura Combobox Component in simulation view
CURA-8684
This commit is contained in:
parent
4ef394fa2d
commit
2290b46bf3
1 changed files with 2 additions and 47 deletions
|
@ -127,7 +127,7 @@ Cura.ExpandableComponent
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
ComboBox
|
Cura.ComboBox
|
||||||
{
|
{
|
||||||
id: layerTypeCombobox
|
id: layerTypeCombobox
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
|
@ -136,52 +136,7 @@ Cura.ExpandableComponent
|
||||||
model: layerViewTypes
|
model: layerViewTypes
|
||||||
visible: !UM.SimulationView.compatibilityMode
|
visible: !UM.SimulationView.compatibilityMode
|
||||||
|
|
||||||
background: Rectangle
|
onActivated: UM.Preferences.setValue("layerview/layer_view_type", index)
|
||||||
{
|
|
||||||
implicitHeight: UM.Theme.getSize("setting_control").height;
|
|
||||||
implicitWidth: UM.Theme.getSize("setting_control").width;
|
|
||||||
|
|
||||||
color: ladyerTypeCombobox.hovered ? UM.Theme.getColor("setting_control_highlight") : UM.Theme.getColor("setting_control")
|
|
||||||
Behavior on color { ColorAnimation { duration: 50; } }
|
|
||||||
|
|
||||||
border.width: UM.Theme.getSize("default_lining").width;
|
|
||||||
border.color: ladyerTypeCombobox.hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border");
|
|
||||||
radius: UM.Theme.getSize("setting_control_radius").width
|
|
||||||
}
|
|
||||||
|
|
||||||
indicator: 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");
|
|
||||||
}
|
|
||||||
|
|
||||||
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:
|
|
||||||
{
|
|
||||||
UM.Preferences.setValue("layerview/layer_view_type", index);
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted:
|
Component.onCompleted:
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue