mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-10 07:15:03 -06:00
Use a toggle button for mode switching
CURA-3574
This commit is contained in:
parent
f1ac1bd876
commit
c75887be80
2 changed files with 92 additions and 0 deletions
|
@ -8,6 +8,44 @@ import QtQuick.Controls.Styles 1.1
|
|||
import UM 1.1 as UM
|
||||
|
||||
QtObject {
|
||||
property Component toggle_button: Component {
|
||||
SwitchStyle {
|
||||
groove: Rectangle {
|
||||
implicitWidth: 40
|
||||
implicitHeight: 15
|
||||
radius: 9
|
||||
border.color: {
|
||||
if (control.pressed || (control.checkable && control.checked)) {
|
||||
return UM.Theme.getColor("sidebar_header_active");
|
||||
} else if(control.hovered) {
|
||||
return UM.Theme.getColor("sidebar_header_hover");
|
||||
} else {
|
||||
return UM.Theme.getColor("sidebar_header_bar");
|
||||
}
|
||||
}
|
||||
Behavior on border.color { ColorAnimation { duration: 50; } }
|
||||
border.width: 2
|
||||
}
|
||||
|
||||
handle: Rectangle {
|
||||
implicitWidth: Math.round((parent.parent.width - padding.left - padding.right)/2)
|
||||
implicitHeight: implicitWidth
|
||||
radius: 9
|
||||
|
||||
color: {
|
||||
if (control.pressed || (control.checkable && control.checked)) {
|
||||
return UM.Theme.getColor("sidebar_header_active");
|
||||
} else if(control.hovered) {
|
||||
return UM.Theme.getColor("sidebar_header_hover");
|
||||
} else {
|
||||
return UM.Theme.getColor("sidebar_header_bar");
|
||||
}
|
||||
}
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property Component sidebar_header_button: Component {
|
||||
ButtonStyle {
|
||||
background: Rectangle {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue