sonnyp / troll

Libraries for GNOME JavaScript (GJS)
ISC License
45 stars 7 forks source link

gsx: GtkLabel text children #4

Open sonnyp opened 2 years ago

sonnyp commented 2 years ago

I don't want to deviate from Gtk for now and I'm not sure it's worth it, but here is an idea

<Label>hello</Label> instead of <Label label="hello"/> specially for use cases like

<label>
  My super title
  {'\n'}
  Hehe
</label>

with something like widget.label = children.map((child) => child.trim()).join("");

See https://reactnative.dev/docs/text

sonnyp commented 1 year ago

Or even <Box>label</Box>