Occasionally save window/split/tab layout

The window layout is only saved if something has been changed.
When something relevant to the window layout is changed, a save is
queued to run after 10 seconds.
If within those 10 seconds, another thing is changed, that timer is
reset and will run after 10 seconds again.

Events that cause the save to be queued up:
 - Tab created
 - Tab removed
 - Tab moved
 - Tab name changed
 - Split created
 - Split removed
 - Split moved
 - Split channel changed
 - Split resized
 - Window moved
 - Window resized

What currently does not trigger the save to be queued up:
 - Active tab changed
This commit is contained in:
Rasmus Karlsson
2018-10-07 16:27:40 +00:00
parent 7879fef3a0
commit a947bf74c8
8 changed files with 64 additions and 0 deletions
+11
View File
@@ -420,11 +420,22 @@ void BaseWindow::moveTo(QWidget *parent, QPoint point, bool offset)
void BaseWindow::resizeEvent(QResizeEvent *)
{
// Queue up save because: Window resized
getApp()->windows->queueSave();
this->moveIntoDesktopRect(this);
this->calcButtonsSizes();
}
void BaseWindow::moveEvent(QMoveEvent *event)
{
// Queue up save because: Window position changed
getApp()->windows->queueSave();
BaseWidget::moveEvent(event);
}
void BaseWindow::closeEvent(QCloseEvent *)
{
this->closing.invoke();