diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-04-16 17:56:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-16 17:56:25 +0100 |
| commit | 4cce7f60a9c8772d18ffb43cb74aa227ab4b3bc4 (patch) | |
| tree | 855b7ae720b92a79facd020b178cc233baf97a1b /src/helpers | |
| parent | ff459f4a2af01e3c99ededc827b6a3edbda55965 (diff) | |
notifications: move and small refactor (#14094)
moves to notification/, and adds a new style manager getter.
Diffstat (limited to 'src/helpers')
| -rw-r--r-- | src/helpers/Monitor.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index 2c0727c0..eef68c2f 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -42,7 +42,7 @@ #include "Drm.hpp" #include <aquamarine/output/Output.hpp> #include "debug/log/Logger.hpp" -#include "debug/HyprNotificationOverlay.hpp" +#include "notification/NotificationOverlay.hpp" #include "MonitorFrameScheduler.hpp" #include <hyprutils/memory/UniquePtr.hpp> #include <hyprutils/string/String.hpp> @@ -896,7 +896,7 @@ bool CMonitor::applyMonitorRule(Config::CMonitorRule&& pMonitorRule, bool force) auto errorMessage = I18n::i18nEngine()->localize(I18n::TXT_KEY_NOTIF_MONITOR_MODE_FAIL, {{"name", m_name}, {"mode", std::format("{:X0}@{:.2f}Hz", mode->pixelSize, mode->refreshRate / 1000.f)}}); Log::logger->log(Log::WARN, errorMessage); - g_pHyprNotificationOverlay->addNotification(errorMessage, CHyprColor(0xff0000ff), 5000, ICON_WARNING); + Notification::overlay()->addNotification(errorMessage, CHyprColor(0xff0000ff), 5000, ICON_WARNING); m_refreshRate = mode->refreshRate / 1000.f; m_size = mode->pixelSize; @@ -1037,11 +1037,12 @@ bool CMonitor::applyMonitorRule(Config::CMonitorRule&& pMonitorRule, bool force) if (!autoScale) { Log::logger->log(Log::ERR, "Invalid scale passed to monitor, {} found suggestion {}", m_scale, searchScale); static auto PDISABLENOTIFICATION = CConfigValue<Hyprlang::INT>("misc:disable_scale_notification"); - if (!*PDISABLENOTIFICATION) - g_pHyprNotificationOverlay->addNotification( + if (!*PDISABLENOTIFICATION) { + Notification::overlay()->addNotification( I18n::i18nEngine()->localize(I18n::TXT_KEY_NOTIF_MONITOR_AUTO_SCALE, {{"name", m_name}, {"scale", std::format("{:.2f}", m_scale)}, {"fixed_scale", std::format("{:.2f}", searchScale)}}), CHyprColor(1.0, 0.0, 0.0, 1.0), 5000, ICON_WARNING); + } } m_scale = searchScale; } @@ -1683,7 +1684,7 @@ uint32_t CMonitor::isSolitaryBlocked(bool full) { return reasons; } - if (g_pHyprNotificationOverlay->hasAny()) { + if (Notification::overlay()->hasAny()) { reasons |= SC_NOTIFICATION; if (!full) return reasons; |
