-
-
Notifications
You must be signed in to change notification settings - Fork 913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added rounded corners to group bar #6839
base: main
Are you sure you want to change the base?
Conversation
@@ -126,9 +127,9 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a) { | |||
for (int i = 0; i < barsToDraw; ++i) { | |||
const auto WINDOWINDEX = *PSTACKED ? m_dwGroupMembers.size() - i - 1 : i; | |||
|
|||
CBox rect = {ASSIGNEDBOX.x + floor(xoff) - pMonitor->vecPosition.x + m_pWindow->m_vFloatingOffset.x, | |||
CBox rect = {ASSIGNEDBOX.x + floor(xoff) - pMonitor->vecPosition.x + m_pWindow->m_vFloatingOffset.x + *PROUNDING, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rect
is responsible for the thin bottom bar, I offset its x and width values to reflect the rounding so that it's consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not ready to merge, but kind of close, just need to figure out some conflicts and inconsistencies with the thin bottom bar.
@@ -151,19 +152,20 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a) { | |||
CColor color = m_dwGroupMembers[WINDOWINDEX].lock() == g_pCompositor->m_pLastWindow.lock() ? PCOLACTIVE->m_vColors[0] : PCOLINACTIVE->m_vColors[0]; | |||
color.a *= a; | |||
|
|||
if (*PBOTTOMBAR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the thin bottom bar looks bad with rounding, I added an option to disable the thin bottom bar, rounding the thin bar is tricky because the height is very small and sometimes opengl throws an error for rendering a negative height.
A problem that arises because of this is that the gap between the main group bar and the window is kinda awkward without the thin bar, I want the extra space to be taken up by the application open and am open to suggestions on how to implement this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like I said before rounding has to be less or equal to max(width/2, height/2)
to remove the space from the indicator set BAR_INDICATOR_HEIGHT
to zero wherever it appears)
specially in const auto ONEBARHEIGHT = BAR_PADDING_OUTER_VERT + BAR_INDICATOR_HEIGHT + (*PGRADIENTS || *PRENDERTITLES ? *PHEIGHT : 0);
I am not sure there is a point to the thin bar anymore maybe it can be removed altogether, but ask vaxry
rect = {ASSIGNEDBOX.x + floor(xoff) - pMonitor->vecPosition.x + m_pWindow->m_vFloatingOffset.x, | ||
ASSIGNEDBOX.y + ASSIGNEDBOX.h - floor(yoff) - ONEBARHEIGHT - pMonitor->vecPosition.y + m_pWindow->m_vFloatingOffset.y, m_fBarWidth, | ||
(*PGRADIENTS || *PRENDERTITLES ? *PHEIGHT : 0)}; | ||
|
||
g_pHyprOpenGL->renderRect(&rect, color, *PGROUPROUNDING); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found out its cleaner to leave this where it originally was, the first renderRect
is to render the thin bar, the rect is then recalculated as the main bar and gets rendered under the if (*PGRADIENTS)
conditional, its better to keep them separated.
1184395
to
b16fb97
Compare
Describe your PR, what does it fix/add?
group_rounding
undergroup:groupbar
in configgroup_rounding
lets the user configure a rounding value for the groupbar making the theme between windows and groups more consistent.fixes part of #2415
Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
This code now recalculates rect before rendering it instead of rendering it and then recalculating dimensions, this shouldn't be an issue unless there is some performance penalty or marginal use case that didn't come up in my testing.
Is it ready for merging, or does it need work?
Ready for merging.