From: Peter Kümmel Date: Wed, 14 Jun 2006 14:34:50 +0000 (+0000) Subject: load and restore correct windows postion X-Git-Tag: 1.6.10~13115 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f6c5d0d63aa4ec1a11c91f4316a19dbd652ed4d9;p=lyx.git load and restore correct windows postion git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14103 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt3/QtView.C b/src/frontends/qt3/QtView.C index 843f609c1a..69c43f95d7 100644 --- a/src/frontends/qt3/QtView.C +++ b/src/frontends/qt3/QtView.C @@ -55,14 +55,9 @@ int const statusbar_timer_value = 3000; -QtView::QtView(unsigned int width, unsigned int height, bool maximize) +QtView::QtView(unsigned int width, unsigned int height) : QMainWindow(), LyXView(), commandbuffer_(0) { - resize(width, height); - - if (maximize) - this->setWindowState(WindowMaximized); - qApp->setMainWidget(this); bufferview_.reset(new BufferView(this, width, height)); @@ -163,15 +158,16 @@ bool QtView::hasFocus() const void QtView::closeEvent(QCloseEvent *) { - LyX::ref().session().saveSessionInfo("WindowIsMaximized", (this->isMaximized() ? "yes" : "no")); + Session & session = LyX::ref().session(); + session.saveSessionInfo("WindowIsMaximized", (isMaximized() ? "yes" : "no")); // don't save maximized values - this->showNormal(); + showNormal(); // save windows size and position - LyX::ref().session().saveSessionInfo("WindowWidth", convert(width())); - LyX::ref().session().saveSessionInfo("WindowHeight", convert(height())); + session.saveSessionInfo("WindowWidth", convert(width())); + session.saveSessionInfo("WindowHeight", convert(height())); if (lyxrc.geometry_xysaved) { - LyX::ref().session().saveSessionInfo("WindowPosX", convert(x())); - LyX::ref().session().saveSessionInfo("WindowPosY", convert(y())); + session.saveSessionInfo("WindowPosX", convert(x())); + session.saveSessionInfo("WindowPosY", convert(y())); } // trigger LFUN_LYX_QUIT instead of quit directly // since LFUN_LYX_QUIT may have more cleanup stuff diff --git a/src/frontends/qt3/QtView.h b/src/frontends/qt3/QtView.h index eab76c803f..35737fa475 100644 --- a/src/frontends/qt3/QtView.h +++ b/src/frontends/qt3/QtView.h @@ -37,7 +37,7 @@ class QtView : public QMainWindow, public LyXView { Q_OBJECT public: /// create a main window of the given dimensions - QtView(unsigned int w, unsigned int h, bool maximize); + QtView(unsigned int w, unsigned int h); ~QtView();