helloSystem / Menu

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

Also search in tooltips of menu items (actions) #100

Open probonopd opened 2 years ago

probonopd commented 2 years ago

Maybe we should also search in tooltips of menu items (actions), not just in their text (label) as we are doing now. Not super urgent as most menus (apart from the applications in the System menu) don't even have tooltips, but might be handy at some point.

In ../src/appmenu/appmenumodel.cpp, possibly also search tooltip.

Change

if(searchString != "" && action->text().contains(searchString,Qt::CaseInsensitive))

to

if(searchString != "" && (action->text().contains(searchString,Qt::CaseInsensitive) || action->toolTip().contains(searchString,Qt::CaseInsensitive)))

Need to do this in 2 places.

This does not quite work yet. Why? Due to filterMenu(action->menu(),searchString,searchString=="",names);? When one comments that out then not all menu entries are found anymore...

More investigation needed.