From c93b12ff0580be95fa0873c35014e0c570afc93a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Nie=C3=9Fen?= Date: Tue, 6 Oct 2015 21:12:59 +0200 Subject: [PATCH] better handling and display for systray checkbox buttons --- src/gui/SettingsWidget.cpp | 9 +++- src/gui/SettingsWidget.h | 1 + src/gui/SettingsWidgetGeneral.ui | 81 +++++++++++++++++++++++++------- 3 files changed, 74 insertions(+), 17 deletions(-) diff --git a/src/gui/SettingsWidget.cpp b/src/gui/SettingsWidget.cpp index 498eb0694..9edee6242 100644 --- a/src/gui/SettingsWidget.cpp +++ b/src/gui/SettingsWidget.cpp @@ -73,7 +73,7 @@ SettingsWidget::SettingsWidget(QWidget* parent) connect(m_generalUi->autoSaveAfterEveryChangeCheckBox, SIGNAL(toggled(bool)), this, SLOT(enableAutoSaveOnExit(bool))); connect(m_generalUi->systrayShowCheckBox, SIGNAL(toggled(bool)), - m_generalUi->systrayMinimizeToTrayCheckBox, SLOT(setEnabled(bool))); + this, SLOT(enableSystrayMinimizeToTray(bool))); connect(m_generalUi->systrayMinimizeToTrayCheckBox, SIGNAL(toggled(bool)), m_generalUi->systrayMinimizeOnCloseCheckBox, SLOT(setEnabled(bool))); @@ -201,3 +201,10 @@ void SettingsWidget::enableAutoSaveOnExit(bool checked) { m_generalUi->autoSaveOnExitCheckBox->setEnabled(!checked); } + +void SettingsWidget::enableSystrayMinimizeToTray(bool checked) +{ + m_generalUi->systrayMinimizeToTrayCheckBox->setEnabled(checked); + bool checked2 = m_generalUi->systrayMinimizeToTrayCheckBox->checkState(); + m_generalUi->systrayMinimizeOnCloseCheckBox->setEnabled(checked && checked2); +} diff --git a/src/gui/SettingsWidget.h b/src/gui/SettingsWidget.h index a53fd30b7..5ad572fed 100644 --- a/src/gui/SettingsWidget.h +++ b/src/gui/SettingsWidget.h @@ -51,6 +51,7 @@ private Q_SLOTS: void saveSettings(); void reject(); void enableAutoSaveOnExit(bool checked); + void enableSystrayMinimizeToTray(bool checked); private: QWidget* const m_secWidget; diff --git a/src/gui/SettingsWidgetGeneral.ui b/src/gui/SettingsWidgetGeneral.ui index 3f6c7e4b1..8b68fba7b 100644 --- a/src/gui/SettingsWidgetGeneral.ui +++ b/src/gui/SettingsWidgetGeneral.ui @@ -6,8 +6,8 @@ 0 0 - 456 - 346 + 684 + 394 @@ -104,24 +104,73 @@ - - - false + + + QLayout::SetMaximumSize - - Hide window to system tray when minimized - - + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + false + + + + 0 + 0 + + + + Hide window to system tray when minimized + + + + - - - false + + + QLayout::SetMaximumSize - - Hide window to system tray instead of App Exit - - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + Hide window to system tray instead of App Exit + + + +