diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 8d53f3d8a..71bdace9b 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1940,7 +1940,7 @@ void CCompositor::updateWindowAnimatedDecorationValues(PHLWINDOW pWindow) { if (pWindow == m_lastWindow) *pWindow->m_realShadowColor = CHyprColor(*PSHADOWCOL); else - *pWindow->m_realShadowColor = CHyprColor(*PSHADOWCOLINACTIVE != INT64_MAX ? *PSHADOWCOLINACTIVE : *PSHADOWCOL); + *pWindow->m_realShadowColor = CHyprColor(*PSHADOWCOLINACTIVE != -1 ? *PSHADOWCOLINACTIVE : *PSHADOWCOL); } else { pWindow->m_realShadowColor->setValueAndWarp(CHyprColor(0, 0, 0, 0)); // no shadow } diff --git a/src/config/ConfigDescriptions.hpp b/src/config/ConfigDescriptions.hpp index a4bcf4409..57dea74b3 100644 --- a/src/config/ConfigDescriptions.hpp +++ b/src/config/ConfigDescriptions.hpp @@ -1015,10 +1015,28 @@ inline static const std::vector CONFIG_OPTIONS = { }, SConfigOptionDescription{ .value = "group:groupbar:text_color", - .description = "controls the group bar text color", + .description = "color for window titles in the groupbar", .type = CONFIG_OPTION_COLOR, .data = SConfigOptionDescription::SColorData{0xffffffff}, }, + SConfigOptionDescription{ + .value = "group:groupbar:text_color_inactive", + .description = "color for inactive windows' titles in the groupbar (if unset, defaults to text_color)", + .type = CONFIG_OPTION_COLOR, + .data = SConfigOptionDescription::SColorData{}, //TODO: UNSET? + }, + SConfigOptionDescription{ + .value = "group:groupbar:text_color_locked_active", + .description = "color for the active window's title in a locked group (if unset, defaults to text_color)", + .type = CONFIG_OPTION_COLOR, + .data = SConfigOptionDescription::SColorData{}, //TODO: UNSET? + }, + SConfigOptionDescription{ + .value = "group:groupbar:text_color_locked_inactive", + .description = "color for inactive windows' titles in locked groups (if unset, defaults to text_color_inactive)", + .type = CONFIG_OPTION_COLOR, + .data = SConfigOptionDescription::SColorData{}, //TODO: UNSET? + }, SConfigOptionDescription{ .value = "group:groupbar:col.active", .description = "active group border color", diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index c3cb8a58a..0e8ce8c91 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -520,6 +520,9 @@ CConfigManager::CConfigManager() { registerConfigVar("group:groupbar:render_titles", Hyprlang::INT{1}); registerConfigVar("group:groupbar:scrolling", Hyprlang::INT{1}); registerConfigVar("group:groupbar:text_color", Hyprlang::INT{0xffffffff}); + registerConfigVar("group:groupbar:text_color_inactive", Hyprlang::INT{-1}); + registerConfigVar("group:groupbar:text_color_locked_active", Hyprlang::INT{-1}); + registerConfigVar("group:groupbar:text_color_locked_inactive", Hyprlang::INT{-1}); registerConfigVar("group:groupbar:stacked", Hyprlang::INT{0}); registerConfigVar("group:groupbar:rounding", Hyprlang::INT{1}); registerConfigVar("group:groupbar:gradient_rounding", Hyprlang::INT{2}); @@ -575,7 +578,7 @@ CConfigManager::CConfigManager() { registerConfigVar("decoration:shadow:scale", {1.f}); registerConfigVar("decoration:shadow:sharp", Hyprlang::INT{0}); registerConfigVar("decoration:shadow:color", Hyprlang::INT{0xee1a1a1a}); - registerConfigVar("decoration:shadow:color_inactive", {(Hyprlang::INT)INT64_MAX}); + registerConfigVar("decoration:shadow:color_inactive", Hyprlang::INT{-1}); registerConfigVar("decoration:dim_inactive", Hyprlang::INT{0}); registerConfigVar("decoration:dim_strength", {0.5f}); registerConfigVar("decoration:dim_special", {0.2f}); diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index 7a6eebba6..386f158a9 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -240,7 +240,12 @@ void CHyprGroupBarDecoration::draw(PHLMONITOR pMonitor, float const& a) { pMonitor->m_scale)) .get(); - const auto titleTex = m_dwGroupMembers[WINDOWINDEX] == g_pCompositor->m_lastWindow ? pTitleTex->m_texActive : pTitleTex->m_texInactive; + SP titleTex; + if (m_dwGroupMembers[WINDOWINDEX] == g_pCompositor->m_lastWindow) + titleTex = GROUPLOCKED ? pTitleTex->m_texLockedActive : pTitleTex->m_texActive; + else + titleTex = GROUPLOCKED ? pTitleTex->m_texLockedInactive : pTitleTex->m_texInactive; + rect.y += std::ceil(((rect.height - titleTex->m_size.y) / 2.0) - (*PTEXTOFFSET * pMonitor->m_scale)); rect.height = titleTex->m_size.y; rect.width = titleTex->m_size.x; @@ -279,10 +284,13 @@ void CHyprGroupBarDecoration::invalidateTextures() { } CTitleTex::CTitleTex(PHLWINDOW pWindow, const Vector2D& bufferSize, const float monitorScale) : m_content(pWindow->m_title), m_windowOwner(pWindow) { - static auto FALLBACKFONT = CConfigValue("misc:font_family"); - static auto PTITLEFONTFAMILY = CConfigValue("group:groupbar:font_family"); - static auto PTITLEFONTSIZE = CConfigValue("group:groupbar:font_size"); - static auto PTEXTCOLOR = CConfigValue("group:groupbar:text_color"); + static auto FALLBACKFONT = CConfigValue("misc:font_family"); + static auto PTITLEFONTFAMILY = CConfigValue("group:groupbar:font_family"); + static auto PTITLEFONTSIZE = CConfigValue("group:groupbar:font_size"); + static auto PTEXTCOLORACTIVE = CConfigValue("group:groupbar:text_color"); + static auto PTEXTCOLORINACTIVE = CConfigValue("group:groupbar:text_color_inactive"); + static auto PTEXTCOLORLOCKEDACTIVE = CConfigValue("group:groupbar:text_color_locked_active"); + static auto PTEXTCOLORLOCKEDINACTIVE = CConfigValue("group:groupbar:text_color_locked_inactive"); static auto PTITLEFONTWEIGHTACTIVE = CConfigValue("group:groupbar:font_weight_active"); static auto PTITLEFONTWEIGHTINACTIVE = CConfigValue("group:groupbar:font_weight_inactive"); @@ -290,11 +298,19 @@ CTitleTex::CTitleTex(PHLWINDOW pWindow, const Vector2D& bufferSize, const float const auto FONTWEIGHTACTIVE = (CFontWeightConfigValueData*)(PTITLEFONTWEIGHTACTIVE.ptr())->getData(); const auto FONTWEIGHTINACTIVE = (CFontWeightConfigValueData*)(PTITLEFONTWEIGHTINACTIVE.ptr())->getData(); - const CHyprColor COLOR = CHyprColor(*PTEXTCOLOR); + const CHyprColor COLORACTIVE = CHyprColor(*PTEXTCOLORACTIVE); + const CHyprColor COLORINACTIVE = *PTEXTCOLORINACTIVE == -1 ? COLORACTIVE : CHyprColor(*PTEXTCOLORINACTIVE); + const CHyprColor COLORLOCKEDACTIVE = *PTEXTCOLORLOCKEDACTIVE == -1 ? COLORACTIVE : CHyprColor(*PTEXTCOLORLOCKEDACTIVE); + const CHyprColor COLORLOCKEDINACTIVE = *PTEXTCOLORLOCKEDINACTIVE == -1 ? COLORINACTIVE : CHyprColor(*PTEXTCOLORLOCKEDINACTIVE); + const auto FONTFAMILY = *PTITLEFONTFAMILY != STRVAL_EMPTY ? *PTITLEFONTFAMILY : *FALLBACKFONT; - m_texActive = g_pHyprOpenGL->renderText(pWindow->m_title, COLOR, *PTITLEFONTSIZE * monitorScale, false, FONTFAMILY, bufferSize.x - 2, FONTWEIGHTACTIVE->m_value); - m_texInactive = g_pHyprOpenGL->renderText(pWindow->m_title, COLOR, *PTITLEFONTSIZE * monitorScale, false, FONTFAMILY, bufferSize.x - 2, FONTWEIGHTINACTIVE->m_value); +#define RENDER_TEXT(color, weight) g_pHyprOpenGL->renderText(pWindow->m_title, (color), *PTITLEFONTSIZE* monitorScale, false, FONTFAMILY, bufferSize.x - 2, (weight)); + m_texActive = RENDER_TEXT(COLORACTIVE, FONTWEIGHTACTIVE->m_value); + m_texInactive = RENDER_TEXT(COLORINACTIVE, FONTWEIGHTINACTIVE->m_value); + m_texLockedActive = RENDER_TEXT(COLORLOCKEDACTIVE, FONTWEIGHTACTIVE->m_value); + m_texLockedInactive = RENDER_TEXT(COLORLOCKEDINACTIVE, FONTWEIGHTINACTIVE->m_value); +#undef RENDER_TEXT } static void renderGradientTo(SP tex, CGradientValueData* grad) { diff --git a/src/render/decorations/CHyprGroupBarDecoration.hpp b/src/render/decorations/CHyprGroupBarDecoration.hpp index 5e1abc5a4..3e5d3c2d6 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.hpp +++ b/src/render/decorations/CHyprGroupBarDecoration.hpp @@ -14,6 +14,8 @@ class CTitleTex { SP m_texActive; SP m_texInactive; + SP m_texLockedActive; + SP m_texLockedInactive; std::string m_content; PHLWINDOWREF m_windowOwner;