From cd53c67f7938951bee41a2b0c02f01f2e6167fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Wed, 14 Jun 2006 14:32:39 +0000 Subject: [PATCH] load and restore correct windows postion git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14102 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/QtView.C | 19 ++++++++----------- src/frontends/qt4/QtView.h | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/frontends/qt4/QtView.C b/src/frontends/qt4/QtView.C index b242d65444..302f813739 100644 --- a/src/frontends/qt4/QtView.C +++ b/src/frontends/qt4/QtView.C @@ -70,14 +70,9 @@ int const statusbar_timer_value = 3000; } // namespace anon -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(Qt::WindowMaximized); - mainWidget_ = this; // setToolButtonStyle(Qt::ToolButtonIconOnly); @@ -184,13 +179,15 @@ bool QtView::hasFocus() const void QtView::closeEvent(QCloseEvent *) { + QRect geometry = normalGeometry(); + Session & session = LyX::ref().session(); // save windows size and position - LyX::ref().session().saveSessionInfo("WindowWidth", convert(this->normalGeometry().width())); - LyX::ref().session().saveSessionInfo("WindowHeight", convert(this->normalGeometry().height())); - LyX::ref().session().saveSessionInfo("WindowIsMaximized", (this->isMaximized() ? "yes" : "no")); + session.saveSessionInfo("WindowWidth", convert(geometry.width())); + session.saveSessionInfo("WindowHeight", convert(geometry.height())); + session.saveSessionInfo("WindowIsMaximized", (isMaximized() ? "yes" : "no")); if (lyxrc.geometry_xysaved) { - LyX::ref().session().saveSessionInfo("WindowPosX", convert(this->normalGeometry().x())); - LyX::ref().session().saveSessionInfo("WindowPosY", convert(this->normalGeometry().y())); + session.saveSessionInfo("WindowPosX", convert(geometry.x())); + session.saveSessionInfo("WindowPosY", convert(geometry.y())); } // trigger LFUN_LYX_QUIT instead of quit directly // since LFUN_LYX_QUIT may have more cleanup stuff diff --git a/src/frontends/qt4/QtView.h b/src/frontends/qt4/QtView.h index e74d41fa3e..937629dd7e 100644 --- a/src/frontends/qt4/QtView.h +++ b/src/frontends/qt4/QtView.h @@ -47,7 +47,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();