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

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/applets/icon
From:       Christopher Blauvelt <cblauvelt () gmail ! com>
Date:       2008-01-03 22:34:34
Message-ID: 1199399674.788833.13187.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 756933 by cblauvelt:

Don't move the whole desktop when applets are locked.



 M  +20 -5     icon.cpp  
 M  +1 -0      icon.h  


--- trunk/KDE/kdebase/workspace/plasma/applets/icon/icon.cpp #756932:756933
@@ -25,6 +25,7 @@
 #include <QEvent>
 #include <QMimeData>
 
+#include <KGlobalSettings>
 #include <KDebug>
 #include <KLocale>
 #include <KIconLoader>
@@ -62,7 +63,7 @@
     KConfigGroup cg = config();
     //setMinimumSize(QSize(48,68));
 
-    connect(m_icon, SIGNAL(clicked()), this, SLOT(openUrl()));
+    connectMouseSlots();
     setUrl(cg.readEntry("Url", m_url));
     setDrawStandardBackground(false);
     setDisplayLines(2);
@@ -274,11 +275,14 @@
     QPointF curPos = transform().map(event->pos());
     QPointF lastPos = transform().map(event->lastPos());
     QPointF delta = curPos-lastPos;
-    QGraphicsItem* appletHandle = parentItem();
 
-    if(appletHandle && (formFactor() == Plasma::Planar)) {
-        //don't move the icon as well because appletHandle will do it for us
-        appletHandle->moveBy(delta.x(),delta.y());
+    if(!isImmutable()) {
+        QGraphicsItem* appletHandle = parentItem();
+
+        if(appletHandle && (formFactor() == Plasma::Planar)) {
+            //don't move the icon as well because appletHandle will do it for us
+            appletHandle->moveBy(delta.x(),delta.y());
+        }
     }
 }
 
@@ -368,5 +372,16 @@
     }
 }
 
+void IconApplet::connectMouseSlots()
+{
+    if(KGlobalSettings::singleClick()) {
+        //kDebug() << "Single-Click initialized.";
+        connect(m_icon, SIGNAL(clicked()), this, SLOT(openUrl()));
+    } else {
+        //kDebug() << "Double-Click initialized.";
+        connect(m_icon, SIGNAL(doubleClicked()), this, SLOT(openUrl()));
+    }
+}
+
 #include "icon.moc"
 
--- trunk/KDE/kdebase/workspace/plasma/applets/icon/icon.h #756932:756933
@@ -69,6 +69,7 @@
         void dropUrls(const KUrl::List& urls,
                       const KUrl& destination,
                       Qt::KeyboardModifiers modifier);
+        void connectMouseSlots();
 
         Plasma::Icon* m_icon;
         QString m_text;
[prev in list] [next in list] [prev in thread] [next in thread] 

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