Add desktop application menu bar - #876
Conversation
Add shared desktop menu actions with native menu presentation on macOS and (Windows and an in-window menu bar on Linux, both not tested) Wire file, edit, navigation, window, and help commands into the existing QML application. Enable wallet-specific commands only when a wallet is available, and add shortcuts, translations, and routing tests.
596bce5 to
099455b
Compare
johnny9
left a comment
There was a problem hiding this comment.
I found three areas to address: static Qt plugin linkage, edit-command focus after navigation, and the Linux menu implementation.
| Q_IMPORT_PLUGIN(QmlSettingsPlugin) | ||
| Q_IMPORT_PLUGIN(QtQuickLayoutsPlugin) | ||
| Q_IMPORT_PLUGIN(QtQuickControls2Plugin) | ||
| Q_IMPORT_PLUGIN(QtLabsPlatformPlugin) |
There was a problem hiding this comment.
bitcoinqml_qmltests is a separate executable, so this import does not make the plugin available there. Both static Depends jobs fail to load MainWindow with module "Qt.labs.platform" plugin "labsplatformplugin" not found. Link Qt6::LabsPlatformplugin to bitcoinqml_qmltests inside the static-Qt block and run the static QML tests.
| || typeof target.redo === "function" | ||
| || typeof target.copy === "function" | ||
| || typeof target.paste === "function")) { | ||
| appWindow.menuEditTarget = target |
There was a problem hiding this comment.
menuEditTarget retains the last editor after focus leaves its page. Edit a Send field, switch to Activity, then press Ctrl+Z: the hidden Send field is modified. Route edit commands to the current focus item. If native menu focus requires caching, clear the cache on page changes and reject hidden targets. Add a Send → Activity → Undo regression test.
| menuBar: DesktopInWindowMenuBar { | ||
| id: desktopInWindowMenuBar | ||
| actions: desktopMenuActions | ||
| active: appWindow.appModeDesktopForUi && Qt.platform.os === "linux" |
There was a problem hiding this comment.
Remove DesktopInWindowMenuBar and use DesktopNativeMenuBar on Linux as well, so supported desktop environments can expose the application menu through com.canonical.AppMenu.Registrar. Linux sessions without a DBus global-menu registrar will have no application menu.
Add an application menu bar to the desktop