From 885824f8c8ed4537339a474c2ba25e1b4288403c Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Tue, 21 Mar 2023 09:38:01 +0100 Subject: [PATCH] NotificationArea: Preference dialog add preferences to control inactive window behaviour --- src/Gui/DlgSettingsNotificationArea.cpp | 9 ++++++ src/Gui/DlgSettingsNotificationArea.ui | 39 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/src/Gui/DlgSettingsNotificationArea.cpp b/src/Gui/DlgSettingsNotificationArea.cpp index d2c897a929..b1bfee6815 100644 --- a/src/Gui/DlgSettingsNotificationArea.cpp +++ b/src/Gui/DlgSettingsNotificationArea.cpp @@ -49,6 +49,8 @@ DlgSettingsNotificationArea::DlgSettingsNotificationArea(QWidget* parent) ui->maxNotifications->setEnabled(true); ui->maxWidgetMessages->setEnabled(true); ui->autoRemoveUserNotifications->setEnabled(true); + ui->hideNonIntrusiveNotificationsWhenWindowDeactivated->setEnabled(true); + ui->preventNonIntrusiveNotificationsWhenWindowNotActive->setEnabled(true); QMessageBox::information(this, tr("Notification Area"), tr("Activation of the Notification Area only takes effect after an application restart.")); } @@ -60,6 +62,8 @@ DlgSettingsNotificationArea::DlgSettingsNotificationArea(QWidget* parent) ui->maxNotifications->setEnabled(false); ui->maxWidgetMessages->setEnabled(false); ui->autoRemoveUserNotifications->setEnabled(false); + ui->hideNonIntrusiveNotificationsWhenWindowDeactivated->setEnabled(false); + ui->preventNonIntrusiveNotificationsWhenWindowNotActive->setEnabled(false); // N.B: Deactivation is handled by the Notification Area itself, as it listens to all its configuration parameters. } }); @@ -79,6 +83,8 @@ void DlgSettingsNotificationArea::saveSettings() ui->maxWidgetMessages->onSave(); ui->autoRemoveUserNotifications->onSave(); ui->notificationWidth->onSave(); + ui->hideNonIntrusiveNotificationsWhenWindowDeactivated->onSave(); + ui->preventNonIntrusiveNotificationsWhenWindowNotActive->onSave(); } void DlgSettingsNotificationArea::loadSettings() @@ -91,6 +97,9 @@ void DlgSettingsNotificationArea::loadSettings() ui->maxWidgetMessages->onRestore(); ui->autoRemoveUserNotifications->onRestore(); ui->notificationWidth->onRestore(); + ui->hideNonIntrusiveNotificationsWhenWindowDeactivated->onRestore(); + ui->preventNonIntrusiveNotificationsWhenWindowNotActive->onRestore(); + } void DlgSettingsNotificationArea::changeEvent(QEvent *e) diff --git a/src/Gui/DlgSettingsNotificationArea.ui b/src/Gui/DlgSettingsNotificationArea.ui index 18a5bca2d2..fe01afbea3 100644 --- a/src/Gui/DlgSettingsNotificationArea.ui +++ b/src/Gui/DlgSettingsNotificationArea.ui @@ -133,6 +133,45 @@ + + + + Any open non-intrusive notifications will disappear when another window is activated + + + Hide when other window is activated + + + true + + + HideNonIntrusiveNotificationsWhenWindowDeactivated + + + NotificationArea + + + + + + + Prevent non-intrusive notifications from appearing when the FreeCAD Window is not the active window + + + Do not show when inactive + + + true + + + PreventNonIntrusiveNotificationsWhenWindowNotActive + + + NotificationArea + + + +