mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-07 18:25:59 +01:00
groups: add option to configure font name (#3751)
This commit is contained in:
parent
a122271f09
commit
0476e1b498
2 changed files with 5 additions and 3 deletions
|
@ -129,6 +129,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_family"].strValue = "Sans";
|
||||||
configValues["group:groupbar:font_size"].intValue = 8;
|
configValues["group:groupbar:font_size"].intValue = 8;
|
||||||
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;
|
||||||
|
|
|
@ -179,8 +179,9 @@ CTitleTex::CTitleTex(CWindow* pWindow, const Vector2D& bufferSize) {
|
||||||
const auto CAIROSURFACE = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, bufferSize.x, bufferSize.y);
|
const auto CAIROSURFACE = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, bufferSize.x, bufferSize.y);
|
||||||
const auto CAIRO = cairo_create(CAIROSURFACE);
|
const auto CAIRO = cairo_create(CAIROSURFACE);
|
||||||
|
|
||||||
static auto* const PTITLEFONTSIZE = &g_pConfigManager->getConfigValuePtr("group:groupbar:font_size")->intValue;
|
static auto* const PTITLEFONTFAMILY = &g_pConfigManager->getConfigValuePtr("group:groupbar:font_family")->strValue;
|
||||||
static auto* const PTEXTCOLOR = &g_pConfigManager->getConfigValuePtr("group:groupbar:text_color")->intValue;
|
static auto* const PTITLEFONTSIZE = &g_pConfigManager->getConfigValuePtr("group:groupbar:font_size")->intValue;
|
||||||
|
static auto* const PTEXTCOLOR = &g_pConfigManager->getConfigValuePtr("group:groupbar:text_color")->intValue;
|
||||||
|
|
||||||
const CColor COLOR = CColor(*PTEXTCOLOR);
|
const CColor COLOR = CColor(*PTEXTCOLOR);
|
||||||
|
|
||||||
|
@ -194,7 +195,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(PTITLEFONTFAMILY->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);
|
||||||
|
|
Loading…
Reference in a new issue