slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.7k stars 613 forks source link

`GroupBox` has unevenly distributed padding and misses a `padding` property #5995

Open Enyium opened 3 months ago

Enyium commented 3 months ago

I'm using the Fluent theme, because I'm on Windows.

This SlintPad example shows GroupBox's padding: none at the sides, some at the bottom and excessively much at the top.

This is a problem in my app, because it leads to ugly gaps at inappropriate places that I can't prevent. This is somewhat related to #5777, but there's more to it than that. The padding situation with GroupBox and how it's supposed to be tamed currently just seems chaotic.

Perhaps, GroupBox should have just a padding-top property that's for the gap above the title, and an inner-padding property that's for encompassing its @children below the title.

EDIT: Also, is there supposed to be a horizontal indent on the left between the title and the @children? When I use a ...Box inside, the ...Box's padding makes for an indent in the GroupBox, and I tend to find that suitable. If this should be avoided according to your design specifications, this would need to be documented.

FloVanGH commented 2 months ago

Hi thank you for your report. I see you're problem and you're right, this make it difficult to use the GroupBox in some cases. So I see here the following action points: