From e45b65af235c288ce5050786cddb5782a9831f74 Mon Sep 17 00:00:00 2001 From: chatlanin Date: Sat, 28 Mar 2026 21:24:44 +0300 Subject: [PATCH] fix show new opened tab --- src/monitor/gui/components/creator/cpp/base.cpp | 8 +++++--- src/monitor/gui/components/tabs/cpp/base.cpp | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/monitor/gui/components/creator/cpp/base.cpp b/src/monitor/gui/components/creator/cpp/base.cpp index c4151b6..b24685c 100644 --- a/src/monitor/gui/components/creator/cpp/base.cpp +++ b/src/monitor/gui/components/creator/cpp/base.cpp @@ -32,10 +32,12 @@ namespace monitor::components void creator::clear() { m_status = utils::var::STATUS::COMPLETED; - auto future = std::async(std::launch::async, [this]() { - std::this_thread::sleep_for(std::chrono::seconds(1)); + auto f = [this]() { + std::this_thread::sleep_for(std::chrono::seconds(3)); m_file_path.clear(); m_status = utils::var::STATUS::EMPTY; - }); + }; + std::thread th(f); + th.detach(); } } diff --git a/src/monitor/gui/components/tabs/cpp/base.cpp b/src/monitor/gui/components/tabs/cpp/base.cpp index 41a8344..62a85e4 100755 --- a/src/monitor/gui/components/tabs/cpp/base.cpp +++ b/src/monitor/gui/components/tabs/cpp/base.cpp @@ -31,6 +31,7 @@ namespace monitor::components VE::event e0 { utils::event_type::CREATE_SNAPSHOT_COMPLETED, nullptr }; EMIT(e0); + m_current_open_index = m_snapshots.size() - 1 ; } void tabs::change_tab(std::size_t i)