-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New libyui Widget: YMenuBar #1
Comments
The
Most likely, |
The use case is the one reported by @Conan-Kudo above, anyway when I started developing this I asked people and of course manatools developers which kind of features they expected from a menu widget. Hiding was one of them.
NCurses should be easy too. IIRC i managed it just not drawing it (Item is hidden). Another thing i removed is rebuildMenuTree, is that really needed? that is not so understandable, all the widget are built step by step menubuttons are added and rebuilt here and there, moreover rebuild is needed also when we are building the layout not just because we are removing and adding the (new) menu again. I also experienced some problems when used inside a block with startMultipleChanges and doneMultipleChanges. I like the addMenu() and addSeparator() methods you added, maybe i can try to add them too to simplify the move after. |
Hi guys! @Conan-Kudo, @anaselli we have extended the YMenuBar API to allow showing/hiding menu items. It works for top level menus and also for menu items (similar to disabling items). Here https://github.com/libyui/libyui/pull/172 you can see an usage example. If I am not wrong, now YMenuBar provides all the features you need. Do you miss anything? Can YMenuBar be used as a replacement of YMGAMenuBar? |
Menu item icons are in too? And yes, once i wrote the gtk implementation i'll do some tests and let'see. But I need to take my time here sorry... |
Yes, YMenuItem allows to indicate an icon.
Sure, no problem. I only wanted to be sure that YMenuBar is proving everything that is expected. Thanks! |
We added a MenuBar widget to libyui. More details here:
https://github.com/libyui/libyui/pull/169
C++ example:
https://github.com/libyui/libyui/blob/master/examples/MenuBar1.cc
We extracted a common base class YMenuWidget from YMenuButton for some tasks that are needed in both the YMenuButton and the new YMenuBar:
https://github.com/libyui/libyui/blob/master/src/YMenuWidget.h
https://github.com/libyui/libyui/blob/master/src/YMenuWidget.cc
This includes resolving keyboard shortcut conflicts on each menu level. In the near future, it will also include resolving keyboard shortcut conflicts between the toplevel menus and other widgets in that same dialog (because a menu bar typically has more than one shortcut).
AFAICS this new widget should support all features that your MGAMenuBar has, with one notable exception: Hiding menu entries.
Can you explain how this is expected to be used? A use case?
This should be easy to add for the Qt UI; I am not so sure about NCurses, though.
Once that is done, we might want to unify both widgets. Or if you prefer that, you can of course continue to use your MGAMenuBar.
The text was updated successfully, but these errors were encountered: