Changeset View
Changeset View
Standalone View
Standalone View
applets/batterymonitor/package/contents/ui/PowerManagementItem.qml
Show All 25 Lines | |||||
26 | 26 | | |||
27 | Column { | 27 | Column { | ||
28 | property alias enabled: pmCheckBox.checked | 28 | property alias enabled: pmCheckBox.checked | ||
29 | 29 | | |||
30 | spacing: 0 | 30 | spacing: 0 | ||
31 | 31 | | |||
32 | RowLayout { | 32 | RowLayout { | ||
33 | width: parent.width | 33 | width: parent.width | ||
34 | spacing: units.gridUnit | | |||
35 | | ||||
36 | MouseArea { | | |||
37 | Layout.fillWidth: true | | |||
38 | height: childrenRect.height | | |||
39 | onClicked: { | | |||
40 | pmCheckBox.forceActiveFocus() | | |||
41 | pmCheckBox.checked = !pmCheckBox.checked | | |||
42 | } | | |||
43 | | ||||
44 | PlasmaCore.ToolTipArea { | | |||
45 | anchors.fill: parent | | |||
46 | subText: i18n("Disabling power management will prevent your screen and computer from turning off automatically.\n\nMost applications will automatically suppress power management when they don't want to have you interrupted.") | | |||
47 | } | | |||
48 | | ||||
49 | RowLayout { | | |||
50 | width: parent.width | | |||
51 | spacing: units.gridUnit | | |||
52 | | ||||
53 | Item { | | |||
54 | width: units.iconSizes.medium | | |||
55 | height: width | | |||
56 | 34 | | |||
57 | Components.CheckBox { | 35 | Components.CheckBox { | ||
58 | id: pmCheckBox | 36 | id: pmCheckBox | ||
59 | anchors.centerIn: parent | 37 | Layout.fillWidth: true | ||
38 | text: i18n("Enable Power Management") | ||||
60 | checked: true | 39 | checked: true | ||
61 | // we don't want to mess with the checked state but still reflect that changing it might not yield the desired result | 40 | // we don't want to mess with the checked state but still reflect that changing it might not yield the desired result | ||
62 | opacity: inhibitions.length > 0 ? 0.5 : 1 | 41 | opacity: inhibitions.length > 0 ? 0.5 : 1 | ||
63 | Behavior on opacity { | 42 | Behavior on opacity { | ||
64 | NumberAnimation { duration: units.longDuration } | 43 | NumberAnimation { duration: units.longDuration } | ||
65 | } | 44 | } | ||
66 | } | | |||
67 | } | | |||
68 | 45 | | |||
69 | Components.Label { | 46 | PlasmaCore.ToolTipArea { | ||
70 | Layout.fillWidth: true | 47 | anchors.fill: parent | ||
71 | text: i18n("Enable Power Management") | 48 | subText: i18n("Disabling power management will prevent your screen and computer from turning off automatically.\n\nMost applications will automatically suppress power management when they don't want to have you interrupted.") | ||
72 | } | | |||
73 | } | 49 | } | ||
74 | } | 50 | } | ||
75 | 51 | | |||
76 | Components.ToolButton { | 52 | Components.ToolButton { | ||
77 | iconSource: "configure" | 53 | iconSource: "configure" | ||
78 | onClicked: batterymonitor.action_powerdevilkcm() | 54 | onClicked: batterymonitor.action_powerdevilkcm() | ||
79 | tooltip: i18n("Configure Power Saving...") | 55 | tooltip: i18n("Configure Power Saving...") | ||
80 | visible: batterymonitor.kcmsAuthorized | 56 | visible: batterymonitor.kcmsAuthorized | ||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |