Skip to content
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

Groupbar aesthetic #3197

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open

Conversation

MightyPlaza
Copy link
Contributor

@MightyPlaza MightyPlaza commented Sep 6, 2023

Improves / adds more customization to groupbar:

  • adds group and groupbar sections to free up misc
  • add bottom as bar position
  • separates border and bar colors
  • allows setting groupbar heigh (bar height/gradient height depending on mode)
  • adds internal_bar, font and background color options
  • fixes gradients not updating with config reload

Mostly ready now, just needs some minors fixes

example of new config:

group {
    col.border_active = rgba(bb66ffee)
    #col.border_inactive = 0xffff0000 
    #col.border_locked_active = 0xff00ffff 
    #col.border_locked_inactive = 0xff0000ff 
    #--moveintogroup_lock_check = false-- #removed due to another commit, maybe should be moved here
    #insert_after_current = true
    groupbar {
        enabled = true
        col.active = rgba(cdd6f4cc)
        col.inactive = rgb(666699)
        #col.locked_active = 0xfff00f0f 
        #col.locked_inactive = 0xff0ff00f 
        col.background = rgb(bb66ff)
        #render_titles = false 
        #scrolling = true
        max_size = 200
        titles_font_size = 8
        mode = 0 # 0 - bar, 1 - gradient 
        height = 18
        #internal_bar = false 
        font = JetBrainsMono Nerd Font Mono
        top = no
        text_color = rgb(333333)
        #unified_border = 1
    }
}

@MightyPlaza MightyPlaza marked this pull request as draft September 6, 2023 18:16
@spikespaz
Copy link
Contributor

spikespaz commented Sep 13, 2023

Cool. Haven't looked into this in-depth, but I think a rectangle that can be styled might be the simplest way to go about this?

  • Text font
  • Stroke color/gradient
  • Stroke weight
  • Fill color/gradient
  • Border radius
  • Vertical offset (box/bar)
  • Horizontal offset (box/bar)
  • Vertical offset (text)
  • Horizontal offset (text)
  • Drop shadow (same settings as tiles)

I think that should cover most styles we could conceive of.

@MightyPlaza MightyPlaza marked this pull request as ready for review September 14, 2023 23:42
Copy link
Contributor Author

@MightyPlaza MightyPlaza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also there are some border damage issues, when toggling group on floating windows, for example.
damageWindow() should cover those but doesn't seem to be called at the right time
Edit: looks like storing InternalExtents as a CAnimatedVariable fixes this

fixed, not doing animations yet since that would require more control over decorations
I might just write a decoration manager someday

text boxes calculation seems to also currently be wrong, since pango absolute size isn't being used
and even after doing this, extra descent and ascent doesn't not seem to be taken into account

borders currently get anti-aliased but shadows don't seem to, which makes them look uglier now

rest should be ready

rect.y -= (*PTITLEFONTSIZE + 2 * BAR_TEXT_PAD) * 0.2 * pMonitor->scale;
rect.height = (*PTITLEFONTSIZE + 2 * BAR_TEXT_PAD) * pMonitor->scale;
if (gradBox.width > 0 && gradBox.height > 0) {
if (m_tGradientActive.m_iTexID == 0) // no idea why it doesn't work
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when removing this, somehow the refreshGradients() function gets called, but texture doesn't exist
I haven't yet found what I'm doing wrong

@MightyPlaza
Copy link
Contributor Author

MightyPlaza commented Sep 16, 2023

@vaxerski apart from the 2 issues I still haven't found a fix for this should be ready for review
anti-aliasing rendering is clearly not an issue from here, since it's happens on main when border_size = 0, starting shadows from border just makes it more noticeable

modified:   src/Compositor.cpp
modified:   src/config/ConfigManager.cpp
modified:   src/layout/DwindleLayout.cpp
modified:   src/layout/MasterLayout.cpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/input/InputManager.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

modified:   src/Compositor.cpp
modified:   src/config/ConfigManager.cpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/input/InputManager.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

modified:   src/Compositor.cpp
modified:   src/config/ConfigManager.cpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/input/InputManager.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp
Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/config/ConfigManager.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.hpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/config/ConfigManager.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/Compositor.cpp
modified:   src/config/ConfigManager.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

modified:   src/Compositor.cpp
modified:   src/config/ConfigManager.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp
Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/config/ConfigManager.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.hpp
modified:   src/render/decorations/IHyprWindowDecoration.cpp
modified:   src/render/decorations/IHyprWindowDecoration.hpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/config/ConfigManager.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/config/ConfigManager.cpp
modified:   src/render/Renderer.cpp
modified:   src/render/Texture.hpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.hpp
modified:   src/render/decorations/IHyprWindowDecoration.hpp
Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp
modified:   src/render/decorations/IHyprWindowDecoration.cpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.hpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/config/ConfigManager.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/Window.cpp
modified:   src/Window.hpp
modified:   src/config/ConfigManager.cpp
modified:   src/render/Renderer.cpp
modified:   subprojects/wlroots
Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/Window.cpp
modified:   src/Window.hpp
modified:   src/render/Renderer.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/render/decorations/CHyprDropShadowDecoration.cpp
modified:   src/render/decorations/IHyprWindowDecoration.cpp
modified:   src/render/decorations/IHyprWindowDecoration.hpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/Window.cpp
modified:   src/Window.hpp
modified:   src/layout/DwindleLayout.cpp
modified:   src/layout/MasterLayout.cpp
modified:   src/managers/AnimationManager.cpp
modified:   src/render/decorations/CHyprDropShadowDecoration.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.hpp
modified:   src/render/decorations/IHyprWindowDecoration.cpp
modified:   src/render/decorations/IHyprWindowDecoration.hpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/config/ConfigManager.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.hpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.hpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

Signed-off-by: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com>
@MightyPlaza
Copy link
Contributor Author

internal_bar is really intended for solid bars not gradients, imo doesn't look that bad. (maybe an inside and an outside border would be better)
internal decoration is kinda hacked together, a proper solution would be to handle borders like any other decoration, and control decorations placement better.

like I said, the only remaining problems are rounding issues on boxes which might be more noticeable since I made shadows start at the end of borders, and me still not finding the cause of textures getting deleted which makes them be created on the draw() call.

20231008_00h48m13s_grim

@vaxerski
Copy link
Member

vaxerski commented Oct 8, 2023

internal decoration is kinda hacked together,

another reason to move this, if at all, to a separate mr

@spikespaz
Copy link
Contributor

spikespaz commented Oct 8, 2023

great stuff but the deco inside the border is really hideous. Rest is generally alright. We should rethink the design of groupbars in general tbh

Why don't you follow the box styling ideas I suggested and add features based on that? It's already a familiar concept to most people.

@MightyPlaza
Copy link
Contributor Author

generally this MR is quite sizeable. I'd be for dropping internal decorations altogether, to me they serve no purpose.

I think vaxry is right. I'm gonna separate this into smaller MRs, which, I hope, will be much easier to handle

@aacebedo
Copy link

aacebedo commented Nov 1, 2023

@MightyPlaza do you have the other MR ? (especially for the backgound color).

@MightyPlaza
Copy link
Contributor Author

@MightyPlaza do you have the other MR ? (especially for the backgound color).

I have and will continue to separate this PR into smaller ones
To avoid merge conflicts I am creating 1 at each time
Currently still doing internal reworks, but after that will start adding the visual changes

@aacebedo
Copy link

aacebedo commented Nov 1, 2023

@MightyPlaza do you have the other MR ? (especially for the backgound color).

I have and will continue to separate this PR into smaller ones To avoid merge conflicts I am creating 1 at each time Currently still doing internal reworks, but after that will start adding the visual changes

noted ! Thanks for the update I am going to need this

@aacebedo
Copy link

aacebedo commented Nov 2, 2023

Another question about the font management. Do you know if the PR supports using a font with bold weight?

@MightyPlaza
Copy link
Contributor Author

Another question about the font management. Do you know if the PR supports using a font with bold weight?

pretty sure 9ce1310 allows that
feel free to pr it if you want, should work without extra work

@aacebedo
Copy link

aacebedo commented Nov 2, 2023

Another question about the font management. Do you know if the PR supports using a font with bold weight?

pretty sure 9ce1310 allows that
feel free to pr it if you want, should work without extra work

Actually, I tried a plug-in (https://github1s.com/outfoxxed/hy3) which is doing the same. The author pointed me to hyprland repo for this specific part of but they did not test the bold font support.
I tested some values but was unable to make it work.
I checked the pango spec (tried "Sans Bold" ) so I don't see why it is not working.

@MightyPlaza
Copy link
Contributor Author

seems to work for me
https://docs.gtk.org/Pango/type_func.FontDescription.from_string.html
with
font = JetBrainsMono Nerd Font Mono Italic Extra-Bold

@aacebedo
Copy link

aacebedo commented Nov 3, 2023

JetBrainsMono Nerd Font Mono Italic Extra-Bold

Thanks that's working. I had an issue in the font name I think.

@RichAyotte
Copy link

Can't wait for this to get merged 🤩 I've just hardcoded a few things in the meatime.
2024-01-14_11-52

@StanSvec
Copy link

@MightyPlaza May I ask you for an update or ETA of this work please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants