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>
This commit is contained in:
MightyPlaza 2023-09-01 18:53:52 +01:00
parent ea1d16b51d
commit 9ce1310d62
No known key found for this signature in database
GPG key ID: 284C27FD27A6DC0D
2 changed files with 3 additions and 1 deletions

View file

@ -121,6 +121,7 @@ void CConfigManager::setDefaultVars() {
configValues["group:insert_after_current"].intValue = 1; configValues["group:insert_after_current"].intValue = 1;
configValues["group:focus_removed_window"].intValue = 1; configValues["group:focus_removed_window"].intValue = 1;
configValues["group:groupbar:font"].strValue = "Sans";
configValues["group:groupbar:gradients"].intValue = 1; configValues["group:groupbar:gradients"].intValue = 1;
configValues["group:groupbar:render_titles"].intValue = 1; configValues["group:groupbar:render_titles"].intValue = 1;
configValues["group:groupbar:scrolling"].intValue = 1; configValues["group:groupbar:scrolling"].intValue = 1;

View file

@ -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 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 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); const CColor COLOR = CColor(*PTEXTCOLOR);
@ -193,7 +194,7 @@ CTitleTex::CTitleTex(CWindow* pWindow, const Vector2D& bufferSize) {
PangoLayout* layout = pango_cairo_create_layout(CAIRO); PangoLayout* layout = pango_cairo_create_layout(CAIRO);
pango_layout_set_text(layout, szContent.c_str(), -1); 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_font_description_set_size(fontDesc, *PTITLEFONTSIZE * PANGO_SCALE);
pango_layout_set_font_description(layout, fontDesc); pango_layout_set_font_description(layout, fontDesc);
pango_font_description_free(fontDesc); pango_font_description_free(fontDesc);