From 5c0c53ccf8351e5f5ff0109d4b844964c6b03678 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Tue, 27 May 2008 12:01:50 +0000 Subject: [PATCH] Switch off fullscreen before closing a window. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24957 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 14 ++++++++++---- src/frontends/qt4/GuiView.h | 3 ++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 73e2c40866..44bd269fff 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -512,9 +512,9 @@ void GuiView::closeEvent(QCloseEvent * close_event) // Make sure that nothing will use this close to be closed View. guiApp->unregisterView(this); - // Save toolbars configuration if (isFullScreen()) { -// d.toolbars_->toggleFullScreen(!isFullScreen()); + // Switch off fullscreen before closing. + toggleFullScreen(); updateDialogs(); } @@ -1980,11 +1980,17 @@ void GuiView::lfunUiToggle(FuncRequest const & cmd) return; } #endif - if (arg != "fullscreen") { - message(bformat("LFUN_UI_TOGGLE " + _("%1$s unknown command!"), from_utf8(arg))); + if (arg == "fullscreen") { + toggleFullScreen(); return; } + message(bformat("LFUN_UI_TOGGLE " + _("%1$s unknown command!"), from_utf8(arg))); +} + + +void GuiView::toggleFullScreen() +{ QSettings settings; QString const key = "view-" + QString::number(id_); diff --git a/src/frontends/qt4/GuiView.h b/src/frontends/qt4/GuiView.h index c0530c78fa..091592b7c1 100644 --- a/src/frontends/qt4/GuiView.h +++ b/src/frontends/qt4/GuiView.h @@ -253,7 +253,8 @@ private: void initToolbars(); /// void lfunUiToggle(FuncRequest const & cmd); - + /// + void toggleFullScreen(); /// void insertLyXFile(docstring const & fname); /// -- 2.39.2