[GH-ISSUE #985] Feature Request: To set horizontal alignment of boxes inside their parent container #4524

Closed
opened 2026-05-23 00:54:03 +01:00 by JakeStanger · 0 comments
Owner

Originally created by @BBFifield on GitHub (May 17, 2025).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/985

Is your feature request related to a problem? Please describe.

Currently, child widgets are packed to the left inside their parent boxes without any option present to alter this behaviour. This creates a potential headache for users who want to define a Popup with many vertically aligned boxes containing potentially multiple widgets centered horizontally.

So for example:

Image

This shows a popup containing several different nested widgets with the following structure:

button
[box[button, slider]]
[box[button]]
[box[button, button, button]]

Ideally, the button in the third row could be center aligned, which could be achieved with css margins assuming the popup width is static, but the slider in row two is only shown after the button before it is clicked, changing the popup width with it.

Describe the solution you'd like

Basically, I want the ability to set the halign property of a GtkBox to GTK_ALIGN_CENTER via some box module option. While this wouldn't actually center align the widgets inside the box, it would give users a working solution to the problem above with minimal changes to the codebase.

Describe alternatives you've considered

Tried finding some combination of CSS properties and nested buttons and boxes to accomplish the look I was going for but it doesn't seem possible currently.

Originally created by @BBFifield on GitHub (May 17, 2025). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/985 **Is your feature request related to a problem? Please describe.** Currently, child widgets are packed to the left inside their parent boxes without any option present to alter this behaviour. This creates a potential headache for users who want to define a Popup with many vertically aligned boxes containing potentially multiple widgets centered horizontally. So for example: ![Image](https://github.com/user-attachments/assets/9db458fa-721f-4f3c-8025-515a3f7c76ec) This shows a popup containing several different nested widgets with the following structure: button [box[button, slider]] [box[button]] [box[button, button, button]] Ideally, the button in the third row could be center aligned, which could be achieved with css margins assuming the popup width is static, but the slider in row two is only shown after the button before it is clicked, changing the popup width with it. **Describe the solution you'd like** Basically, I want the ability to set the halign property of a GtkBox to GTK_ALIGN_CENTER via some box module option. While this wouldn't actually center align the widgets inside the box, it would give users a working solution to the problem above with minimal changes to the codebase. **Describe alternatives you've considered** Tried finding some combination of CSS properties and nested buttons and boxes to accomplish the look I was going for but it doesn't seem possible currently.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#4524
No description provided.