File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,8 @@ MainWindow::MainWindow(QWidget *parent)
129129 m_shortcutEditor(new ShortcutEditor(this )), m_selectSubtitle(true ),
130130 m_rowChanged(false ), m_reloadEnabled(false ),
131131 m_filewatcher(new QFileSystemWatcher),
132- m_scriptProperties(new QLabel(this )), m_countDown(new QLabel(this )) {
132+ m_scriptProperties(new QLabel(this )), m_countDown(new QLabel(this )),
133+ m_windowShown(false ) {
133134 ui->setupUi (this );
134135 m_defaultPalette = qApp->palette ();
135136
@@ -342,6 +343,12 @@ void MainWindow::closeEvent(QCloseEvent *) {
342343}
343344
344345void MainWindow::showEvent (QShowEvent *) {
346+ if (m_windowShown) {
347+ // No need to restore settings on each show event.
348+ // (eg. when restoring window after minized state)
349+ return ;
350+ }
351+
345352 // Restore settings
346353 QSettings settings;
347354
@@ -422,6 +429,8 @@ void MainWindow::showEvent(QShowEvent *) {
422429 }
423430 ui->actionAddDelay ->setText (" +" + text);
424431 ui->actionSubDelay ->setText (" -" + text);
432+
433+ m_windowShown = true ;
425434}
426435
427436ConfigEditor *MainWindow::configEditor () { return m_preferences; }
Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ public slots:
156156 int m_subtitleInterval;
157157 int m_subtitleMinDuration;
158158 int m_delayMilliseconds;
159+ bool m_windowShown;
159160};
160161
161162#endif // MAINWINDOW_H
You can’t perform that action at this time.
0 commit comments