[nostalgia,studio] Proper fix for input filtering
This commit is contained in:
parent
48e45c7dd6
commit
6170647c0c
@ -258,8 +258,7 @@ void PaletteEditorImGui::drawColorEditor() noexcept {
|
||||
std::ignore = pushCommand<ApplyColorAllPagesCommand>(
|
||||
m_pal, m_page, m_selectedColorRow);
|
||||
}
|
||||
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_RootWindow) &&
|
||||
!inputFocused && !m_pageRenameDlg.isOpen()) {
|
||||
if (ig::mainWinHasFocus()) {
|
||||
if (!ImGui::IsKeyDown(ImGuiKey_ModAlt)) {
|
||||
numShortcuts(m_selectedColorRow, largestPage(m_pal));
|
||||
} else {
|
||||
|
@ -18,6 +18,9 @@
|
||||
|
||||
namespace studio {
|
||||
|
||||
namespace ig {
|
||||
extern bool s_mainWinHasFocus;
|
||||
}
|
||||
static ox::Vector<Module const*> modules;
|
||||
|
||||
void registerModule(Module const*mod) noexcept {
|
||||
@ -114,6 +117,8 @@ void StudioUI::draw() noexcept {
|
||||
ImGuiWindowFlags_NoSavedSettings;
|
||||
ImGui::Begin("MainWindow##Studio", nullptr, windowFlags);
|
||||
{
|
||||
ig::s_mainWinHasFocus = ImGui::IsWindowFocused(
|
||||
ImGuiFocusedFlags_RootAndChildWindows | ImGuiFocusedFlags_NoPopupHierarchy);
|
||||
if (m_showProjectExplorer) {
|
||||
m_projectExplorer.draw(m_sctx);
|
||||
ImGui::SameLine();
|
||||
|
@ -256,4 +256,7 @@ class FilePicker {
|
||||
|
||||
};
|
||||
|
||||
[[nodiscard]]
|
||||
bool mainWinHasFocus() noexcept;
|
||||
|
||||
}
|
||||
|
@ -208,4 +208,9 @@ void FilePicker::show() noexcept {
|
||||
m_show = true;
|
||||
}
|
||||
|
||||
bool s_mainWinHasFocus{};
|
||||
bool mainWinHasFocus() noexcept {
|
||||
return s_mainWinHasFocus;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user