Changeset View
Changeset View
Standalone View
Standalone View
org.kde.desktop/Dial.qml
Show All 18 Lines | |||||
19 | * met: http://www.gnu.org/licenses/gpl-2.0.html. | 19 | * met: http://www.gnu.org/licenses/gpl-2.0.html. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | 22 | | |||
23 | import QtQuick 2.6 | 23 | import QtQuick 2.6 | ||
24 | import QtQuick.Controls 2.0 | 24 | import QtQuick.Controls 2.0 | ||
25 | import QtQuick.Controls.impl 2.0 | 25 | import QtQuick.Controls.impl 2.0 | ||
26 | import QtQuick.Templates 2.0 as T | 26 | import QtQuick.Templates 2.0 as T | ||
27 | import org.kde.qqc2desktopstyle.private 1.0 as StylePrivate | 27 | import org.kde.kirigami 2.2 as Kirigami | ||
28 | 28 | | |||
29 | T.Dial { | 29 | T.Dial { | ||
30 | id: control | 30 | id: control | ||
31 | 31 | | |||
32 | implicitWidth: 128 | 32 | implicitWidth: 128 | ||
33 | implicitHeight: 128 | 33 | implicitHeight: 128 | ||
34 | 34 | | |||
35 | background: DialRing { | 35 | background: DialRing { | ||
36 | width: control.availableWidth | 36 | width: control.availableWidth | ||
37 | height: control.availableHeight | 37 | height: control.availableHeight | ||
38 | color: control.visualFocus ? StylePrivate.SystemPaletteSingleton.highlight(control.enabled) : StylePrivate.SystemPaletteSingleton.text(control.enabled) | 38 | color: control.visualFocus ? Kirigami.Theme.highlightColor : Kirigami.Theme.textColor | ||
39 | progress: control.position | 39 | progress: control.position | ||
40 | opacity: control.enabled ? 0.5 : 0.3 | 40 | opacity: control.enabled ? 0.5 : 0.3 | ||
41 | } | 41 | } | ||
42 | 42 | | |||
43 | handle: Rectangle { | 43 | handle: Rectangle { | ||
44 | x: (control.width/2) + Math.cos((-(control.angle-90)*Math.PI)/180) * (control.width/2-width/2) - width/2 | 44 | x: (control.width/2) + Math.cos((-(control.angle-90)*Math.PI)/180) * (control.width/2-width/2) - width/2 | ||
45 | y: (control.height/2) + Math.sin(((control.angle-90)*Math.PI)/180) * (control.height/2-height/2) - height/2 | 45 | y: (control.height/2) + Math.sin(((control.angle-90)*Math.PI)/180) * (control.height/2-height/2) - height/2 | ||
46 | width: 18 | 46 | width: 18 | ||
47 | height: width | 47 | height: width | ||
48 | radius: 8 | 48 | radius: 8 | ||
49 | color: control.visualFocus ? StylePrivate.SystemPaletteSingleton.highlight(control.enabled) : StylePrivate.SystemPaletteSingleton.text(control.enabled) | 49 | color: control.visualFocus ? Kirigami.Theme.highlightColor : Kirigami.Theme.textColor | ||
50 | } | 50 | } | ||
51 | } | 51 | } |