[jasper/world/studio] WorldEditor: suppress keyboard when popup open
This commit is contained in:
parent
bec487552f
commit
79d7f76407
@ -296,16 +296,18 @@ void WorldEditorImGui::drawWorldView() noexcept {
|
||||
return handleDrop(fbPaneScale);
|
||||
});
|
||||
handleMouseSelection(fbPaneScale);
|
||||
auto const&io = ImGui::GetIO();
|
||||
if (io.KeyCtrl) {
|
||||
if (io.KeysDown[ImGuiKey_G]) {
|
||||
clearSelection();
|
||||
} else if (io.KeysDown[ImGuiKey_A]) {
|
||||
m_selection.emplace(ox::Point{0, 0}, ox::Point{m_doc.columns - 1, m_doc.rows - 1});
|
||||
m_view.setSelection(*m_selection);
|
||||
setCopyEnabled(true);
|
||||
setCutEnabled(true);
|
||||
setPasteEnabled(true);
|
||||
if (!popupOpen()) {
|
||||
auto const&io = ImGui::GetIO();
|
||||
if (io.KeyCtrl) {
|
||||
if (io.KeysDown[ImGuiKey_G]) {
|
||||
clearSelection();
|
||||
} else if (io.KeysDown[ImGuiKey_A]) {
|
||||
m_selection.emplace(ox::Point{0, 0}, ox::Point{m_doc.columns - 1, m_doc.rows - 1});
|
||||
m_view.setSelection(*m_selection);
|
||||
setCopyEnabled(true);
|
||||
setCutEnabled(true);
|
||||
setPasteEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -104,6 +104,10 @@ class WorldEditorImGui: public studio::Editor {
|
||||
ox::Result<ox::UUID> assetId() const noexcept;
|
||||
|
||||
ox::Error addDependency(ox::FileAddress const&fileAddr) noexcept;
|
||||
|
||||
constexpr bool popupOpen() const noexcept {
|
||||
return m_sizeEditor.show;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user