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

List:       kde-commits
Subject:    KDE/kdebase/workspace/libs/plasma
From:       Marco Martin <notmart () gmail ! com>
Date:       2008-08-23 20:36:10
Message-ID: 1219523770.152789.24328.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 851491 by mart:

contentsRect() function, consistent with QGraphicsWidget::contentsRect()


 M  +15 -1     panelsvg.cpp  
 M  +5 -0      panelsvg.h  


--- trunk/KDE/kdebase/workspace/libs/plasma/panelsvg.cpp #851490:851491
@@ -62,7 +62,7 @@
     int leftWidth;
     int rightWidth;
     int bottomHeight;
-    
+
     //margins, are equal to the measures by default
     int topMargin;
     int leftMargin;
@@ -313,6 +313,20 @@
     bottom = panel->bottomMargin;
 }
 
+QRectF PanelSvg::contentsRect() const
+{
+    QSizeF size(panelSize());
+
+    if (size.isValid()) {
+        QRectF rect(QPointF(0, 0), size);
+        PanelData *panel = d->panels[d->prefix];
+
+        return rect.adjusted(panel->leftMargin, panel->topMargin, \
-panel->rightMargin, -panel->bottomMargin); +    } else {
+        return QRectF();
+    }
+}
+
 QBitmap PanelSvg::mask() const
 {
     PanelData *panel = d->panels[d->prefix];
--- trunk/KDE/kdebase/workspace/libs/plasma/panelsvg.h #851490:851491
@@ -119,6 +119,11 @@
         void getMargins(qreal &left, qreal &top, qreal &right, qreal &bottom) const;
 
         /**
+         * @return the rectangle of the center element, taking the margins into \
account. +         */
+        QRectF contentsRect() const;
+
+        /**
          * Sets the prefix (@see setElementPrefix) to 'north', 'south', 'west' and \
                'east'
          * when the location is TopEdge, BottomEdge, LeftEdge and RightEdge,
          * respectively. Clears the prefix in other cases.


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

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