r14767 by fschmid - Better fix for Bug #5991, still not perfect, as the real cause for that is the fact that QToolBox doesn't handle the focus correct when switching pages.

scribus-commit scribus-commit at lists.scribus.net
Fri Feb 19 16:10:21 CET 2010


Revision: 14767
Author: fschmid
Date: 2010-02-19T15:02:17.994715Z
Commit message: Better fix for Bug #5991, still not perfect, as the real cause for that is the fact that QToolBox doesn't handle the focus correct when switching pages.

Changeset: 
M  /trunk/Scribus/scribus/ui/propertiespalette.cpp

Diffs:
Index: scribus/ui/propertiespalette.cpp
===================================================================
--- scribus/ui/propertiespalette.cpp	(revision 14766)
+++ scribus/ui/propertiespalette.cpp	(revision 14767)
@@ -1698,9 +1698,27 @@
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning())
 		return;
+	foreach (QObject *o, TabStack->widget(t)->children())
+	{
+		// Layouts, boxes etc aren't widgets at all
+		// so let's skip them silently...
+		QWidget *w = qobject_cast<QWidget*>(o);
+		if (w)
+		{
+			QWidget *i = TabStack->widget(t);
+			while ((i = i->nextInFocusChain()) != TabStack->widget(t))
+			{
+				if (((i->focusPolicy() & Qt::TabFocus) == Qt::TabFocus) && !i->focusProxy() && i->isEnabled())
+				{
+					i->setFocus();
+					break;
+				}
+			}
+		}
+	}
 	// fix for #5991: Property Palette text input box focus stays even when on another tab
 	// Disable widgets in all pages except current one - PV
-	bool enable;
+/*	bool enable;
 	for (int i = 0; i < TabStack->count(); ++i)
 	{
 		enable = (i == t);
@@ -1878,7 +1896,7 @@
 			SCustom->setEnabled(false);
 		}
 #endif
-	}
+	} */
 }
 
 void PropertiesPalette::setDoc(ScribusDoc *d)
@@ -2532,6 +2550,7 @@
 	}
 #endif
 	updateSpinBoxConstants();
+	connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
 }
 
 void PropertiesPalette::NewSel(int nr)




More information about the scribus-commit mailing list