helloSystem / Menu

Global menu bar written in Qt
43 stars 14 forks source link

Menu search results can be triggered inadvertently #120

Closed probonopd closed 1 year ago

probonopd commented 1 year ago

Since https://github.com/helloSystem/Menu/commit/b80528b57a50f769439ad7d7fde4a6f21af68e63, Menu search results can be triggered inadvertently

To reproduce:

Why? cc @jsm222

jsm222 commented 1 year ago

Yes I expirienced that too. Perhaps the typingtimer triggers or something is wrong with the Systemmenu subclass of QMenu you wrote..

probonopd commented 1 year ago

Turns out that these are "mnemonics", letters that are underlined in menu items in many Qt themes, represented by "&" in code. E.g., "&About Filer" would cause the "F" to be underlined in many Qt themes. Even though our theme doesn't show these, they were still active.

Where can we disable/Filter out "mnemonics"? In appmenumodel.cpp...

void HMenu::actionEvent(QActionEvent *e) {

    if(e->type() == QEvent::ActionAdded) {
        e->action()->setText(e->action()->text().replace("&","")); // probono: Remove mnemonics (underlined characters in menus represented by "&" in code)