From 316674fecf0934998ba5eb9cdcc1e3c1cbef0197 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 20 Mar 2023 15:32:11 +0000 Subject: notifs: use empty color for auto --- src/Compositor.cpp | 2 +- src/debug/HyprNotificationOverlay.cpp | 2 +- src/plugins/PluginAPI.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 25950a27..5650a657 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2299,6 +2299,6 @@ void CCompositor::performUserChecks() { if (std::ranges::any_of(BAD_PORTALS, [&](const std::string& portal) { return std::filesystem::exists("/usr/share/xdg-desktop-portal/portals/" + portal + ".portal"); })) { // bad portal detected g_pHyprNotificationOverlay->addNotification("You have one or more incompatible xdg-desktop-portal impls installed. Please remove incompatible ones to avoid issues.", - ICONS_COLORS[ICON_ERROR], 15000, ICON_ERROR); + CColor(0), 15000, ICON_ERROR); } } diff --git a/src/debug/HyprNotificationOverlay.cpp b/src/debug/HyprNotificationOverlay.cpp index fd4932c6..b19f56fa 100644 --- a/src/debug/HyprNotificationOverlay.cpp +++ b/src/debug/HyprNotificationOverlay.cpp @@ -40,7 +40,7 @@ void CHyprNotificationOverlay::addNotification(const std::string& text, const CC const auto PNOTIF = m_dNotifications.emplace_back(std::make_unique()).get(); PNOTIF->text = text; - PNOTIF->color = color; + PNOTIF->color = color == CColor(0) ? ICONS_COLORS[icon] : color; PNOTIF->started.reset(); PNOTIF->timeMs = timeMs; PNOTIF->icon = icon; diff --git a/src/plugins/PluginAPI.hpp b/src/plugins/PluginAPI.hpp index 80744bc3..813d7462 100644 --- a/src/plugins/PluginAPI.hpp +++ b/src/plugins/PluginAPI.hpp @@ -222,7 +222,7 @@ namespace HyprlandAPI { data has to contain: - text: std::string or const char* - time: uint64_t - - color: CColor + - color: CColor -> CColor(0) will apply the default color for the notification icon data may contain: - icon: eIcons -- cgit v1.2.3