From 437ac0530ba6893a80b2306e3765170f249c19f5 Mon Sep 17 00:00:00 2001 From: LOSEARDES77 <84414230+LOSEARDES77@users.noreply.github.com> Date: Thu, 4 Apr 2024 21:52:48 +0200 Subject: [PATCH] core: splash_color configuration option (#160) --- src/Hyprpaper.cpp | 6 +++++- src/config/ConfigManager.cpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Hyprpaper.cpp b/src/Hyprpaper.cpp index 34f2720..026ff34 100644 --- a/src/Hyprpaper.cpp +++ b/src/Hyprpaper.cpp @@ -532,7 +532,11 @@ void CHyprpaper::renderWallpaperForMonitor(SMonitor* pMonitor) { const auto FONTSIZE = (int)(DIMENSIONS.y / 76.0 / scale); cairo_set_font_size(PCAIRO, FONTSIZE); - cairo_set_source_rgba(PCAIRO, 1.0, 1.0, 1.0, 0.32); + static auto* const PSPLASHCOLOR = reinterpret_cast(g_pConfigManager->config->getConfigValuePtr("splash_color")->getDataStaticPtr()); + + Debug::log(LOG, "Splash color: %x", **PSPLASHCOLOR); + + cairo_set_source_rgba(PCAIRO, ((**PSPLASHCOLOR >> 16) & 0xFF) / 255.0, ((**PSPLASHCOLOR >> 8) & 0xFF) / 255.0, (**PSPLASHCOLOR & 0xFF) / 255.0, ((**PSPLASHCOLOR >> 24) & 0xFF) / 255.0); cairo_text_extents_t textExtents; cairo_text_extents(PCAIRO, SPLASH.c_str(), &textExtents); diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 1494fc8..2617de5 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -136,6 +136,7 @@ CConfigManager::CConfigManager() { config->addConfigValue("ipc", Hyprlang::INT{1L}); config->addConfigValue("splash", Hyprlang::INT{0L}); config->addConfigValue("splash_offset", Hyprlang::FLOAT{2.F}); + config->addConfigValue("splash_color", Hyprlang::INT{0x55ffffff}); config->registerHandler(&handleWallpaper, "wallpaper", {.allowFlags = false}); config->registerHandler(&handleUnload, "unload", {.allowFlags = false});