diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-05-22 20:52:41 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-05-22 20:52:41 +0200 |
| commit | 1eb6cfd45c6e2e42fc1285628974acef40f03b42 (patch) | |
| tree | 9b77dc5c9e5434880b8cd33f934d6005fe77b63f /src/render | |
| parent | 088b4a68e6288e7bbeb7fb9a31798d47e4d13a78 (diff) | |
groupbar: make exclusive
Diffstat (limited to 'src/render')
| -rw-r--r-- | src/render/decorations/CHyprGroupBarDecoration.cpp | 14 | ||||
| -rw-r--r-- | src/render/decorations/CHyprGroupBarDecoration.hpp | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index ca9d1b72..c3663970 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -15,6 +15,11 @@ eDecorationType CHyprGroupBarDecoration::getDecorationType() { return DECORATION_GROUPBAR; } +constexpr int BAR_INDICATOR_HEIGHT = 3; +constexpr int BAR_PADDING_OUTER_VERT = 2; + +// + void CHyprGroupBarDecoration::updateWindow(CWindow* pWindow) { damageEntire(); @@ -26,7 +31,7 @@ void CHyprGroupBarDecoration::updateWindow(CWindow* pWindow) { // we draw 3px above the window's border with 3px const auto PBORDERSIZE = &g_pConfigManager->getConfigValuePtr("general:border_size")->intValue; - m_seExtents.topLeft = Vector2D(0, *PBORDERSIZE + 3 + 3); + m_seExtents.topLeft = Vector2D(0, *PBORDERSIZE + BAR_PADDING_OUTER_VERT * 2 + BAR_INDICATOR_HEIGHT); m_seExtents.bottomRight = Vector2D(); m_vLastWindowPos = pWindow->m_vRealPosition.vec() + WORKSPACEOFFSET; @@ -84,7 +89,8 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& int xoff = 0; for (int i = 0; i < barsToDraw; ++i) { - wlr_box rect = {m_vLastWindowPos.x + xoff - pMonitor->vecPosition.x + offset.x, m_vLastWindowPos.y - m_seExtents.topLeft.y - pMonitor->vecPosition.y + offset.y, BARW, 3}; + wlr_box rect = {m_vLastWindowPos.x + xoff - pMonitor->vecPosition.x + offset.x, + m_vLastWindowPos.y - m_seExtents.topLeft.y + BAR_PADDING_OUTER_VERT - pMonitor->vecPosition.y + offset.y, BARW, BAR_INDICATOR_HEIGHT}; if (rect.width <= 0 || rect.height <= 0) break; @@ -101,4 +107,8 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& xoff += PAD + BARW; } +} + +SWindowDecorationExtents CHyprGroupBarDecoration::getWindowDecorationReservedArea() { + return SWindowDecorationExtents{{0, BAR_INDICATOR_HEIGHT + BAR_PADDING_OUTER_VERT * 2}, {}}; }
\ No newline at end of file diff --git a/src/render/decorations/CHyprGroupBarDecoration.hpp b/src/render/decorations/CHyprGroupBarDecoration.hpp index eebfe99d..712c0440 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.hpp +++ b/src/render/decorations/CHyprGroupBarDecoration.hpp @@ -18,6 +18,8 @@ class CHyprGroupBarDecoration : public IHyprWindowDecoration { virtual void damageEntire(); + virtual SWindowDecorationExtents getWindowDecorationReservedArea(); + private: SWindowDecorationExtents m_seExtents; |
