Changeset View
Changeset View
Standalone View
Standalone View
applets/batterymonitor/package/contents/ui/PopupDialog.qml
Show All 15 Lines | |||||
16 | * License along with this program; if not, write to the | 16 | * License along with this program; if not, write to the | ||
17 | * Free Software Foundation, Inc., | 17 | * Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.0 | 21 | import QtQuick 2.0 | ||
22 | import org.kde.plasma.core 2.0 as PlasmaCore | 22 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
23 | import org.kde.plasma.components 2.0 as Components | 23 | import org.kde.plasma.components 2.0 as Components | ||
24 | import org.kde.plasma.components 3.0 as PlasmaComponents3 | ||||
24 | import org.kde.plasma.extras 2.0 as PlasmaExtras | 25 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||
25 | import org.kde.kquickcontrolsaddons 2.0 | 26 | import org.kde.kquickcontrolsaddons 2.0 | ||
26 | 27 | | |||
27 | FocusScope { | 28 | PlasmaComponents3.Page { | ||
28 | id: dialog | 29 | id: dialog | ||
29 | focus: true | | |||
30 | 30 | | |||
31 | property alias model: batteryList.model | 31 | property alias model: batteryList.model | ||
32 | property bool pluggedIn | 32 | property bool pluggedIn | ||
33 | 33 | | |||
34 | property int remainingTime | 34 | property int remainingTime | ||
35 | 35 | | |||
36 | property bool isBrightnessAvailable | 36 | property bool isBrightnessAvailable | ||
37 | property bool isKeyboardBrightnessAvailable | 37 | property bool isKeyboardBrightnessAvailable | ||
38 | 38 | | |||
39 | signal powermanagementChanged(bool checked) | 39 | signal powermanagementChanged(bool checked) | ||
40 | 40 | | |||
41 | Column { | 41 | header: PlasmaExtras.PlasmoidHeading { | ||
42 | id: settingsColumn | | |||
43 | anchors.horizontalCenter: parent.horizontalCenter | | |||
44 | width: parent.width - units.smallSpacing * 2 | | |||
45 | spacing: Math.round(units.gridUnit / 2) | | |||
46 | | ||||
47 | Components.Label { | | |||
48 | // this is just for metrics, TODO use TextMetrics in 5.4 instead | | |||
49 | id: percentageMeasurementLabel | | |||
50 | text: i18nc("Used for measurement", "100%") | | |||
51 | visible: false | | |||
52 | } | | |||
53 | | ||||
54 | PowerManagementItem { | 42 | PowerManagementItem { | ||
55 | id: pmSwitch | 43 | id: pmSwitch | ||
56 | width: parent.width | 44 | width: parent.width | ||
57 | onEnabledChanged: powermanagementChanged(enabled) | 45 | onEnabledChanged: powermanagementChanged(enabled) | ||
58 | KeyNavigation.tab: batteryList | 46 | KeyNavigation.tab: batteryList | ||
59 | KeyNavigation.backtab: keyboardBrightnessSlider | 47 | KeyNavigation.backtab: keyboardBrightnessSlider | ||
60 | } | 48 | } | ||
49 | } | ||||
50 | | ||||
51 | FocusScope { | ||||
52 | anchors.fill: parent | ||||
53 | anchors.topMargin: units.smallSpacing * 2 | ||||
54 | | ||||
55 | focus: true | ||||
56 | | ||||
57 | Column { | ||||
58 | id: settingsColumn | ||||
59 | anchors.horizontalCenter: parent.horizontalCenter | ||||
60 | width: parent.width - units.smallSpacing * 2 | ||||
61 | spacing: Math.round(units.gridUnit / 2) | ||||
61 | 62 | | |||
62 | BrightnessItem { | 63 | BrightnessItem { | ||
63 | id: brightnessSlider | 64 | id: brightnessSlider | ||
64 | width: parent.width | 65 | width: parent.width | ||
65 | 66 | | |||
66 | icon: "video-display-brightness" | 67 | icon: "video-display-brightness" | ||
67 | label: i18n("Display Brightness") | 68 | label: i18n("Display Brightness") | ||
68 | visible: isBrightnessAvailable | 69 | visible: isBrightnessAvailable | ||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 117 | ListView { | |||
123 | KeyNavigation.backtab: pmSwitch | 124 | KeyNavigation.backtab: pmSwitch | ||
124 | 125 | | |||
125 | delegate: BatteryItem { | 126 | delegate: BatteryItem { | ||
126 | width: parent.width | 127 | width: parent.width | ||
127 | battery: model | 128 | battery: model | ||
128 | } | 129 | } | ||
129 | } | 130 | } | ||
130 | } | 131 | } | ||
131 | 132 | } | |||
132 | } | 133 | } |