forked from qt-creator/qt-creator
Core: Mention Ctrl+Shift+K into the hide menubar messagebox
This way the user can trigger the "Show Menu Bar" action when the Ctrl+Alt+M doesn't work. Task-number: QTCREATORBUG-30114 Change-Id: I4e1d14b7bf7554ce1a262c4b1d2671f8d0b81b85 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -1971,13 +1971,31 @@ void ICorePrivate::registerDefaultActions()
|
|||||||
toggleMenubarAction.addToContainer(Constants::M_VIEW, Constants::G_VIEW_VIEWS);
|
toggleMenubarAction.addToContainer(Constants::M_VIEW, Constants::G_VIEW_VIEWS);
|
||||||
toggleMenubarAction.addOnToggled(this, [](bool visible) {
|
toggleMenubarAction.addOnToggled(this, [](bool visible) {
|
||||||
if (!visible) {
|
if (!visible) {
|
||||||
const QString keys = ActionManager::command(Constants::TOGGLE_MENUBAR)
|
auto keySequenceAndText = [](const Utils::Id &actionName) {
|
||||||
->keySequence().toString(QKeySequence::NativeText);
|
const auto command = ActionManager::command(actionName);
|
||||||
CheckableMessageBox::information(Core::ICore::dialogParent(),
|
|
||||||
|
const QString keySequence = command->keySequence().toString(
|
||||||
|
QKeySequence::NativeText);
|
||||||
|
const QString text = command->action()->text();
|
||||||
|
|
||||||
|
return QPair<QString, QString>(keySequence, text);
|
||||||
|
};
|
||||||
|
|
||||||
|
auto [menuBarKeys, menuBarText] = keySequenceAndText(Constants::TOGGLE_MENUBAR);
|
||||||
|
auto [actionsFromMenuKeys, actionsFromMenuText] = keySequenceAndText(
|
||||||
|
"Locator.Actions from the menu");
|
||||||
|
|
||||||
|
CheckableMessageBox::information(
|
||||||
|
Core::ICore::dialogParent(),
|
||||||
Tr::tr("Hide Menu Bar"),
|
Tr::tr("Hide Menu Bar"),
|
||||||
Tr::tr("This will hide the menu bar completely. "
|
Tr::tr("This will hide the menu bar completely. "
|
||||||
"You can show it again by typing %1.")
|
"You can show it again by typing %1."
|
||||||
.arg(keys),
|
"<br><br>"
|
||||||
|
"Or, trigger the \"%2\" action from the \"%3\" locator filter (%4).")
|
||||||
|
.arg(menuBarKeys)
|
||||||
|
.arg(menuBarText)
|
||||||
|
.arg(actionsFromMenuText)
|
||||||
|
.arg(actionsFromMenuKeys),
|
||||||
Key("ToogleMenuBarHint"));
|
Key("ToogleMenuBarHint"));
|
||||||
}
|
}
|
||||||
globalMenuBar()->setVisible(visible);
|
globalMenuBar()->setVisible(visible);
|
||||||
|
|||||||
Reference in New Issue
Block a user