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

List:       kde-commits
Subject:    KDE/kdevplatform/sublime
From:       Milian Wolff <mail () milianw ! de>
Date:       2009-11-02 18:56:38
Message-ID: 1257188198.008519.20085.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1043964 by mwolff:

add toolbar toggle action to the default context menu of tool views, else hiding the \
toolbar could not be reverted. while we are at it, also add the actions from the \
toolbar to the context menu.

 M  +17 -1     ideal.cpp  


--- trunk/KDE/kdevplatform/sublime/ideal.cpp #1043963:1043964
@@ -509,6 +509,20 @@
         toggleAnchored = menu.addAction(KIcon("document-encrypt"), i18n("Lock"));
     }
 
+    if ( QMainWindow* toolView = qobject_cast<QMainWindow*>(widget()) ) {
+        menu.addSeparator();
+        QToolBar* bar = 0;
+        foreach( QObject* child, toolView->children() ) {
+            if ( bar = qobject_cast<QToolBar*>(child) ) {
+                break;
+            }
+        }
+        Q_ASSERT(bar);
+        menu.addActions(bar->actions());
+        menu.addSeparator();
+        menu.addAction(bar->toggleViewAction());
+    }
+
     QAction* triggered = menu.exec(senderWidget->mapToGlobal(point));
 
     if (triggered)
@@ -528,8 +542,10 @@
             pos = Sublime::Bottom;
         else if (triggered == right)
             pos = Sublime::Right;
+        else if (triggered == top)
+            pos = Sublime::Top;
         else
-            pos = Sublime::Top;
+            return;
 
         Area *area = m_area;
         View *view = m_view;


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

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