Replies: 1 comment 6 replies
-
The layouting system propagates restrictions outwards, and then dimensions inwards. Maybe you need to use the
I'm not sure what you means exactly, but that's because Text has a implicit size (which is the size of the text). Maybe a sample of code of what you're trying to do would help to understand. |
Beta Was this translation helpful? Give feedback.
-
I am developing a GUI with tabular grid layout and have been struggling to put consistent column element sizes due to fixed text sizes.
As I can see it, pretty much every element tries to take as much space as possible by default, but
Text
. Texts usedefault-font-size
parameter fromWindow
, which makes them fixed-size by default and deviate from the rest.This is one design choice I don't understand in Slint: Why shouldn't
Text
also be restricted just by its container element?Since
Window
cannot be infinite (due to ressource limits), the whole space is already constrained and only needs to be partitioned. The limitation of the layout tree comes from above.Therefore
Text
elements only need to take up the space given to them, right?There can be out-of-tree elements, but these we can detect and enforce fixed geometry.
Same with
Flickable
, which is pseudo-infinite and would blow up everything inside it, but then again we can put restrictions on its inner space based on the outer one.Sorry if I sound frustrated: I've seen some well thought out layout systems in the past and I want to like Slint, since it is based on a modern, type-safe language and targets embedded systems. But the aforementioned design choices seem surprisingly inconsistent.
Beta Was this translation helpful? Give feedback.
All reactions