]> git.lyx.org Git - features.git/commitdiff
Fix display of bindings for View-other-formats dynamic toolbar menu
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 19 Jul 2022 11:22:18 +0000 (13:22 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 19 Jul 2022 11:30:31 +0000 (13:30 +0200)
Do it the same way as in menus. Also remove the tooltip, which is not used.

Fixes bug #12004.

src/frontends/qt/GuiToolbar.cpp

index bc2613d1a4e8b70632ae3fa23422a08770849287..c646b5050165b4a33bc5836fee1726a3960fd7fb 100644 (file)
@@ -149,10 +149,10 @@ Action * GuiToolbar::addItem(ToolbarItem const & item)
        // first one later
        KeyMap::Bindings bindings = theTopLevelKeymap().findBindings(*item.func);
        if (!bindings.empty())
        // first one later
        KeyMap::Bindings bindings = theTopLevelKeymap().findBindings(*item.func);
        if (!bindings.empty())
-               text += " [" + toqstr(bindings.begin()->print(KeySequence::ForGui)) + "]";
+               text += '\t' + toqstr(bindings.begin()->print(KeySequence::ForGui));
 
        Action * act = new Action(item.func, getIcon(*item.func, false), text,
 
        Action * act = new Action(item.func, getIcon(*item.func, false), text,
-                                                         text, this);
+                                 QString(), this);
        if (item.type == ToolbarItem::BIDICOMMAND)
                act->setRtlIcon(getIcon(*item.func, false, true));
 
        if (item.type == ToolbarItem::BIDICOMMAND)
                act->setRtlIcon(getIcon(*item.func, false, true));