core: splash_color configuration option (#160)

This commit is contained in:
LOSEARDES77 2024-04-04 21:52:48 +02:00 committed by GitHub
parent 5838c90cd2
commit 437ac0530b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -532,7 +532,11 @@ void CHyprpaper::renderWallpaperForMonitor(SMonitor* pMonitor) {
const auto FONTSIZE = (int)(DIMENSIONS.y / 76.0 / scale); const auto FONTSIZE = (int)(DIMENSIONS.y / 76.0 / scale);
cairo_set_font_size(PCAIRO, FONTSIZE); 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<Hyprlang::INT* const*>(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_t textExtents;
cairo_text_extents(PCAIRO, SPLASH.c_str(), &textExtents); cairo_text_extents(PCAIRO, SPLASH.c_str(), &textExtents);

View file

@ -136,6 +136,7 @@ CConfigManager::CConfigManager() {
config->addConfigValue("ipc", Hyprlang::INT{1L}); config->addConfigValue("ipc", Hyprlang::INT{1L});
config->addConfigValue("splash", Hyprlang::INT{0L}); config->addConfigValue("splash", Hyprlang::INT{0L});
config->addConfigValue("splash_offset", Hyprlang::FLOAT{2.F}); config->addConfigValue("splash_offset", Hyprlang::FLOAT{2.F});
config->addConfigValue("splash_color", Hyprlang::INT{0x55ffffff});
config->registerHandler(&handleWallpaper, "wallpaper", {.allowFlags = false}); config->registerHandler(&handleWallpaper, "wallpaper", {.allowFlags = false});
config->registerHandler(&handleUnload, "unload", {.allowFlags = false}); config->registerHandler(&handleUnload, "unload", {.allowFlags = false});