[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kde-workspace] plasma/generic/applets/batterymonitor/contents/ui: use Plasmoid.fullRepresentation
From:       Marco Martin <notmart () gmail ! com>
Date:       2014-02-06 13:48:30
Message-ID: E1WBPJe-0003Lp-W4 () scm ! kde ! org
[Download RAW message or body]

Git commit 970e39f0599cc2a06350bfc17354ec220b9b495a by Marco Martin.
Committed on 06/02/2014 at 13:46.
Pushed by mart into branch 'master'.

use Plasmoid.fullRepresentation

M  +3    -0    plasma/generic/applets/batterymonitor/contents/ui/PopupDialog.qml
M  +16   -12   plasma/generic/applets/batterymonitor/contents/ui/batterymonitor.qml

http://commits.kde.org/kde-workspace/970e39f0599cc2a06350bfc17354ec220b9b495a

diff --git a/plasma/generic/applets/batterymonitor/contents/ui/PopupDialog.qml \
b/plasma/generic/applets/batterymonitor/contents/ui/PopupDialog.qml index \
                fb5e858..9a6141d 100755
--- a/plasma/generic/applets/batterymonitor/contents/ui/PopupDialog.qml
+++ b/plasma/generic/applets/batterymonitor/contents/ui/PopupDialog.qml
@@ -155,9 +155,12 @@ FocusScope {
         id: noControlsLabel
         visible: !isKeyboardBrightnessAvailable && !isBrightnessAvailable
         text: i18n("No screen or keyboard brightness controls available")
+        wrapMode: Text.Wrap
         anchors {
             top: plasmoid.location == PlasmaCore.Types.BottomEdge ? undefined : \
                settingsColumn.bottom
             bottom: plasmoid.location == PlasmaCore.Types.BottomEdge ? \
settingsColumn.top : undefined +            left: parent.left
+            right: parent.right
             leftMargin: padding.margins.left
             rightMargin: padding.margins.right
             topMargin: 5
diff --git a/plasma/generic/applets/batterymonitor/contents/ui/batterymonitor.qml \
b/plasma/generic/applets/batterymonitor/contents/ui/batterymonitor.qml index \
                d13138e..1778a18 100755
--- a/plasma/generic/applets/batterymonitor/contents/ui/batterymonitor.qml
+++ b/plasma/generic/applets/batterymonitor/contents/ui/batterymonitor.qml
@@ -27,10 +27,8 @@ import "plasmapackage:/code/logic.js" as Logic
 
 Item {
     id: batterymonitor
-    Layout.minimumWidth: units.iconSizes.medium * 9
-    Layout.minimumHeight: dialogItem.implicitHeight
-    Layout.maximumHeight: dialogItem.implicitHeight
-
+    Plasmoid.switchWidth: units.gridUnit * 10
+    Plasmoid.switchHeight: units.gridUnit * 10
     property bool show_remaining_time: false
 
     LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
@@ -61,13 +59,6 @@ Item {
         }
     }
 
-    function popupEventSlot(popped) {
-        dialogItem.popupShown = popped;
-        if (popped) {
-            dialogItem.forceActiveFocus();
-        }
-    }
-
     Plasmoid.compactRepresentation: CompactRepresentation { }
 
     property QtObject pmSource: PlasmaCore.DataSource {
@@ -115,8 +106,21 @@ Item {
         property string tooltipImage
     }
 
-    PopupDialog {
+    Plasmoid.fullRepresentation: PopupDialog {
         id: dialogItem
+        Layout.minimumWidth: units.iconSizes.medium * 9
+        Layout.minimumHeight: dialogItem.implicitHeight
+        Layout.maximumHeight: dialogItem.implicitHeight
+
+        Connections {
+            target: plasmoid
+            onExpandedChanged: {
+                dialogItem.popupShown = popped;
+                if (popped) {
+                    dialogItem.forceActiveFocus();
+                }
+            }
+        }
         model: batteries
         anchors.fill: parent
         focus: true


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic