mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 05:05:19 -05:00
fix: Start fixing shortcuts on welcome screen. Breaks certain shortcuts still
This commit is contained in:
@@ -728,13 +728,13 @@ namespace hex {
|
||||
view->trackViewState();
|
||||
|
||||
// Skip views that shouldn't be processed currently
|
||||
if (!view->shouldProcess())
|
||||
if (!view->shouldProcess() || !view->getWindowOpenState())
|
||||
continue;
|
||||
|
||||
const auto openViewCount = std::ranges::count_if(ContentRegistry::Views::impl::getEntries(), [](const auto &entry) {
|
||||
const auto &[unlocalizedName, openView] = entry;
|
||||
|
||||
return openView->hasViewMenuItemEntry() && openView->shouldProcess();
|
||||
return openView->hasViewMenuItemEntry() && openView->shouldDraw();
|
||||
});
|
||||
|
||||
ImGuiWindowClass windowClass = {};
|
||||
@@ -758,6 +758,19 @@ namespace hex {
|
||||
// Draw view
|
||||
view->draw();
|
||||
|
||||
// Handle view shortcuts
|
||||
for (const auto &key : m_pressedKeys) {
|
||||
ShortcutManager::process(
|
||||
view.get(),
|
||||
io.ConfigMacOSXBehaviors ? io.KeySuper : io.KeyCtrl,
|
||||
io.KeyAlt,
|
||||
io.KeyShift,
|
||||
io.ConfigMacOSXBehaviors ? io.KeyCtrl : io.KeySuper,
|
||||
view.get() == View::getLastFocusedView(),
|
||||
key
|
||||
);
|
||||
}
|
||||
|
||||
// If the window was just opened, it wasn't found above, so try to find it again
|
||||
if (window == nullptr)
|
||||
window = ImGui::FindWindowByName(view->getName().c_str());
|
||||
@@ -793,10 +806,6 @@ namespace hex {
|
||||
|
||||
// Pass on currently pressed keys to the shortcut handler
|
||||
if (!windowIsPopup) {
|
||||
for (const auto &key : m_pressedKeys) {
|
||||
ShortcutManager::process(view.get(), io.ConfigMacOSXBehaviors ? io.KeySuper : io.KeyCtrl, io.KeyAlt, io.KeyShift, io.ConfigMacOSXBehaviors ? io.KeyCtrl : io.KeySuper, focused, key);
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
} else if (view->didWindowJustClose()) {
|
||||
@@ -808,7 +817,13 @@ namespace hex {
|
||||
|
||||
// Handle global shortcuts
|
||||
for (const auto &key : m_pressedKeys) {
|
||||
ShortcutManager::processGlobals(io.ConfigMacOSXBehaviors ? io.KeySuper : io.KeyCtrl, io.KeyAlt, io.KeyShift, io.ConfigMacOSXBehaviors ? io.KeyCtrl : io.KeySuper, key);
|
||||
ShortcutManager::processGlobals(
|
||||
io.ConfigMacOSXBehaviors ? io.KeySuper : io.KeyCtrl,
|
||||
io.KeyAlt,
|
||||
io.KeyShift,
|
||||
io.ConfigMacOSXBehaviors ? io.KeyCtrl : io.KeySuper,
|
||||
key
|
||||
);
|
||||
}
|
||||
|
||||
m_pressedKeys.clear();
|
||||
|
||||
Reference in New Issue
Block a user