Changeset View
Changeset View
Standalone View
Standalone View
applets/batterymonitor/package/contents/ui/batterymonitor.qml
Show All 23 Lines | |||||
24 | import org.kde.plasma.plasmoid 2.0 | 24 | import org.kde.plasma.plasmoid 2.0 | ||
25 | import org.kde.plasma.core 2.0 as PlasmaCore | 25 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
26 | import org.kde.kcoreaddons 1.0 as KCoreAddons | 26 | import org.kde.kcoreaddons 1.0 as KCoreAddons | ||
27 | import org.kde.kquickcontrolsaddons 2.0 | 27 | import org.kde.kquickcontrolsaddons 2.0 | ||
28 | import "logic.js" as Logic | 28 | import "logic.js" as Logic | ||
29 | 29 | | |||
30 | Item { | 30 | Item { | ||
31 | id: batterymonitor | 31 | id: batterymonitor | ||
32 | Plasmoid.switchWidth: units.gridUnit * 10 | 32 | Plasmoid.switchWidth: units.gridUnit * 13 | ||
33 | Plasmoid.switchHeight: units.gridUnit * 10 | 33 | Plasmoid.switchHeight: units.gridUnit * 5 | ||
34 | 34 | | |||
35 | LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft | 35 | LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft | ||
36 | LayoutMirroring.childrenInherit: true | 36 | LayoutMirroring.childrenInherit: true | ||
37 | 37 | | |||
38 | Plasmoid.status: { | 38 | Plasmoid.status: { | ||
39 | if (powermanagementDisabled) { | 39 | if (powermanagementDisabled) { | ||
40 | return PlasmaCore.Types.ActiveStatus | 40 | return PlasmaCore.Types.ActiveStatus | ||
41 | } | 41 | } | ||
▲ Show 20 Lines • Show All 158 Lines • ▼ Show 20 Line(s) | 199 | sourceModel: PlasmaCore.DataModel { | |||
200 | dataSource: pmSource | 200 | dataSource: pmSource | ||
201 | sourceFilter: "Battery[0-9]+" | 201 | sourceFilter: "Battery[0-9]+" | ||
202 | } | 202 | } | ||
203 | } | 203 | } | ||
204 | } | 204 | } | ||
205 | 205 | | |||
206 | Plasmoid.fullRepresentation: PopupDialog { | 206 | Plasmoid.fullRepresentation: PopupDialog { | ||
207 | id: dialogItem | 207 | id: dialogItem | ||
208 | Layout.minimumWidth: units.iconSizes.medium * 9 | 208 | Layout.minimumWidth: Plasmoid.switchWidth | ||
209 | Layout.minimumHeight: units.gridUnit * 15 | 209 | Layout.minimumHeight: Plasmoid.switchHeight | ||
210 | // TODO Probably needs a sensible preferredHeight too | 210 | Layout.preferredWidth: Layout.minimumWidth * 1.5 | ||
211 | Layout.preferredHeight: Layout.minimumHeight * 4 | ||||
211 | 212 | | |||
212 | model: plasmoid.expanded ? batteries : null | 213 | model: plasmoid.expanded ? batteries : null | ||
213 | anchors.fill: parent | 214 | anchors.fill: parent | ||
214 | focus: true | 215 | focus: true | ||
215 | 216 | | |||
216 | isBrightnessAvailable: pmSource.data["PowerDevil"] && pmSource.data["PowerDevil"]["Screen Brightness Available"] ? true : false | 217 | isBrightnessAvailable: pmSource.data["PowerDevil"] && pmSource.data["PowerDevil"]["Screen Brightness Available"] ? true : false | ||
217 | isKeyboardBrightnessAvailable: pmSource.data["PowerDevil"] && pmSource.data["PowerDevil"]["Keyboard Brightness Available"] ? true : false | 218 | isKeyboardBrightnessAvailable: pmSource.data["PowerDevil"] && pmSource.data["PowerDevil"]["Keyboard Brightness Available"] ? true : false | ||
218 | 219 | | |||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |