[LyX/master] Hide multi-keystroke accelerators in Mac menu (bug 12693).

Pavel Sanda sanda at lyx.org
Wed Jul 5 17:34:31 UTC 2023


commit fb43449c80d8fdd31eb79a70aec8f70083d48b2e
Author: Pavel Sanda <sanda at lyx.org>
Date:   Wed Jul 5 20:45:26 2023 +0200

    Hide multi-keystroke accelerators in Mac menu (bug 12693).
    
    Patch from Juergen.
---
 src/frontends/qt/Menus.cpp |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/frontends/qt/Menus.cpp b/src/frontends/qt/Menus.cpp
index 71d8d51..8f62bd4 100644
--- a/src/frontends/qt/Menus.cpp
+++ b/src/frontends/qt/Menus.cpp
@@ -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;
 }


More information about the lyx-cvs mailing list