diff --git a/src/osd/osdpretty.cpp b/src/osd/osdpretty.cpp index ea5c10a27..e88eab534 100644 --- a/src/osd/osdpretty.cpp +++ b/src/osd/osdpretty.cpp @@ -132,10 +132,6 @@ OSDPretty::OSDPretty(Mode mode, QWidget *parent) QObject::connect(fader_, &QTimeLine::valueChanged, this, &OSDPretty::FaderValueChanged); QObject::connect(fader_, &QTimeLine::finished, this, &OSDPretty::FaderFinished); -#ifdef Q_OS_WIN - set_fading_enabled(true); -#endif - // Load the show edges and corners QImage shadow_edge(":/pictures/osd_shadow_edge.png"); QImage shadow_corner(":/pictures/osd_shadow_corner.png"); @@ -247,6 +243,11 @@ void OSDPretty::Load() { background_opacity_ = s.value("background_opacity", 0.85).toFloat(); font_.fromString(s.value("font", "Verdana,9,-1,5,50,0,0,0,0,0").toString()); disable_duration_ = s.value("disable_duration", false).toBool(); +#ifdef Q_OS_WIN + fading_enabled_ = s.value("fading", true).toBool(); +#else + fading_enabled_ = s.value("fading", false).toBool(); +#endif if (s.contains("popup_screen")) { popup_screen_name_ = s.value("popup_screen").toString(); diff --git a/src/osd/osdpretty.h b/src/osd/osdpretty.h index e3ea4f979..814782996 100644 --- a/src/osd/osdpretty.h +++ b/src/osd/osdpretty.h @@ -76,9 +76,6 @@ class OSDPretty : public QWidget { void SetMessage(const QString &summary, const QString& message, const QImage &image); void ShowMessage(const QString &summary, const QString& message, const QImage &image); - // Controls the fader. This is enabled by default on Windows. - void set_fading_enabled(bool enabled) { fading_enabled_ = enabled; } - // Popup duration in seconds. Only used in Mode_Popup. void set_popup_duration(int msec); @@ -95,6 +92,7 @@ class OSDPretty : public QWidget { QPoint popup_pos() const { return popup_pos_; } QFont font() const { return font_; } bool disable_duration() const { return disable_duration_; } + bool fading() const { return fading_enabled_; } // When the user has been moving the popup, use these to get its current position and screen. // Note that these return invalid values if the popup is hidden. diff --git a/src/settings/notificationssettingspage.cpp b/src/settings/notificationssettingspage.cpp index 9f8983a61..a82fb7e02 100644 --- a/src/settings/notificationssettingspage.cpp +++ b/src/settings/notificationssettingspage.cpp @@ -197,6 +197,9 @@ void NotificationsSettingsPage::Load() { ui_->notifications_bg_preset->setCurrentIndex(2); ui_->notifications_bg_preset->setItemData(2, QColor(color), Qt::DecorationRole); ui_->notifications_disable_duration->setChecked(pretty_popup_->disable_duration()); + + ui_->notifications_fading->setChecked(pretty_popup_->fading()); + UpdatePopupVisible(); Init(ui_->layout_notificationssettingspage->parentWidget()); @@ -236,6 +239,7 @@ void NotificationsSettingsPage::Save() { s.setValue("popup_pos", pretty_popup_->popup_pos()); s.setValue("font", pretty_popup_->font().toString()); s.setValue("disable_duration", ui_->notifications_disable_duration->isChecked()); + s.setValue("fading", ui_->notifications_fading->isChecked()); s.endGroup(); } diff --git a/src/settings/notificationssettingspage.ui b/src/settings/notificationssettingspage.ui index bd4b24793..b649585c4 100644 --- a/src/settings/notificationssettingspage.ui +++ b/src/settings/notificationssettingspage.ui @@ -284,13 +284,6 @@ Pretty OSD options - - - - Background opacity - - - @@ -305,6 +298,34 @@ + + + + Text options + + + + + + + Choose font... + + + + + + + Choose color... + + + + + + + Background opacity + + + @@ -324,24 +345,10 @@ - - + + - Text options - - - - - - - Choose color... - - - - - - - Choose font... + Enable fading