diff options
author | MightyPlaza <[email protected]> | 2024-05-09 20:47:59 +0000 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-05-09 22:02:19 +0100 |
commit | eeebbc0e7ee842a9572fa533cb8d01a8114f9ec9 (patch) | |
tree | 315f273f6f6719e6f603c0b7c1a0a01711ce0ce0 | |
parent | 635a02d83fe9d598cf5f6aba47e672647608fb76 (diff) | |
download | Hyprland-eeebbc0e7ee842a9572fa533cb8d01a8114f9ec9.tar.gz Hyprland-eeebbc0e7ee842a9572fa533cb8d01a8114f9ec9.zip |
groupbar: fix title scaling (#5969)
modified: src/render/decorations/CHyprGroupBarDecoration.cpp
modified: src/render/decorations/CHyprGroupBarDecoration.hpp
-rw-r--r-- | src/render/decorations/CHyprGroupBarDecoration.cpp | 8 | ||||
-rw-r--r-- | src/render/decorations/CHyprGroupBarDecoration.hpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index 1ea0aac2..451701b4 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -154,8 +154,8 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a) { if (!pTitleTex) pTitleTex = m_sTitleTexs.titleTexs - .emplace_back(std::make_unique<CTitleTex>(m_dwGroupMembers[i].lock(), - Vector2D{m_fBarWidth * pMonitor->scale, (*PTITLEFONTSIZE + 2 * BAR_TEXT_PAD) * pMonitor->scale})) + .emplace_back(std::make_unique<CTitleTex>( + m_dwGroupMembers[i].lock(), Vector2D{m_fBarWidth * pMonitor->scale, (*PTITLEFONTSIZE + 2 * BAR_TEXT_PAD) * pMonitor->scale}, pMonitor->scale)) .get(); rect.y += (ASSIGNEDBOX.h / 2.0 - (*PTITLEFONTSIZE + 2 * BAR_TEXT_PAD) / 2.0) * pMonitor->scale; @@ -184,7 +184,7 @@ void CHyprGroupBarDecoration::invalidateTextures() { m_sTitleTexs.titleTexs.clear(); } -CTitleTex::CTitleTex(PHLWINDOW pWindow, const Vector2D& bufferSize) { +CTitleTex::CTitleTex(PHLWINDOW pWindow, const Vector2D& bufferSize, const float monitorScale) { szContent = pWindow->m_szTitle; pWindowOwner = pWindow; const auto CAIROSURFACE = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, bufferSize.x, bufferSize.y); @@ -207,7 +207,7 @@ CTitleTex::CTitleTex(PHLWINDOW 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 * PANGO_SCALE * monitorScale); pango_layout_set_font_description(layout, fontDesc); pango_font_description_free(fontDesc); diff --git a/src/render/decorations/CHyprGroupBarDecoration.hpp b/src/render/decorations/CHyprGroupBarDecoration.hpp index 45881add..3fe653cc 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.hpp +++ b/src/render/decorations/CHyprGroupBarDecoration.hpp @@ -9,7 +9,7 @@ class CTitleTex { public: - CTitleTex(PHLWINDOW pWindow, const Vector2D& bufferSize); + CTitleTex(PHLWINDOW pWindow, const Vector2D& bufferSize, const float monitorScale); ~CTitleTex(); CTexture tex; |