From 95879d2bd942fea135e6b6e49b9e031ab77b2401 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 16 Aug 2019 00:12:03 +0200 Subject: [PATCH] Use proper UI element to indicate selectable items. --- server/TracyView.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 90390e90..e60a594a 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -4789,14 +4789,20 @@ void View::DrawZoneInfoWindow() const auto cstart = bit->Start(); const auto cpu1 = bit->Cpu(); - ImGui::TextUnformatted( TimeToString( cend - adjust ) ); - if( ImGui::IsMouseClicked( 0 ) && ImGui::IsItemHovered() ) CenterAtTime( cend ); + if( ImGui::Selectable( TimeToString( cend - adjust ) ) ) + { + CenterAtTime( cend ); + } ImGui::NextColumn(); - ImGui::TextUnformatted( TimeToString( cstart - adjust ) ); - if( ImGui::IsMouseClicked( 0 ) && ImGui::IsItemHovered() ) CenterAtTime( cstart ); + if( ImGui::Selectable( TimeToString( cstart - adjust ) ) ) + { + CenterAtTime( cstart ); + } ImGui::NextColumn(); - ImGui::TextUnformatted( TimeToString( cstart - cend ) ); - if( ImGui::IsMouseClicked( 0 ) && ImGui::IsItemHovered() ) ZoomToRange( cend, cstart ); + if( ImGui::Selectable( TimeToString( cstart - cend ) ) ) + { + ZoomToRange( cend, cstart ); + } ImGui::NextColumn(); if( cpu0 == cpu1 ) {