mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-11 16:00:47 -07:00
Merge branch 'fix_hover_effects' of https://github.com/fieldOfView/Cura
This commit is contained in:
commit
2bc4355f00
4 changed files with 81 additions and 26 deletions
|
|
@ -408,18 +408,34 @@ Rectangle
|
|||
}
|
||||
ExclusiveGroup { id: modeMenuGroup; }
|
||||
|
||||
Text
|
||||
Label
|
||||
{
|
||||
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")
|
||||
color:
|
||||
{
|
||||
if(toggleLeftTextMouseArea.containsMouse)
|
||||
{
|
||||
return UM.Theme.getColor("mode_switch_text_hover");
|
||||
}
|
||||
else if(!modeToggleSwitch.checked)
|
||||
{
|
||||
return UM.Theme.getColor("mode_switch_text_checked");
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("mode_switch_text");
|
||||
}
|
||||
}
|
||||
font: UM.Theme.getFont("default")
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: toggleLeftTextMouseArea
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
onClicked:
|
||||
{
|
||||
|
|
@ -438,9 +454,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 bool _hovered: modeToggleSwitchMouseArea.containsMouse || toggleLeftTextMouseArea.containsMouse || toggleRightTextMouseArea.containsMouse
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: modeToggleSwitchMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
acceptedButtons: Qt.NoButton
|
||||
}
|
||||
|
||||
onClicked:
|
||||
{
|
||||
var index = 0;
|
||||
|
|
@ -457,20 +483,36 @@ Rectangle
|
|||
UM.Preferences.setValue("cura/active_mode", index);
|
||||
}
|
||||
|
||||
style: UM.Theme.styles.toggle_button
|
||||
style: UM.Theme.styles.mode_switch
|
||||
}
|
||||
|
||||
Text
|
||||
Label
|
||||
{
|
||||
id: toggleRightText
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: ""
|
||||
color: UM.Theme.getColor("toggle_active_text")
|
||||
color:
|
||||
{
|
||||
if(toggleRightTextMouseArea.containsMouse)
|
||||
{
|
||||
return UM.Theme.getColor("mode_switch_text_hover");
|
||||
}
|
||||
else if(modeToggleSwitch.checked)
|
||||
{
|
||||
return UM.Theme.getColor("mode_switch_text_checked");
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("mode_switch_text");
|
||||
}
|
||||
}
|
||||
font: UM.Theme.getFont("default")
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: toggleRightTextMouseArea
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
onClicked:
|
||||
{
|
||||
|
|
|
|||
|
|
@ -240,6 +240,8 @@ Item
|
|||
CheckBox
|
||||
{
|
||||
id: enableSupportCheckBox
|
||||
property alias _hovered: enableSupportMouseArea.containsMouse
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.left: enableSupportLabel.right
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue