From 9ce1310d627ef4a7894cd690d7deeefbe568bb78 Mon Sep 17 00:00:00 2001 From: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com> Date: Fri, 1 Sep 2023 18:53:52 +0100 Subject: [PATCH] add groupbar text font modified: src/config/ConfigManager.cpp modified: src/render/decorations/CHyprGroupBarDecoration.cpp Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com> --- src/config/ConfigManager.cpp | 1 + src/render/decorations/CHyprGroupBarDecoration.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index fe4e7d67..63411a28 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -121,6 +121,7 @@ void CConfigManager::setDefaultVars() { configValues["group:insert_after_current"].intValue = 1; configValues["group:focus_removed_window"].intValue = 1; + configValues["group:groupbar:font"].strValue = "Sans"; configValues["group:groupbar:gradients"].intValue = 1; configValues["group:groupbar:render_titles"].intValue = 1; configValues["group:groupbar:scrolling"].intValue = 1; diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index 3994e332..5da531ec 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -180,6 +180,7 @@ CTitleTex::CTitleTex(CWindow* pWindow, const Vector2D& bufferSize) { static auto* const PTITLEFONTSIZE = &g_pConfigManager->getConfigValuePtr("group:groupbar:titles_font_size")->intValue; static auto* const PTEXTCOLOR = &g_pConfigManager->getConfigValuePtr("group:groupbar:text_color")->intValue; + static auto* const PFONT = &g_pConfigManager->getConfigValuePtr("group:groupbar:font")->strValue; const CColor COLOR = CColor(*PTEXTCOLOR); @@ -193,7 +194,7 @@ CTitleTex::CTitleTex(CWindow* pWindow, const Vector2D& bufferSize) { PangoLayout* layout = pango_cairo_create_layout(CAIRO); pango_layout_set_text(layout, szContent.c_str(), -1); - PangoFontDescription* fontDesc = pango_font_description_from_string("Sans"); + PangoFontDescription* fontDesc = pango_font_description_from_string(PFONT->c_str()); pango_font_description_set_size(fontDesc, *PTITLEFONTSIZE * PANGO_SCALE); pango_layout_set_font_description(layout, fontDesc); pango_font_description_free(fontDesc);