[studio] Ensure Editor tabs do first draw immediately, fix shift key being missed with tab shortcuts
All checks were successful
Build / build (push) Successful in 3m14s
All checks were successful
Build / build (push) Successful in 3m14s
This commit is contained in:
parent
151d7c5736
commit
3c3d53b40c
@ -83,7 +83,7 @@ StudioUI::StudioUI(turbine::Context &ctx, ox::StringParam projectDataDir) noexce
|
|||||||
}
|
}
|
||||||
|
|
||||||
void StudioUI::handleKeyEvent(turbine::Key const key, bool const down) noexcept {
|
void StudioUI::handleKeyEvent(turbine::Key const key, bool const down) noexcept {
|
||||||
for (auto p : m_popups) {
|
for (auto const p : m_popups) {
|
||||||
if (p->isOpen()) {
|
if (p->isOpen()) {
|
||||||
if (key == turbine::Key::Escape) {
|
if (key == turbine::Key::Escape) {
|
||||||
p->close();
|
p->close();
|
||||||
@ -118,7 +118,7 @@ void StudioUI::draw() noexcept {
|
|||||||
for (auto &w: m_widgets) {
|
for (auto &w: m_widgets) {
|
||||||
w->draw(m_sctx);
|
w->draw(m_sctx);
|
||||||
}
|
}
|
||||||
for (auto p: m_popups) {
|
for (auto const p: m_popups) {
|
||||||
p->draw(m_sctx);
|
p->draw(m_sctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -207,6 +207,7 @@ void StudioUI::drawTabs() noexcept {
|
|||||||
studio::editConfig<StudioConfig>(keelCtx(m_ctx), [&](StudioConfig &config) {
|
studio::editConfig<StudioConfig>(keelCtx(m_ctx), [&](StudioConfig &config) {
|
||||||
config.activeTabItemName = m_activeEditor->itemPath();
|
config.activeTabItemName = m_activeEditor->itemPath();
|
||||||
});
|
});
|
||||||
|
turbine::setRefreshWithin(m_ctx, 0);
|
||||||
} else [[likely]] {
|
} else [[likely]] {
|
||||||
if (m_activeEditorUpdatePending == e.get()) [[unlikely]] {
|
if (m_activeEditorUpdatePending == e.get()) [[unlikely]] {
|
||||||
m_activeEditorUpdatePending = nullptr;
|
m_activeEditorUpdatePending = nullptr;
|
||||||
@ -317,7 +318,7 @@ void StudioUI::handleKeyInput() noexcept {
|
|||||||
} else if (ImGui::IsKeyPressed(ImGuiKey_Z)) {
|
} else if (ImGui::IsKeyPressed(ImGuiKey_Z)) {
|
||||||
auto const undoStack = m_activeEditor ? m_activeEditor->undoStack() : nullptr;
|
auto const undoStack = m_activeEditor ? m_activeEditor->undoStack() : nullptr;
|
||||||
if (undoStack) { oxLogError(undoStack->undo()); }
|
if (undoStack) { oxLogError(undoStack->undo()); }
|
||||||
} else if (ImGui::IsKeyPressed(ImGuiKey_1) && ImGui::IsKeyPressed(ImGuiKey_ModShift)) {
|
} else if (ImGui::IsKeyPressed(ImGuiKey_1) && ImGui::IsKeyDown(ImGuiKey_ModShift)) {
|
||||||
toggleProjectExplorer();
|
toggleProjectExplorer();
|
||||||
} else {
|
} else {
|
||||||
if (!m_editors.empty()) {
|
if (!m_editors.empty()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user