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

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/desktop/shell
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2011-01-05 4:04:19
Message-ID: 20110105040419.E4CA8AC8B1 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1211852 by aseigo:

make "controller -> add widgets -> controller" work properly
BUG:262150


 M  +16 -2     panelcontroller.cpp  
 M  +4 -0      panelcontroller.h  
 M  +11 -5     panelview.cpp  


--- trunk/KDE/kdebase/workspace/plasma/desktop/shell/panelcontroller.cpp \
#1211851:1211852 @@ -313,7 +313,12 @@
     }
 
     ControllerWindow::setLocation(loc);
+    syncToLocation();
+}
 
+void PanelController::syncToLocation()
+{
+    const Plasma::Location loc = location();
     m_ruler->setLocation(loc);
 
     //The external layout gwts auto flipped when QApplication::layoutDirection() \
changes @@ -399,6 +404,8 @@
     m_ruler->show();
     updateGeometry();
 
+    setMinimumSize(QSize(0, 0));
+    setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
     resize(sizeHint());
 }
 
@@ -490,6 +497,13 @@
     showWidgetExplorer();
 }
 
+void PanelController::switchToController()
+{
+    setGraphicsWidget(0);
+    m_configWidget->show();
+    syncToLocation();
+}
+
 bool PanelController::eventFilter(QObject *watched, QEvent *event)
 {
     ControllerWindow::eventFilter(watched, event);
@@ -709,16 +723,16 @@
     switch (location()) {
         case Plasma::LeftEdge:
         case Plasma::RightEdge:
-            containment()->resize(QSize(newHeight, \
                (int)containment()->size().height()));
             containment()->setMinimumSize(QSize(newHeight, \
                (int)containment()->minimumSize().height()));
             containment()->setMaximumSize(QSize(newHeight, \
(int)containment()->maximumSize().height())); +            \
containment()->resize(QSize(newHeight, (int)containment()->size().height()));  break;
         case Plasma::TopEdge:
         case Plasma::BottomEdge:
         default:
-            containment()->resize(QSize((int)containment()->size().width(), \
                newHeight));
             containment()->setMinimumSize(QSize((int)containment()->minimumSize().width(), \
                newHeight));
             containment()->setMaximumSize(QSize((int)containment()->maximumSize().width(), \
newHeight)); +            \
containment()->resize(QSize((int)containment()->size().width(), newHeight));  break;
     }
 }
--- trunk/KDE/kdebase/workspace/plasma/desktop/shell/panelcontroller.h \
#1211851:1211852 @@ -62,6 +62,8 @@
     void setVisibilityMode(PanelView::VisibilityMode);
     PanelView::VisibilityMode panelVisibilityMode() const;
 
+    void switchToController();
+
 protected:
     bool eventFilter(QObject *watched, QEvent *event);
     void focusOutEvent(QFocusEvent *event);
@@ -84,6 +86,7 @@
     ToolButton *addTool(const QString iconName, const QString iconText, QWidget \
*parent, Qt::ToolButtonStyle style = Qt::ToolButtonTextBesideIcon, bool checkButton = \
false);  void syncRuler();
     void resizeFrameHeight(const int newHeight);
+    void syncToLocation();
 
 private Q_SLOTS:
     void themeChanged();
@@ -135,6 +138,7 @@
     bool m_drawMoveHint;
 
     QPoint m_lastPos;
+    QRect m_controllerRect;
 
     ToolButton *m_expandTool;
 };
--- trunk/KDE/kdebase/workspace/plasma/desktop/shell/panelview.cpp #1211851:1211852
@@ -996,17 +996,23 @@
         }
     }
 
-    if (!m_panelController->isVisible()) {
+    if (m_panelController->isVisible()) {
+        if (m_panelController->showingWidgetExplorer() ||
+            m_panelController->showingActivityManager()) {
+            m_panelController->switchToController();
+            m_panelController->move(m_panelController->positionForPanelGeometry(geometry()));
 +        } else {
+            Plasma::WindowEffects::slideWindow(m_panelController, location());
+            m_panelController->close();
+            updateStruts();
+        }
+    } else {
         m_editing = true;
         m_panelController->resize(m_panelController->sizeHint());
         m_panelController->move(m_panelController->positionForPanelGeometry(geometry()));
                
         Plasma::WindowEffects::slideWindow(m_panelController, location());
         kDebug() << "showing panel controller!" << m_panelController->geometry();
         m_panelController->show();
-    } else {
-        Plasma::WindowEffects::slideWindow(m_panelController, location());
-        m_panelController->close();
-        updateStruts();
     }
 }
 


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

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