From 9416f5bb497f42e85d3f0476a416233dbeb1eeb6 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 17 Aug 2018 16:34:58 +0200 Subject: [PATCH] Add close button to loaded traces (not the window close one). --- server/TracyView.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 91d1140a..7c32569f 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -525,8 +525,16 @@ bool View::DrawImpl() if( !m_worker.IsDataStatic() ) { if( ImGui::Button( m_pause ? MainWindowButtons[0] : MainWindowButtons[1], ImVec2( bw, 0 ) ) ) m_pause = !m_pause; - ImGui::SameLine(); } + else + { + ImGui::PushStyleColor( ImGuiCol_Button, (ImVec4)ImColor::HSV( 0.f, 0.6f, 0.6f) ); + ImGui::PushStyleColor( ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV( 0.f, 0.7f, 0.7f) ); + ImGui::PushStyleColor( ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV( 0.f, 0.8f, 0.8f) ); + if( ImGui::Button( "Close" ) ) keepOpen = false; + ImGui::PopStyleColor( 3 ); + } + ImGui::SameLine(); if( ImGui::Button( "Options" ) ) m_showOptions = true; ImGui::SameLine(); if( ImGui::Button( "Messages" ) ) m_showMessages = true;