Open elkowar opened 2 years ago
Ill do this at some point if no one else wants to
Implementing this is probably slightly more complex than most other widgets, as it requires the parent widget to be known before rendering it. I also don't quite know how the config would look - just have an "active" attribute or sth?
maybe?
<!-- on-click is dumb, need to think a better way to do that -->
<widget on-click="popover(popup-inner)">...idk widget stuff..</widget>
<popup-inner>
idk whatever you want
</popup-inner>
so when the hover / click event is triggered itll create a popover widget and stuff the contents of window-name in there? idk yuck syntax perfectly just yet
Or the other way my monkey brain thinks of is some way to attach a window of popover type, but unless eww gets an id system you wouldnt be able to attach to certain widgets instead of the whole thing
Or the other way my monkey brain thinks of is some way to attach a window of popover type, but unless eww gets an id system you wouldnt be able to attach to certain widgets instead of the whole thing
Maybe give it some :attach-anchor :x Int :y Int
?
Sorry for mixing syntax and possibly butchering yuck syntax
Is there any reason not to just go with
(defvar isopen "false")
(defwidget foo []
(box
(button :onclick "eww update isopen=${!isopen}"
"Click me")
(popover :open isopen :direction "right"
"popover content")))
Well you cant reuse the popover contents but that would be super unique anyway so yeah thats probably correct
what do you mean "can't reuse the popover content"?
Its nothing, just me being dumb
this would be the perfect Christmas present 👀
Description of the widget
The gtk popover widget can be used to open a small window at a position relative to the main widget. This may have many uses for small dialog popups, etc.
Implementation proposal
https://gtk-rs.org/gtk3-rs/stable/latest/docs/gtk/struct.Popover.html