diff --git a/krusader/BookMan/krbookmarkhandler.cpp b/krusader/BookMan/krbookmarkhandler.cpp --- a/krusader/BookMan/krbookmarkhandler.cpp +++ b/krusader/BookMan/krbookmarkhandler.cpp @@ -577,7 +577,8 @@ // match prefix of the action text to the query if (act->text().left(_quickSearchText().length()).compare(_quickSearchText(), Qt::CaseInsensitive) == 0) { _highlightAction(act); - if (!firstMatch) { + if (!firstMatch || firstMatch->menu()) { + //Can't highlight menus (see comment below), hopefully pick something we can firstMatch = act; } nMatches++; @@ -600,10 +601,18 @@ } else { firstMatch->activate(QAction::Trigger); } + return true; + } else if (nMatches > 1) { + //because of a bug submenus cannot be highlighted + //https://bugreports.qt.io/browse/QTBUG-939 + if (!firstMatch->menu()) { + menu->setActiveAction(firstMatch); + } else { + menu->setActiveAction(nullptr); + } + return true; } else { - // if no match is found, firstMatch == nullptr - // this is intended as it will unset active item of the menu - menu->setActiveAction(firstMatch); + menu->setActiveAction(nullptr); } }