Changeset View
Changeset View
Standalone View
Standalone View
applets/batterymonitor/package/contents/ui/BrightnessItem.qml
Show All 19 Lines | |||||
20 | 20 | | |||
21 | import QtQuick 2.0 | 21 | import QtQuick 2.0 | ||
22 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.1 | ||
23 | 23 | | |||
24 | import org.kde.plasma.core 2.0 as PlasmaCore | 24 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
25 | import org.kde.plasma.components 2.0 as Components | 25 | import org.kde.plasma.components 2.0 as Components | ||
26 | import org.kde.plasma.components 3.0 as Components3 | 26 | import org.kde.plasma.components 3.0 as Components3 | ||
27 | 27 | | |||
28 | RowLayout { | 28 | ColumnLayout { | ||
29 | id: item | 29 | id: item | ||
30 | property alias icon: brightnessIcon.source | 30 | property alias icon: brightnessIcon.source | ||
31 | property alias label: brightnessLabel.text | 31 | property alias label: brightnessLabel.text | ||
32 | property alias value: brightnessSlider.value | 32 | property alias value: brightnessSlider.value | ||
33 | property alias maximumValue: brightnessSlider.to | 33 | property alias maximumValue: brightnessSlider.to | ||
34 | property alias stepSize: brightnessSlider.stepSize | 34 | property alias stepSize: brightnessSlider.stepSize | ||
35 | signal moved() | 35 | signal moved() | ||
36 | 36 | | |||
37 | spacing: units.gridUnit | 37 | spacing: 0 | ||
38 | 38 | | |||
39 | RowLayout { | ||||
39 | PlasmaCore.IconItem { | 40 | PlasmaCore.IconItem { | ||
40 | id: brightnessIcon | 41 | id: brightnessIcon | ||
41 | Layout.alignment: Qt.AlignTop | 42 | Layout.preferredHeight: units.iconSizes.smallMedium | ||
42 | Layout.preferredWidth: units.iconSizes.medium | 43 | Layout.preferredWidth: Layout.preferredHeight | ||
43 | Layout.preferredHeight: width | | |||
44 | } | 44 | } | ||
45 | 45 | | |||
46 | Column { | | |||
47 | id: brightnessColumn | | |||
48 | Layout.fillWidth: true | | |||
49 | Layout.alignment: Qt.AlignTop | | |||
50 | spacing: 0 | | |||
51 | | ||||
52 | Components.Label { | 46 | Components.Label { | ||
53 | id: brightnessLabel | 47 | id: brightnessLabel | ||
54 | width: parent.width | 48 | } | ||
55 | height: paintedHeight | | |||
56 | } | 49 | } | ||
57 | 50 | | |||
58 | Components3.Slider { | 51 | Components3.Slider { | ||
59 | id: brightnessSlider | 52 | id: brightnessSlider | ||
60 | width: parent.width | 53 | Layout.fillWidth: true | ||
54 | | ||||
61 | // Don't allow the slider to turn off the screen | 55 | // Don't allow the slider to turn off the screen | ||
62 | // Please see https://git.reviewboard.kde.org/r/122505/ for more information | 56 | // Please see https://git.reviewboard.kde.org/r/122505/ for more information | ||
63 | from: to > 100 ? 1 : 0 | 57 | from: to > 100 ? 1 : 0 | ||
64 | stepSize: 1 | 58 | stepSize: 1 | ||
65 | onMoved: item.moved() | 59 | onMoved: item.moved() | ||
66 | } | 60 | } | ||
67 | } | 61 | } | ||
68 | } | |