property bool popupShown // somehow plasmoid.popupShowing isn't working
+ property int pmSwitchWidth: padding.margins.left + pmSwitch.implicitWidth + padding.margins.right
+
signal powermanagementChanged(bool checked)
PlasmaCore.FrameSvgItem {
property int activeIndex
delegate: BatteryItem { }
+ KeyNavigation.tab: pmSwitch
function updateSelection(old,active) {
itemAt(old).updateSelection();
top: plasmoid.location == BottomEdge ? undefined : parent.top
bottom: plasmoid.location == BottomEdge ? parent.bottom : undefined
}
+
+ PowerManagementItem {
+ id: pmSwitch
+ onEnabledChanged: powermanagementChanged(enabled)
+ KeyNavigation.tab: batteryList
+ }
}
PlasmaCore.SvgItem {
--- /dev/null
+/*
+ * Copyright 2012-2013 Daniel Nicoletti <dantti12@gmail.com>
+ * Copyright 2013 Kai Uwe Broulik <kde@privat.broulik.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import QtQuick 1.1
+import org.kde.plasma.core 0.1 as PlasmaCore
+import org.kde.plasma.components 0.1 as Components
+import org.kde.qtextracomponents 0.1
+
+FocusScope {
+ id: brightnessItem
+ clip: true
+ width: parent.width
+ height: Math.max(pmCheckBox.height, pmLabel.height) + padding.margins.top + padding.margins.bottom
+
+ property bool enabled: pmCheckBox.checked
+ property int implicitWidth: theme.iconSizes.dialog + pmCheckBox.implicitWidth + 6 + pmLabel.paintedWidth
+
+ Components.CheckBox {
+ id: pmCheckBox
+ anchors {
+ verticalCenter: parent.verticalCenter
+ left: parent.left
+ leftMargin: padding.margins.left + (theme.iconSizes.dialog - width)
+ topMargin: padding.margins.top
+ bottomMargin: padding.margins.bottom
+ }
+ focus: true
+ checked: true
+ }
+
+ Components.Label {
+ id: pmLabel
+ anchors {
+ verticalCenter: pmCheckBox.verticalCenter
+ left: pmCheckBox.right
+ leftMargin: 6
+ }
+ height: paintedHeight
+ text: i18n("Enable Power Management")
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onReleased: pmCheckBox.released();
+ onPressed: pmCheckBox.forceActiveFocus();
+ }
+}
+