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

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/applets/pager
From:       Robin Pedersen <robinpeder () gmail ! com>
Date:       2009-02-05 17:02:44
Message-ID: 1233853364.118841.21823.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 921782 by rpedersen:

Handle margins correctly both when pager is on desktop and in panel

This should result in correct behavior in both cases. But IMHO, this
requires a better solution..

BUG: 180440
BUG: 182487

 M  +8 -2      pager.cpp  


--- trunk/KDE/kdebase/workspace/plasma/applets/pager/pager.cpp #921781:921782
@@ -275,12 +275,18 @@
     qreal itemWidth;
 
     if (formFactor() == Plasma::Vertical) {
-        itemWidth = (contentsRect().width() - padding * (columns - 1)) / columns;
+        if (location() == Plasma::Desktop)
+            itemWidth = (contentsRect().width() - padding * (columns - 1)) / \
columns; +        else
+            itemWidth = (contentsRect().width() - leftMargin - rightMargin - padding \
                * (columns - 1)) / columns;
         m_widthScaleFactor = itemWidth / \
                Kephal::ScreenUtils::desktopGeometry().width();
         itemHeight = Kephal::ScreenUtils::desktopGeometry().height() * \
m_widthScaleFactor;  m_heightScaleFactor = m_widthScaleFactor;
     } else {
-        itemHeight = (contentsRect().height() - padding * (rows - 1)) / rows;
+        if (location() == Plasma::Desktop)
+            itemHeight = (contentsRect().height() - padding * (rows - 1)) / rows;
+        else
+            itemHeight = (contentsRect().height() - topMargin - bottomMargin - \
                padding * (rows - 1)) / rows;
         m_heightScaleFactor = itemHeight / \
                Kephal::ScreenUtils::desktopGeometry().height();
         itemWidth = Kephal::ScreenUtils::desktopGeometry().width() * \
m_heightScaleFactor;  if (m_displayedText == Name) {


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

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