feat(menu): Adds Menu widget with popup functionality#521
feat(menu): Adds Menu widget with popup functionality#521SavedByGrace251 wants to merge 2 commits intoamnweb:mainfrom
Conversation
Introduces a new Menu widget that allows users to display a customizable menu with items in a popup window. The menu can be configured with a label, icon, menu items, and various styling options such as blur, alignment, and animations. It enables users to launch applications or execute commands directly from the bar.
Addresses potential errors by checking for None values before applying shadows and styles to the menu widget. This prevents crashes when shadow configurations or styles are not defined. Also, clarifies type hints for menu items and shadow attributes to improve code readability.
|
Thanks for contributing! Since we already have a very similar widget Applications, I don’t think we need another one. But since your idea sounds good to me, maybe instead of creating a new widget, it would be better to extend the existing one with popup window support? There’s already a defined app list, so we can reuse it for the popup if it’s enabled. However, this is a very old widget, and some parts need to be updated, especially the section where we run apps and also I think we can remove yasb/src/core/utils/widgets/taskbar/pin_manager.py Lines 641 to 683 in 65f1fd8 |
|
Oh I didn't even think about extending the applications widget. I'll take a look at extending it and report back! |
Just make sure you don’t break the current users’ configurations if you decide to work on this widget, many themes still use it. |
|
Totally, my thought is a new optional param |
|
Hey @SavedByGrace251 I've been stealing your code! I needed a popup menu to extend an existing widget, but python has never been my thing - I'm learning now but I've been a .NET developer for over 25 years and I know nothing about python... Wondering if you wouldn't mind giving me a pointer (pun intended - you see why soon!). I've taken a bunch of your code and retrofitted it into a different widget but I've hit the current limit of my understanding and don't know how to move things forward. It shouldn't take too much time - I'm just confused as to the mouse pointer events and why the popup control and original widget seem to be getting confused on the mouse click. Would you mind giving me a quick hand, please? If you're ok with that then I'll add you as a contributor to my fork. Thanks mate.... And hope you have a good Lent. 😉 Cheers. [EDIT - 2023-03-04: I got it sorted, thank you!] |
Introduces a new Menu widget that allows users to display a customizable menu with items in a popup window.
The menu can be configured with a label, icon, menu items, and various styling options such as blur, alignment, and animations.
It enables users to launch applications or execute commands directly from the bar.