From 0152937eb4abca9c7ef301431fff26d9dab486d8 Mon Sep 17 00:00:00 2001 From: PKev Date: Tue, 6 Oct 2015 16:13:47 +0300 Subject: [PATCH] fix: save position when moving widget fix #2063 --- src/widget/widget.cpp | 10 ++++++++++ src/widget/widget.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index 6fe478ff0..57611cbbe 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -451,6 +451,16 @@ Widget* Widget::getInstance() return instance; } +void Widget::moveEvent(QMoveEvent *event) +{ + if (event->type() == QEvent::Move) + { + saveWindowGeometry(); + saveSplitterGeometry(); + } + QWidget::moveEvent(event); +} + void Widget::closeEvent(QCloseEvent *event) { if (Settings::getInstance().getShowSystemTray() && Settings::getInstance().getCloseToTray() == true) diff --git a/src/widget/widget.h b/src/widget/widget.h index aca1462cd..b26084c16 100644 --- a/src/widget/widget.h +++ b/src/widget/widget.h @@ -157,6 +157,7 @@ protected: virtual void closeEvent(QCloseEvent *event) final override; virtual void changeEvent(QEvent *event) final override; virtual void resizeEvent(QResizeEvent *event) final override; + virtual void moveEvent(QMoveEvent *event) final override; private slots: void onAddClicked();