aoloe / cpp-libui-qtlike

MIT License
15 stars 0 forks source link

libui: invert the link between the quit action and the related menu entry #2

Closed aoloe closed 7 years ago

aoloe commented 7 years ago

if i define

menuItem = uiMenuAppendQuitItem(menu);

i get a menu item that will automatically call uiOnShouldQuit() which should then be defined.

i would preferable to create the quit menu as a normal menu entry and further marking it something special.

aoloe commented 7 years ago

from the qt documentation:

http://doc.qt.io/qt-5/osx-issues.html

Each QAction has a menuRole property which controls the special placement of application menu items; however by default the menuRole is TextHeuristicRole which mean the menu items will be auto-detected by their text.

I would not go for an heuristic.

aoloe commented 7 years ago

I could solve this by using MenuActions (as in Qt): 9bbaae2b41b