feat(wlr/taskbar): add justify option to control horizontal alignment of the module box
#4532
+15
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem Description
It is impossible to specify horizontal alignment in the
wlr/taskbarmodule if usingmin-width:CSS property in#taskbar button.Solution
While Waybar already has a
justifyoption forGtk::Label(introduced in #2887), there is no such option for theGtk::Boxused by thewlr/taskbarmodule. This PR adds support forjustifyinwlr/taskbar.To keep configuration syntax consistent with other modules, the new option is named
justifyand accepts one of:"left","center", or"right". It controls the horizontal alignment of the module’sGtk::Boxwithin its parent."left").Configuration
Implementation Notes
justifyfrom the module config.Gtk::Align::START,Gtk::Align::CENTER, orGtk::Align::END.box->set_halign(...)(theGtk::Boxthat wraps the taskbar content).Screenshots
Before: left-aligned by default.

After: with



"justify": "center"or"justify": "right"(visuals depend on theme and spacing).Docs
justifykey to thewlr/taskbarmodule documentation with accepted values and defaults.Testing
justifykey present."left","center", and"right"produce the expected horizontal alignment.Motivation and Context
This brings the taskbar’s layout controls in line with other modules, reducing the need for CSS workarounds when users want simple left/center/right alignment of the entire taskbar box.