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
|
used for the file system index locator filter
|
||||||
([QTCREATORBUG-27789](https://bugreports.qt.io/browse/QTCREATORBUG-27789))
|
([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))
|
([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
|
without a unified menu bar
|
||||||
([QTCREATORBUG-29498](https://bugreports.qt.io/browse/QTCREATORBUG-29498))
|
([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))
|
([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
|
\title Show and hide the main menu
|
||||||
|
|
||||||
On Linux and Windows, you can hide the main menu bar to save space on the
|
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.
|
check box.
|
||||||
|
|
||||||
\image qtcreator-without-menubar.webp {Qt Creator without the main menu}
|
\image qtcreator-without-menubar.webp {Qt Creator without the main menu}
|
||||||
|
|||||||
@@ -1858,19 +1858,19 @@ void ICorePrivate::registerDefaultActions()
|
|||||||
|
|
||||||
// Show Menubar Action
|
// Show Menubar Action
|
||||||
if (globalMenuBar() && !globalMenuBar()->isNativeMenuBar()) {
|
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);
|
m_toggleMenubarAction->setCheckable(true);
|
||||||
cmd = ActionManager::registerAction(m_toggleMenubarAction, Constants::TOGGLE_MENUBAR);
|
cmd = ActionManager::registerAction(m_toggleMenubarAction, Constants::TOGGLE_MENUBAR);
|
||||||
cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Alt+M")));
|
cmd->setDefaultKeySequence(QKeySequence(Tr::tr("Ctrl+Alt+M")));
|
||||||
connect(m_toggleMenubarAction, &QAction::toggled, this, [cmd](bool visible) {
|
connect(m_toggleMenubarAction, &QAction::toggled, this, [cmd](bool visible) {
|
||||||
if (!visible) {
|
if (!visible) {
|
||||||
CheckableMessageBox::information(
|
CheckableMessageBox::information(Core::ICore::dialogParent(),
|
||||||
Core::ICore::dialogParent(),
|
Tr::tr("Hide Menu Bar"),
|
||||||
Tr::tr("Hide Menubar"),
|
Tr::tr("This will hide the menu bar completely. "
|
||||||
Tr::tr(
|
"You can show it again by typing %1.")
|
||||||
"This will hide the menu bar completely. You can show it again by typing ")
|
.arg(cmd->keySequence().toString(
|
||||||
+ cmd->keySequence().toString(QKeySequence::NativeText),
|
QKeySequence::NativeText)),
|
||||||
Key("ToogleMenuBarHint"));
|
Key("ToogleMenuBarHint"));
|
||||||
}
|
}
|
||||||
globalMenuBar()->setVisible(visible);
|
globalMenuBar()->setVisible(visible);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user