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

List:       kde-commits
Subject:    playground/base/plasma/shells/mobile/containments/mobiledesktop
From:       Marco Martin <notmart () gmail ! com>
Date:       2010-08-01 22:02:17
Message-ID: 20100801220217.8D70DAC7A9 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1158010 by mart:


top events on the add button-This line, and those below, will be ignored--

M    mobiledesktop/appletsview.cpp
M    mobiledesktop/appletscontainer.cpp


 M  +3 -2      appletscontainer.cpp  
 M  +4 -1      appletsview.cpp  


--- trunk/playground/base/plasma/shells/mobile/containments/mobiledesktop/appletscontainer.cpp \
#1158009:1158010 @@ -47,12 +47,14 @@
     QAction *a = containment->action("add widgets");
     if (a) {
         m_addWidgetsButton = new Plasma::IconWidget(this);
+        m_addWidgetsButton->setObjectName("addWidgetsButton");
         m_addWidgetsButton->setAction(a);
         m_addWidgetsButton->setText(QString());
         m_addWidgetsButton->setSvg("widgets/action-overlays", "add-normal");
-        m_addWidgetsButton->resize(KIconLoader::SizeMedium, \
KIconLoader::SizeMedium); +        m_addWidgetsButton->resize(KIconLoader::SizeLarge, \
KIconLoader::SizeLarge);  }
 
+
     m_relayoutTimer = new QTimer(this);
     m_relayoutTimer->setSingleShot(true);
     connect(m_relayoutTimer, SIGNAL(timeout()), this, SLOT(relayout()));
@@ -114,7 +116,6 @@
 void AppletsContainer::relayout()
 {
     if (m_applets.isEmpty()) {
-        resize(KIconLoader::SizeMedium, KIconLoader::SizeMedium);
         m_addWidgetsButton->setPos(0,0);
         return;
     }
--- trunk/playground/base/plasma/shells/mobile/containments/mobiledesktop/appletsview.cpp \
#1158009:1158010 @@ -35,6 +35,7 @@
     m_moveTimer = new QTimer(this);
     m_moveTimer->setSingleShot(true);
     connect(m_moveTimer, SIGNAL(timeout()), this, SLOT(moveTimerTimeout()));
+    setAlignment(Qt::AlignCenter);
 }
 
 AppletsView::~AppletsView()
@@ -60,7 +61,9 @@
 
 bool AppletsView::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
 {
-    if (m_appletsContainer->isAppletsOverlayVisible()) {
+    if (m_appletsContainer->isAppletsOverlayVisible() ||
+        //FIXME: using the object name is not so pretty
+        (watched->isWidget() && static_cast<QGraphicsWidget \
*>(watched)->objectName() == "addWidgetsButton")) {  return false;
     }
 


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

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