mirror of
https://github.com/hyprwm/hyprland-plugins.git
synced 2024-11-22 10:35:58 +01:00
hyprbars: cosmetic improvements
This commit is contained in:
parent
69287a4dec
commit
9b1adb6043
1 changed files with 6 additions and 4 deletions
|
@ -348,7 +348,7 @@ void CHyprBar::draw(CMonitor* pMonitor, float a, const Vector2D& offset) {
|
||||||
const auto BORDERSIZE = m_pWindow->getRealBorderSize();
|
const auto BORDERSIZE = m_pWindow->getRealBorderSize();
|
||||||
const auto ROUNDING = m_pWindow->rounding() + m_pWindow->getRealBorderSize();
|
const auto ROUNDING = m_pWindow->rounding() + m_pWindow->getRealBorderSize();
|
||||||
|
|
||||||
const auto scaledRounding = ROUNDING * pMonitor->scale;
|
const auto scaledRounding = ROUNDING > 0 ? ROUNDING * pMonitor->scale - 2 /* idk why but otherwise it looks bad due to the gaps */ : 0;
|
||||||
const auto scaledBorderSize = BORDERSIZE * pMonitor->scale;
|
const auto scaledBorderSize = BORDERSIZE * pMonitor->scale;
|
||||||
|
|
||||||
CColor color = *PCOLOR;
|
CColor color = *PCOLOR;
|
||||||
|
@ -378,10 +378,12 @@ void CHyprBar::draw(CMonitor* pMonitor, float a, const Vector2D& offset) {
|
||||||
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||||
|
|
||||||
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
||||||
wlr_box windowBox = {(int)m_vLastWindowPos.x + offset.x - pMonitor->vecPosition.x, (int)m_vLastWindowPos.y + offset.y - pMonitor->vecPosition.y, (int)m_vLastWindowSize.x,
|
// the +1 is a shit garbage temp fix until renderRect supports an alpha matte
|
||||||
(int)m_vLastWindowSize.y};
|
wlr_box windowBox = {(int)m_vLastWindowPos.x + offset.x - pMonitor->vecPosition.x - BORDERSIZE + 1,
|
||||||
|
(int)m_vLastWindowPos.y + offset.y - pMonitor->vecPosition.y - BORDERSIZE + 1, (int)m_vLastWindowSize.x + 2 * BORDERSIZE - 2,
|
||||||
|
(int)m_vLastWindowSize.y + 2 * BORDERSIZE - 2};
|
||||||
scaleBox(&windowBox, pMonitor->scale);
|
scaleBox(&windowBox, pMonitor->scale);
|
||||||
g_pHyprOpenGL->renderRect(&windowBox, CColor(0, 0, 0, 0), scaledRounding + scaledBorderSize);
|
g_pHyprOpenGL->renderRect(&windowBox, CColor(0, 0, 0, 0), scaledRounding);
|
||||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||||
|
|
||||||
glStencilFunc(GL_NOTEQUAL, 1, -1);
|
glStencilFunc(GL_NOTEQUAL, 1, -1);
|
||||||
|
|
Loading…
Reference in a new issue