Open DavidLyhedDanielsson opened 2 years ago
The current codebase doesn't really allow for that at the moment, the overlay widget is not a GtkContainer
(can contain any number of children), but a GtkBin
(only one children) that has a special method to add overlayed widgets. The way this is implemented in eww means that the overlay widget needs to know its children while building.
But eww handles special widgets differently: The parent is built first and then given children through GtkContainer.add
.
My guess is that we would need either a workaround for overlay widget (pretty easy but kinda ugly, I could implement that), or a refractor to allow widget to have custom children logic (cleaner, but would only be used by 1 or 2 widget, i.e overlay and centerbox, not worth it imo).
Otherwise maybe a different syntax for overlay altogether could be an option, I remember @elkowar not being satisfied with the current api.
Thanks for the very detailed response! I had a look at the code but I am not familiar enough with GTK to fix it myself. I think I also spotted the workaround you're mentioning, but didn't want to put time and effort into a PR before hearing more.
At least I can reduce some code duplication with a parameterizeddefwidget
:
(defwidget coreusage []
(box
:width 140
(overlay
(core :entry 0)
(core :entry 1)
...
)
)
)
Description of the requested feature
I'd like this defwidget to work:
But it gives me this error:
If I manually write out the circular-progress widgets it works fine
Proposed configuration syntax
No response
Additional context
No response