forked from qt-creator/qt-creator
Core/Tr: Fix menu bar action
It is "menu bar", and use placeholder for shortcut instead of concatenation. Change-Id: I60094a5fac3893663180f7ef573b6dece7670111 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
2
dist/changelog/changes-12.0.0.md
vendored
2
dist/changelog/changes-12.0.0.md
vendored
@@ -67,7 +67,7 @@ General
|
||||
used for the file system index locator filter
|
||||
([QTCREATORBUG-27789](https://bugreports.qt.io/browse/QTCREATORBUG-27789))
|
||||
([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-editor-locator.html#locating-files-from-global-file-system-index))
|
||||
* Added the `View > Show Menubar` option to hide the menu bar on platforms
|
||||
* Added the `View > Show Menu Bar` option to hide the menu bar on platforms
|
||||
without a unified menu bar
|
||||
([QTCREATORBUG-29498](https://bugreports.qt.io/browse/QTCREATORBUG-29498))
|
||||
([Documentation](https://doc-snapshots.qt.io/qtcreator-12.0/creator-how-to-show-and-hide-main-menu.html))
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
\title Show and hide the main menu
|
||||
|
||||
On Linux and Windows, you can hide the main menu bar to save space on the
|
||||
screen. Select \uicontrol View, and deselect the \uicontrol {Show Menubar}
|
||||
screen. Select \uicontrol View, and deselect the \uicontrol {Show Menu Bar}
|
||||
check box.
|
||||
|
||||
\image qtcreator-without-menubar.webp {Qt Creator without the main menu}
|
||||
|
||||
@@ -1858,18 +1858,18 @@ void ICorePrivate::registerDefaultActions()
|
||||
|
||||
// Show Menubar Action
|
||||
if (globalMenuBar() && !globalMenuBar()->isNativeMenuBar()) {
|
||||
m_toggleMenubarAction = new QAction(Tr::tr("Show Menubar"), this);
|
||||
m_toggleMenubarAction = new QAction(Tr::tr("Show Menu Bar"), this);
|
||||
m_toggleMenubarAction->setCheckable(true);
|
||||
cmd = ActionManager::registerAction(m_toggleMenubarAction, Constants::TOGGLE_MENUBAR);
|
||||
cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Alt+M")));
|
||||
connect(m_toggleMenubarAction, &QAction::toggled, this, [cmd](bool visible) {
|
||||
if (!visible) {
|
||||
CheckableMessageBox::information(
|
||||
Core::ICore::dialogParent(),
|
||||
Tr::tr("Hide Menubar"),
|
||||
Tr::tr(
|
||||
"This will hide the menu bar completely. You can show it again by typing ")
|
||||
+ cmd->keySequence().toString(QKeySequence::NativeText),
|
||||
CheckableMessageBox::information(Core::ICore::dialogParent(),
|
||||
Tr::tr("Hide Menu Bar"),
|
||||
Tr::tr("This will hide the menu bar completely. "
|
||||
"You can show it again by typing %1.")
|
||||
.arg(cmd->keySequence().toString(
|
||||
QKeySequence::NativeText)),
|
||||
Key("ToogleMenuBarHint"));
|
||||
}
|
||||
globalMenuBar()->setVisible(visible);
|
||||
|
||||
Reference in New Issue
Block a user