ironbar
ironbar copied to clipboard
feat: Add Menu module
This PR adds a new Menu widget which allows users to create XDG or custom menus that open after clicking on a button.
Resolves #534
Thanks for your hard work on this, and for spending the time to go through and review already. I'll try and go through your comments in the next few days, and then my own full review off the back of that.
Progress may be a little slower than usual on this from my end as I'm fairly busy at the moment, just FYI.
Thanks for the heads up, Jake.
One thing I forget to mention earlier: whenever I cause a reflow (by hiding or showing a submenu) all the UI elements jump a little bit. I wasn't able to figure out why that is.
That may be due to this: https://github.com/JakeStanger/ironbar/blob/b5755ef9d495bdf623965562725a7c0b1d27ea04/src/popup.rs#L135
The popup will listen to changes in its size, and re-position itself to ensure it remains anchored to the widget it opened from. If appropriate, you could potentially avoid that by using the OpenPopupAt event instead of the OpenPopup one, and passing the buttons current static geometry.
Oh cool, I spent a long time searching GTK issues and docs, didn't consider it could be something in Ironbar. I'll try to make that change and see if it fixes the issue.
That may be due to this:
https://github.com/JakeStanger/ironbar/blob/b5755ef9d495bdf623965562725a7c0b1d27ea04/src/popup.rs#L135
The popup will listen to changes in its size, and re-position itself to ensure it remains anchored to the widget it opened from. If appropriate, you could potentially avoid that by using the
OpenPopupAtevent instead of the OpenPopup one, and passing the buttons current static geometry.
It doesn't seem like OpenPopupAt avoids this codepath but I tried just deleting that bit of code and it didn't fix the problem.
Okay that's annoying. I'll try and test myself when I can, and see if I can spot what's going on.
Looking to get this merged in the next couple of days. I've tidied the code a bit and brought it up to date with the changes from the last year but in general it was pretty much there already. Most of the work came from rewriting the desktop file and image code for performance improvements.
I appreciate it's been a full year now, but thanks for your work on this last year. This is a fairly big feature and a lot of effort clearly went into it.
One thing I forget to mention earlier: whenever I cause a reflow (by hiding or showing a submenu) all the UI elements jump a little bit. I wasn't able to figure out why that is.
This actually seems to be something weird with Hyprland. I wasn't able to find out why, nor replicate it on other compositors so I'm shipping as-is. If anybody finds a fix I'm all ears.