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

List:       kdevelop-devel
Subject:    KMdi patches
From:       Alexander Dymo <cloudtemple () mksat ! net>
Date:       2003-12-03 22:14:27
[Download RAW message or body]

Today I've tried to address some KMdi related issues.
Two small changes for today for your review and approval:

mainwindow.diff
changes to raiseView():
don't dock back all widgets and don't show them again
previous implementation had this behaviour:
	dock back all widgets to the container
	show all of them
	determine which widget we want to raise
	raise widget
current implementation:
	check if the widget is visible
	if not, make it visible (docks only this widget back if necessary)

This works well for me, it removes flickering (that was unnecessary call to
showAllToolWin()) and it doesn't dock back, for example, GDB window
when I need to show Messages window.


qextmdi.diff
changes to toggle()
When the tab is toggled back (lowered), the active mdi child window
is focused.
For example when you press C-A-S-B while working in Messages window,
the window was hidden but code editor wasn't focused. The patch fixes this.

PS: qextmdi patch works is for lib/qextmdi (kde < 3.2)

-- 
Alexander Dymo
Ukrainian State Maritime Technical University, IT Department

["mainwindow.diff" (text/x-diff)]

Index: mainwindow.cpp
===================================================================
RCS file: /home/kde/kdevelop/src/mainwindow.cpp,v
retrieving revision 1.59
diff -U3 -r1.59 mainwindow.cpp
--- mainwindow.cpp	1 Dec 2003 18:42:44 -0000	1.59
+++ mainwindow.cpp	3 Dec 2003 21:59:56 -0000
@@ -204,7 +204,7 @@
   noViews              (0)
 {
 
- return;
+  return;
 #warning this crashes in ideal mode, looks like there are dangling pointers on \
opening another project  QPtrListIterator<QWidget> it(*pViews);
   for( ; it.current(); ++it)                                        // Iterate \
through all views @@ -629,40 +629,13 @@
     QPtrList<QWidget> *pViews        = 0L;             // The views to make a menu \
from  
     QWidget *wrapper = m_widgetMap[ view ];
-    if (!wrapper) {
-        // find the container
-        if (m_outputViews.contains(view))
-            pViews = &m_outputViews;
-        else if (m_outputViews.contains(view))
-            pViews = &m_selectViews;
-     
-        if (pViews) {
-            QPtrListIterator<QWidget> it(*pViews);
-            const  ToolDockBaseState allWinState(pViews);
-
-            if (allWinState.dockBaseMayBeDockBack) { // If it may be dock back, it \
                is invisible
-                allWinState.pDockBaseWindow->dockBack();  // Show it again
-            }
-            else if (allWinState.dockBaseIsHidden) {      // In toplevel mode the \
                tool window is just hidden
-                allWinState.pDockBaseWindow->show();      // Then show it
-            }
-            else {
-                // not a single tool window found, so we show all of them
-                showAllToolWin( pViews == &m_outputViews ? OutputView : TreeView, 1 \
                );
-            }
-        }
-    }
-    else {
+    if (wrapper)
         wrapper->setFocus();
-    }
-    
+
     KDockWidget* pDock = dockManager->findWidgetParentDock(wrapper ? wrapper : \
                view);
-    if (pDock) {
-        if ((pDock->parentWidget() && pDock->parentWidget()->isVisible()) ||
-            (!pDock->parentWidget() && pDock->isVisible()) ) {
+    if (pDock)
+        if (!pDock->isVisible())
             makeDockVisible(pDock);
-        }
-    }
 }
 
 


["qextmdi.diff" (text/x-diff)]

? kmdi-20031129.patch
? kmdi1.patch
? kmdi2.patch
? kmdi3.patch
? kmdi4.patch
? kmdi5.patch
? kmdi6.patch
? kmdi7.patch
? qextmdi.diff
Index: kmdidockcontainer.cpp
===================================================================
RCS file: /home/kde/kdevelop/lib/qextmdi/kmdidockcontainer.cpp,v
retrieving revision 1.8
diff -U3 -r1.8 kmdidockcontainer.cpp
--- kmdidockcontainer.cpp	9 Nov 2003 00:03:22 -0000	1.8
+++ kmdidockcontainer.cpp	3 Dec 2003 21:59:51 -0000
@@ -34,6 +34,7 @@
 #include <klocale.h>
 #endif
 
+#include "kmdimainfrm.h"
 #include "kmdidockcontainer.h"
 
 static const char* const not_close_xpm[]={
@@ -619,6 +620,9 @@
 	if (m_tb->isTabRaised(oldtab)) {
 		m_tb->setTab(oldtab,false);
 	    	tabClicked(oldtab);
+            KMdiMainFrm *mainFrm = dynamic_cast<KMdiMainFrm*>(m_mainWin);
+            if (mainFrm)
+                mainFrm->activeWindow()->setFocus();
 	} else {
 		kdDebug()<<"KMdiDockContainer::toggle(): raising tab"<<endl;
 		if (m_tb->tab(m_previousTab)==0) {

_______________________________________________
Kdevelop-devel mailing list
Kdevelop-devel@barney.cs.uni-potsdam.de
http://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel

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

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