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

List:       kde-commits
Subject:    KDE/kdelibs/plasma/extenders
From:       Marco Martin <notmart () gmail ! com>
Date:       2010-12-15 15:01:19
Message-ID: 20101215150119.63AACAC8A8 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1206707 by mart:

auto resize at most at a third of the screen size.
this is still not perfect (should also take into account the user custom resize)
but avoids the widget being resize to completely ridiculous sizes


 M  +7 -1      extender.cpp  


--- trunk/KDE/kdelibs/plasma/extenders/extender.cpp #1206706:1206707
@@ -917,8 +917,14 @@
 
 void ExtenderPrivate::adjustSize()
 {
-    q->resize(mainWidget->effectiveSizeHint(Qt::PreferredSize));
+    QRect screenRect;
+    QSizeF size = mainWidget->effectiveSizeHint(Qt::PreferredSize);
+    if (applet && applet.data()->containment() && \
applet.data()->containment()->corona()) { +        screenRect = \
applet.data()->containment()->corona()->screenGeometry(applet.data()->containment()->screen());
  }
+    q->resize(qMin(screenRect.width()/3, (int)size.width()),
+              qMin(screenRect.height()/3, (int)size.height()));
+}
 
 bool Extender::isEmpty() const
 {


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

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