mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 02:35:53 +08:00
Add reusable style for comboboxes to the theme
CURA-790
This commit is contained in:
parent
6907c8921e
commit
4a2b1af9f5
@ -307,6 +307,7 @@ Item
|
|||||||
model: extruderModel
|
model: extruderModel
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: supportExtruderLabel.right
|
anchors.left: supportExtruderLabel.right
|
||||||
|
style: UM.Theme.styles.combobox
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
@ -325,6 +326,7 @@ Item
|
|||||||
anchors.top: mainExtruderCombobox.bottom
|
anchors.top: mainExtruderCombobox.bottom
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||||
anchors.left: supportExtruderLabel.right
|
anchors.left: supportExtruderLabel.right
|
||||||
|
style: UM.Theme.styles.combobox
|
||||||
}
|
}
|
||||||
|
|
||||||
ListModel {
|
ListModel {
|
||||||
|
@ -309,6 +309,52 @@ QtObject {
|
|||||||
unitFont: Theme.getFont("default");
|
unitFont: Theme.getFont("default");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property Component combobox: Component {
|
||||||
|
ComboBoxStyle {
|
||||||
|
background: Rectangle {
|
||||||
|
implicitHeight: UM.Theme.getSize("setting_control").height;
|
||||||
|
implicitWidth: UM.Theme.getSize("setting_control").width;
|
||||||
|
|
||||||
|
color: control.hovered ? Theme.getColor("setting_control_highlight") : Theme.getColor("setting_control");
|
||||||
|
Behavior on color { ColorAnimation { duration: 50; } }
|
||||||
|
|
||||||
|
border.width: Theme.getSize("default_lining").width;
|
||||||
|
border.color: control.hovered ? Theme.getColor("setting_control_border_highlight") : Theme.getColor("setting_control_border");
|
||||||
|
}
|
||||||
|
label: Item {
|
||||||
|
Label {
|
||||||
|
anchors.left: parent.left;
|
||||||
|
anchors.leftMargin: Theme.getSize("default_lining").width
|
||||||
|
anchors.right: downArrow.left;
|
||||||
|
anchors.rightMargin: Theme.getSize("default_lining").width;
|
||||||
|
anchors.verticalCenter: parent.verticalCenter;
|
||||||
|
|
||||||
|
text: control.currentText;
|
||||||
|
font: UM.Theme.getFont("default");
|
||||||
|
color: !enabled ? Theme.getColor("setting_control_disabled_text") : Theme.getColor("setting_control_text");
|
||||||
|
|
||||||
|
elide: Text.ElideRight;
|
||||||
|
verticalAlignment: Text.AlignVCenter;
|
||||||
|
}
|
||||||
|
|
||||||
|
UM.RecolorImage {
|
||||||
|
id: downArrow
|
||||||
|
anchors.right: parent.right;
|
||||||
|
anchors.rightMargin: Theme.getSize("default_lining").width * 2;
|
||||||
|
anchors.verticalCenter: parent.verticalCenter;
|
||||||
|
|
||||||
|
source: UM.Theme.getIcon("arrow_bottom")
|
||||||
|
width: UM.Theme.getSize("standard_arrow").width
|
||||||
|
height: UM.Theme.getSize("standard_arrow").height
|
||||||
|
sourceSize.width: width + 5
|
||||||
|
sourceSize.height: width + 5
|
||||||
|
|
||||||
|
color: Theme.getColor("setting_control_text");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
property Component checkbox: Component {
|
property Component checkbox: Component {
|
||||||
CheckBoxStyle {
|
CheckBoxStyle {
|
||||||
background: Item { }
|
background: Item { }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user