CURA-4319 fix combobox hover states

This commit is contained in:
ChrisTerBeke 2017-09-12 12:50:12 +02:00
parent 073c2d3335
commit 9b33bc8194

View File

@ -615,14 +615,15 @@ QtObject {
implicitHeight: Theme.getSize("setting_control").height; implicitHeight: Theme.getSize("setting_control").height;
implicitWidth: Theme.getSize("setting_control").width; implicitWidth: Theme.getSize("setting_control").width;
color: (control.hovered || controler._hovered) ? UM.Theme.getColor("setting_control_highlight") : UM.Theme.getColor("setting_control") color: control.hovered ? UM.Theme.getColor("setting_control_highlight") : UM.Theme.getColor("setting_control")
Behavior on color { ColorAnimation { duration: 50; } } Behavior on color { ColorAnimation { duration: 50; } }
border.width: Theme.getSize("default_lining").width; border.width: Theme.getSize("default_lining").width;
border.color: (control.hovered || control._hovered) ? Theme.getColor("setting_control_border_highlight") : Theme.getColor("setting_control_border"); border.color: control.hovered ? Theme.getColor("setting_control_border_highlight") : Theme.getColor("setting_control_border");
} }
label: Item { label: Item {
Label { Label {
anchors.left: parent.left; anchors.left: parent.left;
anchors.leftMargin: Theme.getSize("default_lining").width anchors.leftMargin: Theme.getSize("default_lining").width
@ -658,16 +659,17 @@ QtObject {
// Combobox with items with colored rectangles // Combobox with items with colored rectangles
property Component combobox_color: Component { property Component combobox_color: Component {
ComboBoxStyle { ComboBoxStyle {
background: Rectangle { background: Rectangle {
color: !enabled ? UM.Theme.getColor("setting_control_disabled") : (control.hovered || controler._hovered) ? UM.Theme.getColor("setting_control_highlight") : UM.Theme.getColor("setting_control") color: !enabled ? UM.Theme.getColor("setting_control_disabled") : control._hovered ? UM.Theme.getColor("setting_control_highlight") : UM.Theme.getColor("setting_control")
border.width: UM.Theme.getSize("default_lining").width border.width: UM.Theme.getSize("default_lining").width
border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : (control.hovered || control._hovered) ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border") border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : control._hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border")
} }
label: Item { label: Item {
Label { Label {
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_lining").width anchors.leftMargin: UM.Theme.getSize("default_lining").width
@ -687,18 +689,11 @@ QtObject {
id: swatch id: swatch
height: UM.Theme.getSize("setting_control").height / 2 height: UM.Theme.getSize("setting_control").height / 2
width: height width: height
anchors.right: downArrow.left
anchors { anchors.verticalCenter: parent.verticalCenter
right: downArrow.left; anchors.margins: UM.Theme.getSize("default_margin").width / 4
verticalCenter: parent.verticalCenter
margins: UM.Theme.getSize("default_margin").width / 4
}
// border.width: UM.Theme.getSize("default_lining").width * 2
// border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border")
radius: width / 2 radius: width / 2
color: (control.color_override !== "") ? control.color_override : control.color
color: if (control.color_override != "") {return control.color_override} else {return control.color;}
} }
UM.RecolorImage { UM.RecolorImage {