diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 6b54e984..cf16f52c 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -320,6 +320,8 @@ CConfigManager::CConfigManager() { m_pConfig->addConfigValue("misc:disable_hyprland_logo", {0L}); m_pConfig->addConfigValue("misc:disable_splash_rendering", {0L}); + m_pConfig->addConfigValue("misc:col.splash", {0xffffffffL}); + m_pConfig->addConfigValue("misc:splash_font_family", {"Sans"}); m_pConfig->addConfigValue("misc:force_default_wallpaper", {-1L}); m_pConfig->addConfigValue("misc:vfr", {1L}); m_pConfig->addConfigValue("misc:vrr", {0L}); diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index a73cfd5b..ffcd13d4 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -1912,12 +1912,18 @@ void CHyprOpenGLImpl::renderMirrored() { } void CHyprOpenGLImpl::renderSplash(cairo_t* const CAIRO, cairo_surface_t* const CAIROSURFACE, double offsetY, const Vector2D& size) { - cairo_select_font_face(CAIRO, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); + static auto* const PSPLASHCOLOR = (Hyprlang::INT* const*)g_pConfigManager->getConfigValuePtr("misc:col.splash"); + + static auto* const PSPLASHFONT = (Hyprlang::STRING const*)g_pConfigManager->getConfigValuePtr("misc:splash_font_family"); + + cairo_select_font_face(CAIRO, *PSPLASHFONT, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); const auto FONTSIZE = (int)(size.y / 76); cairo_set_font_size(CAIRO, FONTSIZE); - cairo_set_source_rgba(CAIRO, 1.0, 1.0, 1.0, 0.32); + const auto COLOR = CColor(**PSPLASHCOLOR); + + cairo_set_source_rgba(CAIRO, COLOR.r, COLOR.g, COLOR.b, COLOR.a); cairo_text_extents_t textExtents; cairo_text_extents(CAIRO, g_pCompositor->m_szCurrentSplash.c_str(), &textExtents); @@ -2013,7 +2019,7 @@ void CHyprOpenGLImpl::createBGTextureForMonitor(CMonitor* pMonitor) { cairo_set_source_surface(CAIRO, CAIROISURFACE, 0, 0); cairo_paint(CAIRO); - if (!*PNOSPLASH) + if (!**PNOSPLASH) renderSplash(CAIRO, CAIROSURFACE, origin.y * WPRATIO / MONRATIO * scale, IMAGESIZE); cairo_surface_flush(CAIROSURFACE);