Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 9e8230873ca69f393e5304ceb1afeac2 > files > 17

kdebase4-workspace-4.2.4-0.6mdv2009.0.src.rpm

#
# Allow the buttons to go down to 16px in size; of course, this screws over 
# everyone with moderate size panels who'd like normal sized icons.
# BUG:180278
#

--- workspace/plasma/applets/lock_logout/lockout.cpp  2009/01/11 23:00:09 909645
+++ workspace/plasma/applets/lock_logout/lockout.cpp  2009/01/11 23:02:17 909646
@@ -41,12 +41,13 @@
 #include <windows.h>
 #endif // Q_OS_WIN
 
-#define MINSIZE 48
+static const int MINBUTTONSIZE = 8;
+static const int MARGINSIZE = 2;
 
 LockOut::LockOut(QObject *parent, const QVariantList &args)
     : Plasma::Applet(parent, args)
 {
-    resize(MINSIZE*2,MINSIZE*4);
+    resize(MINBUTTONSIZE, MINBUTTONSIZE * 2 + MARGINSIZE);
 }
 
 void LockOut::init()
@@ -76,7 +77,7 @@
 
     switch (formFactor()) {
         case Plasma::Vertical:
-            if (geometry().width() >= MINSIZE) {
+            if (geometry().width() >= MINBUTTONSIZE * 2 + MARGINSIZE) {
                 direction = Qt::Horizontal;
                 ratioToKeep = 2;
             } else {
@@ -85,7 +86,7 @@
             }
             break;
         case Plasma::Horizontal:
-            if (geometry().height() >= MINSIZE) {
+            if (geometry().height() >= MINBUTTONSIZE * 2 + MARGINSIZE) {
                 direction = Qt::Vertical;
                 ratioToKeep = 0.5;
             } else {
@@ -96,6 +97,13 @@
         default:
             direction = Qt::Vertical;
     }
+
+    if (direction == Qt::Horizontal) {
+        setMinimumSize(MINBUTTONSIZE * 2 + MARGINSIZE, MINBUTTONSIZE);
+    } else {
+        setMinimumSize(MINBUTTONSIZE, MINBUTTONSIZE * 2 + MARGINSIZE);
+    }
+
     if (direction != m_layout->orientation()) {
         m_layout->setOrientation(direction);
     }