]> git.lyx.org Git - features.git/commitdiff
Hide multi-keystroke accelerators in Mac menu (bug 12693).
authorPavel Sanda <sanda@lyx.org>
Wed, 5 Jul 2023 18:45:26 +0000 (20:45 +0200)
committerPavel Sanda <sanda@lyx.org>
Wed, 5 Jul 2023 18:45:26 +0000 (20:45 +0200)
Patch from Juergen.

src/frontends/qt/Menus.cpp

index 71d8d51f04697cfd5212dde36acf0b3d49c6998d..8f62bd49bb6e75dc05c97cff816f2c35ef8bfb86 100644 (file)
@@ -2111,8 +2111,16 @@ static QString label(MenuItem const & mi)
        }
 
        QString const binding = mi.binding();
+#if defined(Q_OS_MAC)
+       // MacOS cannot display complex bindings, so hide those
+       // https://doc.qt.io/qt-6/macos-issues.html#menu-actions
+       // #12693
+       if (!binding.isEmpty() && !binding.contains(" "))
+               label += '\t' + binding;
+#else
        if (!binding.isEmpty())
                label += '\t' + binding;
+#endif
 
        return label;
 }