Gui: Add Notification Area to Status bar

========================================

Parameter "NotificationAreaEnabled" can be used to completely disable the Notification Area.

If disabled it won't appear on the UI at all and no non-intrusive notification will be generated.
This commit is contained in:
Abdullah Tahiri
2022-12-29 16:01:17 +01:00
committed by abdullahtahiriyo
parent 60cb06e20c
commit b27bd2b4b5

View File

@@ -80,6 +80,7 @@
#include "DownloadManager.h"
#include "FileDialog.h"
#include "MenuManager.h"
#include "NotificationArea.h"
#include "ProgressBar.h"
#include "PropertyView.h"
#include "PythonConsole.h"
@@ -251,7 +252,6 @@ protected:
} // namespace Gui
/* TRANSLATOR Gui::MainWindow */
MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags f)
@@ -304,6 +304,17 @@ MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags f)
statusBar()->addPermanentWidget(progressBar, 0);
statusBar()->addPermanentWidget(d->sizeLabel, 0);
auto hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/NotificationArea");
auto notificationAreaEnabled = hGrp->GetBool("NotificationAreaEnabled", true);
if(notificationAreaEnabled) {
NotificationArea* notificationArea = new NotificationArea(statusBar());
notificationArea->setObjectName(QString::fromLatin1("notificationArea"));
notificationArea->setIcon(QIcon(QString::fromLatin1(":/icons/InTray.svg")));
notificationArea->setStyleSheet(QStringLiteral("text-align:left;"));
statusBar()->addPermanentWidget(notificationArea);
}
// clears the action label
d->actionTimer = new QTimer( this );
d->actionTimer->setObjectName(QString::fromLatin1("actionTimer"));