mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-27 23:37:05 -05:00
impr: Recursively trigger inherited view shortcuts
This commit is contained in:
@@ -367,10 +367,16 @@ namespace hex {
|
||||
if (keyCode != 0)
|
||||
s_prevShortcut = Shortcut(pressedShortcut.getKeys());
|
||||
|
||||
const auto inheritedShortcutsView = currentView->getMenuItemInheritView();
|
||||
if (!runShortcut(pressedShortcut, currentView)) {
|
||||
if (inheritedShortcutsView != nullptr)
|
||||
runShortcut(pressedShortcut, inheritedShortcutsView);
|
||||
std::set<const View*> processedViews;
|
||||
while (true) {
|
||||
if (runShortcut(pressedShortcut, currentView)) {
|
||||
break;
|
||||
}
|
||||
|
||||
processedViews.insert(currentView);
|
||||
currentView = currentView->getMenuItemInheritView();
|
||||
if (currentView == nullptr || processedViews.contains(currentView))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user