mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
impr: Recursively trigger inherited view shortcuts
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user