1
0
鏡像自 https://github.com/luanti-org/luanti.git 已同步 2025-11-09 03:25:28 +01:00

GUI: Autofocus newly opened GUIModalMenu instances (#13911)

This in particular fixes incorrect event propagation to menus that
are no longer shown, such as the key change menu when opened within
the settings tab.
此提交包含在:
SmallJoker
2023-10-22 15:31:42 +02:00
提交者 GitHub
父節點 2fbf5f4250
當前提交 906417cc0d
共有 3 個檔案被更改,包括 4 行新增3 行删除

查看文件

@@ -114,7 +114,6 @@ void GUIChatConsole::openConsole(f32 scale)
reformatConsole();
m_animate_time_old = porting::getTimeMs();
IGUIElement::setVisible(true);
Environment->setFocus(this);
m_menumgr->createdMenu(this);
}

查看文件

@@ -57,6 +57,7 @@ public:
if(!m_stack.empty())
m_stack.back()->setVisible(false);
m_stack.push_back(menu);
guienv->setFocus(m_stack.back());
}
virtual void deletingMenu(gui::IGUIElement *menu)
@@ -64,8 +65,10 @@ public:
// Remove all entries if there are duplicates
m_stack.remove(menu);
if(!m_stack.empty())
if(!m_stack.empty()) {
m_stack.back()->setVisible(true);
guienv->setFocus(m_stack.back());
}
}
// Returns true to prevent further processing

查看文件

@@ -49,7 +49,6 @@ GUIModalMenu::GUIModalMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent,
#endif
setVisible(true);
Environment->setFocus(this);
m_menumgr->createdMenu(this);
m_doubleclickdetect[0].time = 0;