impr: Recursively trigger inherited view shortcuts

This commit is contained in:
WerWolv
2026-03-14 17:19:27 +01:00
parent 432e16e0c4
commit 7083b6ab3e

View File

@@ -367,10 +367,16 @@ namespace hex {
if (keyCode != 0) if (keyCode != 0)
s_prevShortcut = Shortcut(pressedShortcut.getKeys()); s_prevShortcut = Shortcut(pressedShortcut.getKeys());
const auto inheritedShortcutsView = currentView->getMenuItemInheritView(); std::set<const View*> processedViews;
if (!runShortcut(pressedShortcut, currentView)) { while (true) {
if (inheritedShortcutsView != nullptr) if (runShortcut(pressedShortcut, currentView)) {
runShortcut(pressedShortcut, inheritedShortcutsView); break;
}
processedViews.insert(currentView);
currentView = currentView->getMenuItemInheritView();
if (currentView == nullptr || processedViews.contains(currentView))
break;
} }
} }