Add hover effect to mode switch control

While simplifying theme additions
This commit is contained in:
fieldOfView 2017-04-30 22:52:54 +02:00
parent 98aca20197
commit 0c6a5328c8
3 changed files with 41 additions and 20 deletions

View file

@ -412,7 +412,7 @@ Rectangle
{
id: toggleLeftText
anchors.right: modeToggleSwitch.left
anchors.rightMargin: UM.Theme.getSize("toggle_button_text_anchoring_margin").width
anchors.rightMargin: UM.Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter
text: ""
color: UM.Theme.getColor("toggle_active_text")
@ -438,9 +438,19 @@ Rectangle
id: modeToggleSwitch
checked: false
anchors.right: toggleRightText.left
anchors.rightMargin: UM.Theme.getSize("toggle_button_text_anchoring_margin").width
anchors.rightMargin: UM.Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter
property alias _hovered: enableSupportMouseArea.containsMouse
MouseArea
{
id: enableSupportMouseArea
anchors.fill: parent
hoverEnabled: true
acceptedButtons: Qt.NoButton
}
onClicked:
{
var index = 0;