From cc2662012166a7fd18a0a7fc514ef02f987ab002 Mon Sep 17 00:00:00 2001 From: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com> Date: Wed, 6 Sep 2023 17:32:33 +0100 Subject: [PATCH] add internal rounding modified: src/render/decorations/CHyprGroupBarDecoration.cpp Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com> --- .../decorations/CHyprGroupBarDecoration.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index 8326cfaa..9d6e76ec 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -24,10 +24,11 @@ eDecorationType CHyprGroupBarDecoration::getDecorationType() { return DECORATION_GROUPBAR; } -constexpr int BAR_INDICATOR_HEIGHT = 3; -constexpr int BAR_INTERNAL_PADDING = 3; -constexpr int BAR_EXTERNAL_PADDING = 3; -constexpr int BAR_TEXT_PAD = 3; +constexpr int BAR_INDICATOR_HEIGHT = 3; +constexpr int BAR_INTERNAL_PADDING = 3; +constexpr int BAR_EXTERNAL_PADDING = 3; +constexpr int BAR_HORIZONTAL_PADDING = 5; +constexpr int BAR_TEXT_PAD = 3; // @@ -93,8 +94,7 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& const int ROUNDING = !m_pWindow->m_sSpecialRenderData.rounding ? 0 : m_pWindow->rounding(); const int BORDERSIZE = m_pWindow->getRealBorderSize(); - const int PAD = 2; //2px - const int BARW = (m_vLastWindowSize.x - 2 * ROUNDING - PAD * (barsToDraw - 1)) / barsToDraw; + const int BARW = (m_vLastWindowSize.x - 2 * ROUNDING - BAR_HORIZONTAL_PADDING * (barsToDraw - 1)) / barsToDraw; // TODO: check for invalid config if (BARW <= 0) @@ -166,7 +166,7 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& CColor color = m_dwGroupMembers[i] == g_pCompositor->m_pLastWindow ? ((CGradientValueData*)PCOLACTIVE->get())->m_vColors[0] : ((CGradientValueData*)PCOLINACTIVE->get())->m_vColors[0]; color.a *= a; - g_pHyprOpenGL->renderRect(&barBox, color); + g_pHyprOpenGL->renderRect(&barBox, color, std::sqrt(m_iBarHeight) / 2); // render title if necessary if (*PRENDERTITLES) { @@ -185,9 +185,9 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& &gradBox, 1.0); } - barBox.x += (PAD + BARW) * pMonitor->scale; - gradBox.x += (PAD + BARW) * pMonitor->scale; - textBox.x += (PAD + BARW) * pMonitor->scale; + barBox.x += (BAR_HORIZONTAL_PADDING + BARW) * pMonitor->scale; + gradBox.x += (BAR_HORIZONTAL_PADDING + BARW) * pMonitor->scale; + textBox.x += (BAR_HORIZONTAL_PADDING + BARW) * pMonitor->scale; } if (*PRENDERTITLES)