[turbine,studio] Fix some popup window resize weirdness, cleanup some function names
All checks were successful
Build / build (push) Successful in 1m17s

This commit is contained in:
2025-05-24 01:32:14 -05:00
parent ed1160ec74
commit 8419b137e5
6 changed files with 42 additions and 8 deletions

View File

@@ -43,7 +43,7 @@ static ox::Error runApp(
oxLogError(turbine::setWindowIcon(*ctx, WindowIcons()));
turbine::setWindowTitle(*ctx, keelCtx(*ctx).appName);
turbine::setKeyEventHandler(*ctx, keyEventHandler);
turbine::setRefreshWithin(*ctx, 0);
turbine::requireRefreshWithin(*ctx, 0);
StudioUI ui(*ctx, projectDataDir);
StudioUIDrawer drawer(ui);
turbine::gl::addDrawer(*ctx, &drawer);

View File

@@ -2,6 +2,8 @@
* Copyright 2016 - 2025 Gary Talent (gary@drinkingtea.net). All rights reserved.
*/
#include <turbine/gfx.hpp>
#include <studio/imguiutil.hpp>
#include "deleteconfirmation.hpp"
@@ -43,6 +45,9 @@ void DeleteConfirmation::draw(Context &ctx) noexcept {
ImGui::OpenPopup(title().c_str());
m_stage = Stage::Open;
m_open = true;
// require extended refresh in case new contents require resize
// this can take around a second
turbine::requireRefreshFor(ctx.tctx, 1000);
[[fallthrough]];
case Stage::Open:
drawWindow(ctx.tctx, m_open, [this] {

View File

@@ -347,7 +347,7 @@ void StudioUI::drawTabs() noexcept {
pc->activeTabItemName = m_activeEditor->itemPath();
}
});
turbine::setRefreshWithin(m_tctx, 0);
turbine::requireRefreshWithin(m_tctx, 0);
} else [[likely]] {
if (m_activeEditorUpdatePending == e.get()) [[unlikely]] {
m_activeEditorUpdatePending = nullptr;

View File

@@ -275,6 +275,9 @@ void QuestionPopup::draw(Context &ctx) noexcept {
ImGui::OpenPopup(m_title.c_str());
m_stage = Stage::Open;
m_open = true;
// require extended refresh in case new contents require resize
// this can take around a second
turbine::requireRefreshFor(ctx.tctx, 1000);
[[fallthrough]];
case Stage::Open:
centerNextWindow(ctx.tctx);