added tray menu + fixed antialising
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import QtQuick
|
||||
import "root:/config"
|
||||
import "root:/components"
|
||||
|
||||
// Leaning slider with a chopped handle. Drag or click anywhere on the rail.
|
||||
Item {
|
||||
@@ -17,33 +18,23 @@ Item {
|
||||
readonly property real _lean: Theme.skew * height
|
||||
|
||||
// Rail
|
||||
Rectangle {
|
||||
Skew {
|
||||
id: rail
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
height: 6
|
||||
color: Theme.alpha(Theme.outline, 0.7)
|
||||
|
||||
transform: Matrix4x4 {
|
||||
matrix: Qt.matrix4x4(1, -Theme.skew, 0, 6 * Theme.skew,
|
||||
0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
|
||||
}
|
||||
}
|
||||
|
||||
// Fill
|
||||
Rectangle {
|
||||
Skew {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
width: Math.max(0, Math.min(1, root.value)) * root.width
|
||||
height: 6
|
||||
color: root.enabledControl ? root.accent : Theme.muted
|
||||
|
||||
transform: Matrix4x4 {
|
||||
matrix: Qt.matrix4x4(1, -Theme.skew, 0, 6 * Theme.skew,
|
||||
0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
|
||||
}
|
||||
|
||||
Behavior on width {
|
||||
enabled: !drag.active
|
||||
NumberAnimation { duration: Theme.durFast }
|
||||
@@ -55,7 +46,7 @@ Item {
|
||||
}
|
||||
|
||||
// Handle
|
||||
Rectangle {
|
||||
Skew {
|
||||
id: handle
|
||||
width: 6
|
||||
height: hover.hovered || drag.active ? 18 : 14
|
||||
@@ -63,11 +54,6 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
x: Math.max(0, Math.min(1, root.value)) * root.width - width / 2
|
||||
|
||||
transform: Matrix4x4 {
|
||||
matrix: Qt.matrix4x4(1, -Theme.skew, 0, height * Theme.skew,
|
||||
0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
|
||||
}
|
||||
|
||||
Behavior on height {
|
||||
NumberAnimation { duration: Theme.durFast; easing.type: Easing.OutBack }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user