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

List:       kde-commits
Subject:    branches/work/plasma-desktoplayout/kdelibs-plasma
From:       Ambroz Bizjak <ambro () b4ever ! net>
Date:       2008-12-21 0:26:19
Message-ID: 1229819179.036235.16623.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 899509 by abizjak:

Add appletTransformedByUser and appletTransformedItself signals.


 M  +10 -0     applet.h  
 M  +7 -0      private/applethandle.cpp  
 M  +2 -0      private/applethandle_p.h  


--- branches/work/plasma-desktoplayout/kdelibs-plasma/applet.h #899508:899509
@@ -572,6 +572,16 @@
         void geometryChanged();
 
         /**
+         * Emitted when the user completes a transformation of the applet.
+         */
+        void appletTransformedByUser();
+
+        /**
+         * Emitted when the applet changes its own geometry or transform.
+         */
+        void appletTransformedItself();
+
+        /**
          * Emitted by Applet subclasses when they change a sizeHint and wants to announce the change
          */
         void sizeHintChanged(Qt::SizeHint which);
--- branches/work/plasma-desktoplayout/kdelibs-plasma/private/applethandle.cpp #899508:899509
@@ -73,6 +73,9 @@
                              Theme::defaultTheme()->colorScheme());
     m_gradientColor = colorScheme.background(KColorScheme::NormalBackground).color();
 
+    m_originalGeom = m_applet->geometry();
+    m_originalTransform = m_applet->transform();
+
     QTransform originalMatrix = m_applet->transform();
     m_applet->resetTransform();
 
@@ -170,6 +173,10 @@
 
     m_applet->setZValue(m_zValue);
 
+    if (m_applet->geometry() != m_originalGeom || m_applet->transform() != m_originalTransform) {
+        emit m_applet->appletTransformedByUser();
+    }
+
     m_applet->update(); // re-render the background, now we've transformed the applet
 
     m_applet = 0;
--- branches/work/plasma-desktoplayout/kdelibs-plasma/private/applethandle_p.h #899508:899509
@@ -131,6 +131,8 @@
         QPointF m_pos;      //current position of applet in sceneCoords
         qreal m_zValue;     //current zValue of the applet, so it can be restored after drag.
         QSizeF m_originalSize;
+        QRectF m_originalGeom;
+        QTransform m_originalTransform;
 
         bool m_buttonsOnRight : 1;
         bool m_pendingFade : 1;
[prev in list] [next in list] [prev in thread] [next in thread] 

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