Re: bug showing/hiding menubar

"Ilya Konkov" <[email protected]> Mon, 28 Jan 2008 00:32:00 +0500
Newsgroups gmane.comp.kde.gwenview
Message-ID <[email protected]>
You are right. When setChecked() is called menuBar is not visible yet.
I looked in Konqueror sources, it is called in showEvent() there.
Should be fine with new patch.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________
Gwenview-general mailing list
Gwenview-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/gwenview-general
menubar-restore.patch (text/x-patch, 1.2 KB)
Index: mainwindow.h
===================================================================
--- mainwindow.h	(revision 767299)
+++ mainwindow.h	(working copy)
@@ -55,6 +55,7 @@
 	virtual void slotSetStatusBarText(const QString&);
 	virtual bool queryClose();
 	virtual QSize sizeHint() const;
+	virtual void showEvent(QShowEvent*);
 
 private Q_SLOTS:
 	void setActiveViewModeAction(QAction* action);
Index: mainwindow.cpp
===================================================================
--- mainwindow.cpp	(revision 767299)
+++ mainwindow.cpp	(working copy)
@@ -352,7 +352,6 @@
 			mWindow, SLOT(updateSlideShowAction()) );
 
 		mShowMenuBarAction = KStandardAction::showMenubar(mWindow, SLOT(toggleMenuBar()), actionCollection);
-		mShowMenuBarAction->setChecked(mWindow->menuBar()->isVisible());
 
 		KStandardAction::keyBindings(mWindow->guiFactory(),
 			SLOT(configureShortcuts()), actionCollection);
@@ -1385,6 +1384,12 @@
 }
 
 
+void MainWindow::showEvent(QShowEvent *event) {
+	d->mShowMenuBarAction->setChecked(menuBar()->isVisible());
+	KParts::MainWindow::showEvent(event);
+}
+
+
 void MainWindow::editLocation() {
 	d->mUrlNavigator->setUrlEditable(true);
 	d->mUrlNavigator->setFocus();