Skip to content

Commit

Permalink
groupbar: scale groupbar text according to monitor scale (#4640)
Browse files Browse the repository at this point in the history
  • Loading branch information
https123456789 authored Feb 8, 2024
1 parent a6ccd36 commit 289d424
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/render/decorations/CHyprGroupBarDecoration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ CTitleTex::CTitleTex(CWindow* pWindow, const Vector2D& bufferSize) {
pWindowOwner = pWindow;
const auto CAIROSURFACE = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, bufferSize.x, bufferSize.y);
const auto CAIRO = cairo_create(CAIROSURFACE);
const auto MONITORSCALE = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID)->scale;

static auto* const PTITLEFONTFAMILY = &g_pConfigManager->getConfigValuePtr("group:groupbar:font_family")->strValue;
static auto* const PTITLEFONTSIZE = &g_pConfigManager->getConfigValuePtr("group:groupbar:font_size")->intValue;
Expand All @@ -199,7 +200,7 @@ CTitleTex::CTitleTex(CWindow* pWindow, const Vector2D& bufferSize) {
pango_layout_set_text(layout, szContent.c_str(), -1);

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 * MONITORSCALE * PANGO_SCALE);
pango_layout_set_font_description(layout, fontDesc);
pango_font_description_free(fontDesc);

Expand Down

0 comments on commit 289d424

Please sign in to comment.