Use ImGui mouse button identifiers instead of raw numeric ids.

This commit is contained in:
Bartosz Taudul
2026-07-05 18:47:38 +02:00
parent f2256cf260
commit 81cb4acbe6
22 changed files with 129 additions and 129 deletions
+2 -2
View File
@@ -1383,7 +1383,7 @@ Would you like to enable achievements?
if( ( animStage == 0 || animStage == 2 ) && ImGui::IsMouseHoveringRect( cursorScreen - ImVec2( dpiScale * 2, dpiScale * 2 ), cursorScreen + starSize + ImVec2( dpiScale * 4, dpiScale * 4 ) ) )
{
color = 0xFFFFFFFF;
if( ImGui::IsMouseClicked( 0 ) )
if( ImGui::IsMouseClicked( ImGuiMouseButton_Left ) )
{
if( animStage == 0 )
{
@@ -1414,7 +1414,7 @@ Would you like to enable achievements?
ImGui::PopFont();
if( animStage == 2 )
{
if( ImGui::IsMouseHoveringRect( dismiss - ImVec2( 0, dpiScale * 6 ), dismiss + ImVec2( aSize, th * 1.5f + dpiScale * 4 ) ) && ImGui::IsMouseClicked( 0 ) )
if( ImGui::IsMouseHoveringRect( dismiss - ImVec2( 0, dpiScale * 6 ), dismiss + ImVec2( aSize, th * 1.5f + dpiScale * 4 ) ) && ImGui::IsMouseClicked( ImGuiMouseButton_Left ) )
{
s_achievementItem = aItem;
s_switchAchievementCategory = true;
+12 -12
View File
@@ -1271,7 +1271,7 @@ void SourceView::RenderSymbolView( Worker& worker, View& view )
UnsetFont();
ImGui::EndTooltip();
}
if( ImGui::IsMouseClicked( 1 ) )
if( ImGui::IsMouseClicked( ImGuiMouseButton_Right ) )
{
OpenSymbol( fileName, sd->line, v.addr, v.addr, worker, view );
}
@@ -2428,13 +2428,13 @@ uint64_t SourceView::RenderSymbolAsmView( const AddrStatData& as, Worker& worker
}
ImGui::EndTooltip();
SetFont();
if( ImGui::IsMouseClicked( 0 ) )
if( ImGui::IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_targetAddr = v.first;
m_selectedAddresses.clear();
m_selectedAddresses.emplace( v.first );
}
else if( ImGui::IsMouseClicked( 1 ) )
else if( ImGui::IsMouseClicked( ImGuiMouseButton_Right ) )
{
ImGui::OpenPopup( "jumpPopup" );
m_jumpPopupAddr = v.first;
@@ -3109,7 +3109,7 @@ void SourceView::RenderLine( const Tokenizer::Line& line, int lineNum, const Add
ImGui::EndTooltip();
SetFont();
if( ImGui::IsMouseClicked( 0 ) )
if( ImGui::IsMouseClicked( ImGuiMouseButton_Left ) )
{
mouseHandled = true;
auto& io = ImGui::GetIO();
@@ -3158,7 +3158,7 @@ void SourceView::RenderLine( const Tokenizer::Line& line, int lineNum, const Add
m_srcGroupSelect = lineNum;
}
}
else if( ImGui::IsMouseClicked( 1 ) )
else if( ImGui::IsMouseClicked( ImGuiMouseButton_Right ) )
{
mouseHandled = true;
m_srcSampleSelect.clear();
@@ -3277,10 +3277,10 @@ void SourceView::RenderLine( const Tokenizer::Line& line, int lineNum, const Add
if( match > 0 && ImGui::IsWindowHovered() && ImGui::IsMouseHoveringRect( wpos, wpos + ImVec2( w, ty ) ) )
{
draw->AddRectFilled( wpos + ImVec2( 0, 1 ), wpos + ImVec2( w, ty ), 0x11FFFFFF );
if( !mouseHandled && ( ImGui::IsMouseClicked( 0 ) || ImGui::IsMouseClicked( 1 ) ) )
if( !mouseHandled && ( ImGui::IsMouseClicked( ImGuiMouseButton_Left ) || ImGui::IsMouseClicked( ImGuiMouseButton_Right ) ) )
{
m_displayMode = DisplayMixed;
SelectLine( lineNum, worker, ImGui::IsMouseClicked( 0 ) );
SelectLine( lineNum, worker, ImGui::IsMouseClicked( ImGuiMouseButton_Left ) );
}
else
{
@@ -3462,7 +3462,7 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
ImGui::EndTooltip();
SetFont();
if( ImGui::IsMouseClicked( 0 ) )
if( ImGui::IsMouseClicked( ImGuiMouseButton_Left ) )
{
auto& io = ImGui::GetIO();
if( io.KeyCtrl )
@@ -3510,12 +3510,12 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
m_asmGroupSelect = idx;
}
}
else if( ImGui::IsMouseClicked( 1 ) )
else if( ImGui::IsMouseClicked( ImGuiMouseButton_Right ) )
{
m_asmSampleSelect.clear();
m_asmGroupSelect = -1;
}
else if( stats && !stats->parents.empty() && ImGui::IsMouseClicked( 2 ) )
else if( stats && !stats->parents.empty() && ImGui::IsMouseClicked( ImGuiMouseButton_Middle ) )
{
view.ShowSampleParents( symAddrParents, false );
}
@@ -4264,7 +4264,7 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
SetFont();
}
}
if( ImGui::IsMouseClicked( 0 ) )
if( ImGui::IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_asmSelected = asmIdx;
ResetAsm();
@@ -4297,7 +4297,7 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
FollowRead( asmIdx, line.writeX86[idx++], 64 );
}
}
else if( ImGui::IsMouseClicked( 1 ) )
else if( ImGui::IsMouseClicked( ImGuiMouseButton_Right ) )
{
m_asmSelected = -1;
ResetAsm();
@@ -107,7 +107,7 @@ void TimelineController::End( double pxns, const ImVec2& wpos, bool hover, bool
const auto mouseMoved = mouseDelta.x != 0.0f || mouseDelta.y != 0.0f;
const auto& mousePos = ImGui::GetIO().MousePos;
const auto mouseVisible = ImGui::IsMousePosValid( &mousePos );
return ( ( imguiChangedScroll || mouseMoved || !mouseVisible ) && !ImGui::IsMouseDown( 1 ) ) || !m_centerItemkey;
return ( ( imguiChangedScroll || mouseMoved || !mouseVisible ) && !ImGui::IsMouseDown( ImGuiMouseButton_Right ) ) || !m_centerItemkey;
};
if( !vcenter )
+3 -3
View File
@@ -94,11 +94,11 @@ void TimelineItem::Draw( bool firstFrame, const TimelineContext& ctx, int yOffse
{
HeaderTooltip( label );
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_showFull = !m_showFull;
}
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
const auto t0 = RangeBegin();
const auto t1 = RangeEnd();
@@ -107,7 +107,7 @@ void TimelineItem::Draw( bool firstFrame, const TimelineContext& ctx, int yOffse
m_view.ZoomToRange( t0, t1 );
}
}
if( IsMouseClicked( 1 ) )
if( IsMouseClicked( ImGuiMouseButton_Right ) )
{
ImGui::OpenPopup( "menuPopup" );
}
@@ -249,7 +249,7 @@ void TimelineItemThread::HeaderExtraContents( const TimelineContext& ctx, int of
if( ctx.hover && ImGui::IsMouseHoveringRect( ctx.wpos + ImVec2( 1.5f * ty + labelWidth, offset ), ctx.wpos + ImVec2( 1.5f * ty + labelWidth + ghostSz, offset + ty ) ) )
{
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_ghost = !m_ghost;
}
@@ -262,7 +262,7 @@ void View::DrawContextSwitchList( const TimelineContext& ctx, const std::vector<
}
tooltip = true;
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToRange( prev.End(), ev.WakeupVal() );
}
@@ -274,7 +274,7 @@ void View::DrawContextSwitchList( const TimelineContext& ctx, const std::vector<
TextFocused( "Thread is", "waking up" );
TextFocused( "Scheduling delay:", TimeToString( ev.Start() - ev.WakeupVal() ) );
TextFocused( "CPU:", RealToString( ev.Cpu() ) );
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToRange( prev.End(), ev.WakeupVal() );
}
@@ -289,7 +289,7 @@ void View::DrawContextSwitchList( const TimelineContext& ctx, const std::vector<
ImGui::Separator();
TextDisabledUnformatted( ICON_FA_HOURGLASS_HALF " Wait stack:" );
CallstackTooltipContents( waitStack );
if( ImGui::IsMouseClicked( 0 ) )
if( ImGui::IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_callstackView = {
.id = waitStack,
@@ -340,7 +340,7 @@ void View::DrawContextSwitchList( const TimelineContext& ctx, const std::vector<
}
ImGui::EndTooltip();
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToRange( ev.Start(), end );
}
@@ -357,7 +357,7 @@ void View::DrawContextSwitchList( const TimelineContext& ctx, const std::vector<
TextFocused( "Time:", TimeToString( end - ev.Start() ) );
ImGui::EndTooltip();
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToRange( ev.Start(), end );
}
@@ -391,7 +391,7 @@ void View::DrawContextSwitchList( const TimelineContext& ctx, const std::vector<
}
ImGui::EndTooltip();
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToRange( ev.Start(), end );
}
+3 -3
View File
@@ -197,7 +197,7 @@ bool View::DrawCpuData( const TimelineContext& ctx, const std::vector<CpuUsageDr
ImGui::EndTooltip();
ImGui::PushFont( g_fonts.normal, FontSmall );
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToRange( t0, t1 );
}
@@ -387,13 +387,13 @@ bool View::DrawCpuData( const TimelineContext& ctx, const std::vector<CpuUsageDr
ImGui::EndTooltip();
ImGui::PushFont( g_fonts.normal, FontSmall );
if( local && IsMouseClicked( 0 ) )
if( local && IsMouseClicked( ImGuiMouseButton_Left ) )
{
auto& item = m_tc.GetItem( m_worker.GetThreadData( thread ) );
item.SetVisible( true );
item.SetShowFull( true );
}
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToRange( ev.Start(), end );
}
+4 -4
View File
@@ -221,7 +221,7 @@ void View::DrawZoneList( int id, const Vector<short_ptr<ZoneEvent>>& zones )
if( ImGui::IsItemHovered() )
{
m_zoneHighlight = ev;
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToZone( *ev );
}
@@ -1456,12 +1456,12 @@ void View::DrawFindZone()
TextFocused( "Time spent in the right bins:", TimeToString( tAfter ) );
ImGui::EndTooltip();
if( IsMouseClicked( 1 ) )
if( IsMouseClicked( ImGuiMouseButton_Right ) )
{
m_findZone.highlight.active = false;
m_findZone.ResetGroups();
}
else if( IsMouseClicked( 0 ) )
else if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_findZone.highlight.active = true;
m_findZone.highlight.start = t0;
@@ -1469,7 +1469,7 @@ void View::DrawFindZone()
m_findZone.hlOrig_t0 = t0;
m_findZone.hlOrig_t1 = t1;
}
else if( IsMouseDragging( 0 ) )
else if( IsMouseDragging( ImGuiMouseButton_Left ) )
{
if( t0 < m_findZone.hlOrig_t0 )
{
@@ -631,7 +631,7 @@ void View::DrawFlameGraphItem( const FlameGraphItem& item, FlameGraphContext& ct
TextDisabledUnformatted( buf );
}
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
ViewDispatch( file, line, symAddr );
}
@@ -661,7 +661,7 @@ void View::DrawFlameGraphItem( const FlameGraphItem& item, FlameGraphContext& ct
}
ImGui::EndTooltip();
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_findZone.ShowZone( item.srcloc, slName );
}
@@ -807,7 +807,7 @@ static bool DrawFlameGraphHorizontalPosition( int64_t& vStart, int64_t& vEnd, do
ImGui::EndTooltip();
}
if( active && ImGui::IsMouseDragging( 0 ) )
if( active && ImGui::IsMouseDragging( ImGuiMouseButton_Left ) )
{
const auto delta = ImGui::GetIO().MouseDelta.x;
ApplyFlameGraphPan( vStart, vEnd, pan, delta * totalSpan / w );
@@ -1269,9 +1269,9 @@ void View::DrawFlameGraph()
ImGui::IsMouseHoveringRect( ImVec2( wpos.x, clipMin.y ), ImVec2( wpos.x + w, clipMax.y ), false );
const bool wheel_scroll = fabs( io.MouseWheelH ) > fabs( io.MouseWheel );
if( hover && ( IsMouseDragging( 1 ) || wheel_scroll ) )
if( hover && ( IsMouseDragging( ImGuiMouseButton_Right ) || wheel_scroll ) )
{
const auto delta = GetMouseDragDelta( 1 );
const auto delta = GetMouseDragDelta( ImGuiMouseButton_Right );
const auto hwheel_delta = io.MouseWheelH * 50.f * m_horizontalScrollMultiplier;
if( delta.x != 0 || hwheel_delta != 0 )
{
@@ -96,11 +96,11 @@ void View::DrawFrames()
if( hover )
{
const auto hwheel_delta = io.MouseWheelH * 100.f * m_horizontalScrollMultiplier;
if( IsMouseDragging( 1 ) || hwheel_delta != 0 )
if( IsMouseDragging( ImGuiMouseButton_Right ) || hwheel_delta != 0 )
{
m_viewMode = ViewMode::Paused;
m_viewModeHeuristicTry = false;
auto delta = GetMouseDragDelta( 1 ).x;
auto delta = GetMouseDragDelta( ImGuiMouseButton_Right ).x;
if( delta == 0 ) delta = hwheel_delta;
if( abs( delta ) >= fwidth )
{
@@ -137,7 +137,7 @@ void View::DrawFrames()
ImGui::SameLine();
ImGui::TextDisabled( "(%.1f FPS)", 1000000000.0 / f );
if( IsMouseClickReleased( 1 ) ) m_setRangePopup = RangeSlim { m_worker.GetFrameTime( *m_frames, sel ), m_worker.GetFrameTime( *m_frames, sel + g - 1 ), true };
if( IsMouseClickReleased( ImGuiMouseButton_Right ) ) m_setRangePopup = RangeSlim { m_worker.GetFrameTime( *m_frames, sel ), m_worker.GetFrameTime( *m_frames, sel + g - 1 ), true };
}
else
{
@@ -203,7 +203,7 @@ void View::DrawFrames()
if( io.KeyCtrl )
{
if( fi && IsMouseDown( 0 ) )
if( fi && IsMouseDown( ImGuiMouseButton_Left ) )
{
m_showPlayback = true;
m_playback.pause = true;
@@ -212,7 +212,7 @@ void View::DrawFrames()
}
else
{
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_viewMode = ViewMode::Paused;
m_viewModeHeuristicTry = false;
@@ -222,7 +222,7 @@ void View::DrawFrames()
m_vd.zvEnd = m_worker.GetFrameEnd( *m_frames, sel + group - 1 );
if( m_vd.zvStart == m_vd.zvEnd ) m_vd.zvStart--;
}
else if( IsMouseDragging( 0 ) )
else if( IsMouseDragging( ImGuiMouseButton_Left ) )
{
const auto t0 = std::min( m_vd.zvStart, m_worker.GetFrameBegin( *m_frames, sel ) );
const auto t1 = std::max( m_vd.zvEnd, m_worker.GetFrameEnd( *m_frames, sel + group - 1 ) );
@@ -230,7 +230,7 @@ void View::DrawFrames()
}
}
if( IsMouseClickReleased( 1 ) ) m_setRangePopup = RangeSlim { m_worker.GetFrameBegin( *m_frames, sel ), m_worker.GetFrameEnd( *m_frames, sel + group - 1 ), true };
if( IsMouseClickReleased( ImGuiMouseButton_Right ) ) m_setRangePopup = RangeSlim { m_worker.GetFrameBegin( *m_frames, sel ), m_worker.GetFrameEnd( *m_frames, sel + group - 1 ), true };
}
if( ( !m_worker.IsConnected() || m_viewMode == ViewMode::Paused ) && wheel != 0 )
@@ -146,7 +146,7 @@ void View::DrawTimelineFrames( const FrameData& frames )
if( ImGui::IsMouseHoveringRect( wpos + ImVec2( x0, 0 ), wpos + ImVec2( x1, ty ) ) )
{
tooltipDisplayed = true;
if( IsMouseClickReleased( 1 ) ) m_setRangePopup = RangeSlim { fbegin, fend, true };
if( IsMouseClickReleased( ImGuiMouseButton_Right ) ) m_setRangePopup = RangeSlim { fbegin, fend, true };
ImGui::BeginTooltip();
ImGui::TextUnformatted( GetFrameText( frames, i, ftime ) );
@@ -159,7 +159,7 @@ void View::DrawTimelineFrames( const FrameData& frames )
ImGui::Separator();
DrawFrameImage( m_FrameTextureCache, *fi );
if( ImGui::GetIO().KeyCtrl && IsMouseClicked( 0 ) )
if( ImGui::GetIO().KeyCtrl && IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_showPlayback = true;
m_playback.pause = true;
@@ -168,7 +168,7 @@ void View::DrawTimelineFrames( const FrameData& frames )
}
ImGui::EndTooltip();
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToRange( fbegin, fend );
}
@@ -315,7 +315,7 @@ void View::DrawTimelineFrames( const FrameData& frames )
ImGui::TextUnformatted( GetFrameSetName( frames ) );
ImGui::EndTooltip();
}
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_frames = &frames;
}
@@ -467,8 +467,8 @@ void View::DrawTimelineSections()
TextFocused( "Execution time:", TimeToString( groupEnd - start ) );
ImGui::EndTooltip();
if( IsMouseClickReleased( 1 ) ) m_setRangePopup = RangeSlim { start, groupEnd, true };
if( IsMouseClicked( 2 ) ) ZoomToRange( start, groupEnd );
if( IsMouseClickReleased( ImGuiMouseButton_Right ) ) m_setRangePopup = RangeSlim { start, groupEnd, true };
if( IsMouseClicked( ImGuiMouseButton_Middle ) ) ZoomToRange( start, groupEnd );
}
else
{
@@ -479,8 +479,8 @@ void View::DrawTimelineSections()
TextFocused( "Time from start of program:", TimeToStringExact( start ) );
ImGui::EndTooltip();
if( IsMouseClickReleased( 1 ) ) m_setRangePopup = RangeSlim { start, end, true };
if( IsMouseClicked( 2 ) ) ZoomToRange( start, end );
if( IsMouseClickReleased( ImGuiMouseButton_Right ) ) m_setRangePopup = RangeSlim { start, end, true };
if( IsMouseClicked( ImGuiMouseButton_Middle ) ) ZoomToRange( start, end );
}
}
@@ -533,8 +533,8 @@ void View::DrawTimelineSections()
TextFocused( "Time from start of program:", TimeToStringExact( start ) );
ImGui::EndTooltip();
if( IsMouseClickReleased( 1 ) ) m_setRangePopup = RangeSlim { start, end, true };
if( IsMouseClicked( 2 ) ) ZoomToRange( start, end );
if( IsMouseClickReleased( ImGuiMouseButton_Right ) ) m_setRangePopup = RangeSlim { start, end, true };
if( IsMouseClicked( ImGuiMouseButton_Middle ) ) ZoomToRange( start, end );
}
++i;
@@ -195,7 +195,7 @@ int View::DrawGpuZoneLevel( const V& vec, bool hover, double pxns, int64_t nspx,
TextFocused( "Execution time:", TimeToString( rend - start ) );
ImGui::EndTooltip();
if( IsMouseClicked( 2 ) && rend - start > 0 )
if( IsMouseClicked( ImGuiMouseButton_Middle ) && rend - start > 0 )
{
ZoomToRange( start, rend );
}
@@ -205,11 +205,11 @@ int View::DrawGpuZoneLevel( const V& vec, bool hover, double pxns, int64_t nspx,
const auto zoneThread = thread != 0 ? thread : m_worker.DecompressThread( ev.Thread() );
ZoneTooltip( ev );
if( IsMouseClicked( 2 ) && rend - start > 0 )
if( IsMouseClicked( ImGuiMouseButton_Middle ) && rend - start > 0 )
{
ZoomToZone( ev );
}
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
ShowZoneInfo( ev, zoneThread );
}
@@ -291,11 +291,11 @@ int View::DrawGpuZoneLevel( const V& vec, bool hover, double pxns, int64_t nspx,
const auto zoneThread = thread != 0 ? thread : m_worker.DecompressThread( ev.Thread() );
ZoneTooltip( ev );
if( !m_zoomAnim.active && IsMouseClicked( 2 ) )
if( !m_zoomAnim.active && IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToZone( ev );
}
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
ShowZoneInfo( ev, zoneThread );
}
+4 -4
View File
@@ -95,11 +95,11 @@ void View::DrawLockHeader( uint32_t id, const LockMap& lockmap, const SourceLoca
TextFocused( "Lock events:", RealToString( lockmap.timeline.size() ) );
ImGui::EndTooltip();
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_lockInfoWindow = id;
}
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToRange( range.start, range.end );
}
@@ -159,11 +159,11 @@ int View::DrawLocks( const TimelineContext& ctx, const std::vector<std::unique_p
bool itemHovered = hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + ostep ) );
if( itemHovered )
{
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_lockInfoWindow = lock.id;
}
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToRange( t0, t1 );
}
+4 -4
View File
@@ -614,7 +614,7 @@ void View::DrawMemoryAllocWindow()
if( hover )
{
m_zoneHighlight = zoneAlloc;
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToZone( *zoneAlloc );
}
@@ -639,7 +639,7 @@ void View::DrawMemoryAllocWindow()
if( hover )
{
m_zoneHighlight = zoneFree;
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToZone( *zoneFree );
}
@@ -829,7 +829,7 @@ void View::ListMemData( std::vector<const MemEvent*>& vec, const std::function<v
if( hover )
{
m_zoneHighlight = zone;
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToZone( *zone );
}
@@ -873,7 +873,7 @@ void View::ListMemData( std::vector<const MemEvent*>& vec, const std::function<v
if( hover )
{
m_zoneHighlight = zoneFree;
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToZone( *zoneFree );
}
@@ -28,7 +28,7 @@ void View::DrawNotificationArea()
ImGui::BulletText( "Disable symbol resolution altogether with TRACY_NO_CALLSTACK" );
ImGui::TextWrapped( "For more information, please refer to the manual." );
ImGui::EndTooltip();
if( IsMouseClicked( 0 ) ) m_sendQueueWarning.enabled = false;
if( IsMouseClicked( ImGuiMouseButton_Left ) ) m_sendQueueWarning.enabled = false;
}
}
auto& io = ImGui::GetIO();
@@ -76,14 +76,14 @@ void View::DrawNotificationArea()
if( ImGui::IsItemHovered() )
{
CrashTooltip();
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_callstackView = {
.id = crash.callstack,
.thread = crash.thread
};
}
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
CenterAtTime( crash.time );
}
@@ -108,7 +108,7 @@ void View::DrawNotificationArea()
TextFocused( "First occurrence:", TimeToString( t - m_worker.GetFirstTime() ) );
ImGui::TextDisabled( "Click to center the view at this time." );
ImGui::EndTooltip();
if( IsMouseClicked( 0 ) ) CenterAtTime( t );
if( IsMouseClicked( ImGuiMouseButton_Left ) ) CenterAtTime( t );
}
}
if( m_vd.drawEmptyLabels )
@@ -120,7 +120,7 @@ void View::DrawNotificationArea()
ImGui::BeginTooltip();
ImGui::TextUnformatted( "Displaying empty labels." );
ImGui::EndTooltip();
if( IsMouseClicked( 0 ) ) m_vd.drawEmptyLabels = false;
if( IsMouseClicked( ImGuiMouseButton_Left ) ) m_vd.drawEmptyLabels = false;
}
}
if( !m_vd.drawContextSwitches )
@@ -132,7 +132,7 @@ void View::DrawNotificationArea()
ImGui::BeginTooltip();
ImGui::TextUnformatted( "Context switches are hidden." );
ImGui::EndTooltip();
if( IsMouseClicked( 0 ) ) m_vd.drawContextSwitches = true;
if( IsMouseClicked( ImGuiMouseButton_Left ) ) m_vd.drawContextSwitches = true;
}
}
if( !m_vd.drawCpuData )
@@ -144,7 +144,7 @@ void View::DrawNotificationArea()
ImGui::BeginTooltip();
ImGui::TextUnformatted( "CPU data is hidden." );
ImGui::EndTooltip();
if( IsMouseClicked( 0 ) ) m_vd.drawCpuData = true;
if( IsMouseClicked( ImGuiMouseButton_Left ) ) m_vd.drawCpuData = true;
}
}
if( !m_vd.drawGpuZones )
@@ -156,7 +156,7 @@ void View::DrawNotificationArea()
ImGui::BeginTooltip();
ImGui::TextUnformatted( "GPU zones are hidden." );
ImGui::EndTooltip();
if( IsMouseClicked( 0 ) ) m_vd.drawGpuZones = true;
if( IsMouseClicked( ImGuiMouseButton_Left ) ) m_vd.drawGpuZones = true;
}
}
if( !m_vd.drawZones )
@@ -168,7 +168,7 @@ void View::DrawNotificationArea()
ImGui::BeginTooltip();
ImGui::TextUnformatted( "CPU zones are hidden." );
ImGui::EndTooltip();
if( IsMouseClicked( 0 ) ) m_vd.drawZones = true;
if( IsMouseClicked( ImGuiMouseButton_Left ) ) m_vd.drawZones = true;
}
}
if( !m_vd.ghostZones )
@@ -180,7 +180,7 @@ void View::DrawNotificationArea()
ImGui::BeginTooltip();
ImGui::TextUnformatted( "Ghost zones are hidden." );
ImGui::EndTooltip();
if( IsMouseClicked( 0 ) ) m_vd.ghostZones = true;
if( IsMouseClicked( ImGuiMouseButton_Left ) ) m_vd.ghostZones = true;
}
}
if( !m_vd.drawLocks )
@@ -192,7 +192,7 @@ void View::DrawNotificationArea()
ImGui::BeginTooltip();
ImGui::TextUnformatted( "Locks are hidden." );
ImGui::EndTooltip();
if( IsMouseClicked( 0 ) ) m_vd.drawLocks = true;
if( IsMouseClicked( ImGuiMouseButton_Left ) ) m_vd.drawLocks = true;
}
}
if( !m_vd.drawPlots )
@@ -204,7 +204,7 @@ void View::DrawNotificationArea()
ImGui::BeginTooltip();
ImGui::TextUnformatted( "Plots are hidden." );
ImGui::EndTooltip();
if( IsMouseClicked( 0 ) ) m_vd.drawPlots = true;
if( IsMouseClicked( ImGuiMouseButton_Left ) ) m_vd.drawPlots = true;
}
}
{
@@ -238,7 +238,7 @@ void View::DrawNotificationArea()
ImGui::BeginTooltip();
ImGui::TextUnformatted( "Some timeline entries are hidden." );
ImGui::EndTooltip();
if( IsMouseClicked( 0 ) ) m_showOptions = true;
if( IsMouseClicked( ImGuiMouseButton_Left ) ) m_showOptions = true;
}
}
}
+2 -2
View File
@@ -740,11 +740,11 @@ void View::DrawOptions()
ImGui::BeginTooltip();
ImGui::TextUnformatted( "Crashed" );
ImGui::EndTooltip();
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_showInfo = true;
}
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
CenterAtTime( crash.time );
}
+1 -1
View File
@@ -371,7 +371,7 @@ void View::DrawPlotPoint( const ImVec2& wpos, float x, float y, int offset, uint
m_memoryAllocHover = std::distance( mem.data.begin(), ev );
m_memoryAllocHoverWait = 2;
m_memoryAllocHoverPool = name;
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_memoryAllocInfoWindow = m_memoryAllocHover;
m_memoryAllocInfoPool = name;
+7 -7
View File
@@ -133,7 +133,7 @@ void View::DrawRangeEntry( Range& range, const char* label, uint32_t color, int
void View::HandleRange( Range& range, int64_t timespan, const ImVec2& wpos, float w )
{
if( !IsMouseDown( 0 ) ) range.modMin = range.modMax = false;
if( !IsMouseDown( ImGuiMouseButton_Left ) ) range.modMin = range.modMax = false;
if( !range.active ) return;
auto& io = ImGui::GetIO();
@@ -142,7 +142,7 @@ void View::HandleRange( Range& range, int64_t timespan, const ImVec2& wpos, floa
const auto nspx = double( timespan ) / w;
range.min = m_vd.zvStart + ( io.MousePos.x - wpos.x ) * nspx;
range.hiMin = true;
ConsumeMouseEvents( 0 );
ConsumeMouseEvents( ImGuiMouseButton_Left );
ImGui::SetMouseCursor( ImGuiMouseCursor_ResizeEW );
if( range.min > range.max )
{
@@ -156,7 +156,7 @@ void View::HandleRange( Range& range, int64_t timespan, const ImVec2& wpos, floa
const auto nspx = double( timespan ) / w;
range.max = m_vd.zvStart + ( io.MousePos.x - wpos.x ) * nspx;
range.hiMax = true;
ConsumeMouseEvents( 0 );
ConsumeMouseEvents( ImGuiMouseButton_Left );
ImGui::SetMouseCursor( ImGuiMouseCursor_ResizeEW );
if( range.min > range.max )
{
@@ -173,11 +173,11 @@ void View::HandleRange( Range& range, int64_t timespan, const ImVec2& wpos, floa
{
range.hiMin = true;
ImGui::SetMouseCursor( ImGuiMouseCursor_ResizeEW );
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
range.modMin = true;
range.min = m_vd.zvStart + ( io.MousePos.x - wpos.x ) / pxns;
ConsumeMouseEvents( 0 );
ConsumeMouseEvents( ImGuiMouseButton_Left );
if( range.min > range.max )
{
std::swap( range.min, range.max );
@@ -193,11 +193,11 @@ void View::HandleRange( Range& range, int64_t timespan, const ImVec2& wpos, floa
{
range.hiMax = true;
ImGui::SetMouseCursor( ImGuiMouseCursor_ResizeEW );
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
range.modMax = true;
range.max = m_vd.zvStart + ( io.MousePos.x - wpos.x ) / pxns;
ConsumeMouseEvents( 0 );
ConsumeMouseEvents( ImGuiMouseButton_Left );
if( range.min > range.max )
{
std::swap( range.min, range.max );
+2 -2
View File
@@ -53,7 +53,7 @@ void View::DrawSampleList( const TimelineContext& ctx, const std::vector<Samples
TextFocused( "Number of samples:", RealToString( v.num + 1 ) );
ImGui::EndTooltip();
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToRange( t0, t1 );
}
@@ -73,7 +73,7 @@ void View::DrawSampleList( const TimelineContext& ctx, const std::vector<Samples
{
tooltipDisplayed = true;
CallstackTooltip( it->callstack.Val() );
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_callstackView = {
.id = it->callstack.Val(),
+10 -10
View File
@@ -23,16 +23,16 @@ void View::HandleTimelineMouse( int64_t timespan, const ImVec2& wpos, float w )
const auto nspx = double( timespan ) / w;
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_highlight.active = true;
m_highlight.start = m_highlight.end = m_vd.zvStart + ( io.MousePos.x - wpos.x ) * nspx;
}
else if( IsMouseDragging( 0 ) )
else if( IsMouseDragging( ImGuiMouseButton_Left ) )
{
m_highlight.end = m_vd.zvStart + ( io.MousePos.x - wpos.x ) * nspx;
}
else if( m_highlight.active && !IsMouseDown( 0 ) )
else if( m_highlight.active && !IsMouseDown( ImGuiMouseButton_Left ) )
{
if( ImGui::GetIO().KeyCtrl && m_highlight.start != m_highlight.end )
{
@@ -41,16 +41,16 @@ void View::HandleTimelineMouse( int64_t timespan, const ImVec2& wpos, float w )
m_highlight.active = false;
}
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
m_highlightZoom.active = true;
m_highlightZoom.start = m_highlightZoom.end = m_vd.zvStart + ( io.MousePos.x - wpos.x ) * nspx;
}
else if( IsMouseDragging( 2 ) )
else if( IsMouseDragging( ImGuiMouseButton_Middle ) )
{
m_highlightZoom.end = m_vd.zvStart + ( io.MousePos.x - wpos.x ) * nspx;
}
else if( m_highlightZoom.active && !IsMouseDown( 2 ) )
else if( m_highlightZoom.active && !IsMouseDown( ImGuiMouseButton_Middle ) )
{
if( m_highlightZoom.start != m_highlightZoom.end )
{
@@ -88,13 +88,13 @@ void View::HandleTimelineMouse( int64_t timespan, const ImVec2& wpos, float w )
}
const bool wheel_scroll = abs( io.MouseWheelH ) > abs( io.MouseWheel );
if( IsMouseDragging( 1 ) || wheel_scroll )
if( IsMouseDragging( ImGuiMouseButton_Right ) || wheel_scroll )
{
m_viewMode = ViewMode::Paused;
m_viewModeHeuristicTry = false;
m_zoomAnim.active = false;
if( !m_playback.pause && m_playback.sync ) m_playback.pause = true;
const auto delta = GetMouseDragDelta( 1 );
const auto delta = GetMouseDragDelta( ImGuiMouseButton_Right );
m_yDelta = delta.y;
const auto hwheel_delta = io.MouseWheelH * 50.f * m_horizontalScrollMultiplier;
const auto dpx = int64_t( (delta.x * nspx) + (hwheel_delta * nspx));
@@ -292,7 +292,7 @@ void View::DrawTimeline()
v->range.StartFrame();
HandleRange( v->range, timespan, ImGui::GetCursorScreenPos(), w );
}
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
const auto ty = ImGui::GetTextLineHeight();
for( auto& ann : m_annotations )
@@ -303,7 +303,7 @@ void View::DrawTimeline()
if( ImGui::IsMouseHoveringRect( linepos + ImVec2( aMin, lineh - ty * 1.5f ), linepos + ImVec2( aMax, lineh ) ) )
{
m_selectedAnnotation = ann.get();
ConsumeMouseEvents( 0 );
ConsumeMouseEvents( ImGuiMouseButton_Left );
break;
}
}
+8 -8
View File
@@ -925,7 +925,7 @@ void View::DrawZoneInfoWindow()
if( hover )
{
m_zoneHighlight = v;
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToZone( *v );
}
@@ -1185,7 +1185,7 @@ void View::DrawZoneInfoChildren( const V& children, int64_t ztime )
if( ImGui::IsItemHovered() )
{
m_zoneHighlight = &cev;
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToZone( cev );
}
@@ -1254,7 +1254,7 @@ void View::DrawZoneInfoChildren( const V& children, int64_t ztime )
if( ImGui::IsItemHovered() )
{
m_zoneHighlight = &cev;
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToZone( cev );
}
@@ -1320,7 +1320,7 @@ void View::DrawZoneInfoChildren( const V& children, int64_t ztime )
if( ImGui::IsItemHovered() )
{
m_zoneHighlight = &cev;
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToZone( cev );
}
@@ -1533,7 +1533,7 @@ void View::DrawGpuInfoWindow()
if( hover )
{
m_gpuHighlight = v;
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToZone( *v );
}
@@ -1659,7 +1659,7 @@ void View::DrawGpuInfoChildren( const V& children, int64_t ztime )
if( ImGui::IsItemHovered() )
{
m_gpuHighlight = &cev;
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToZone( cev );
}
@@ -1722,7 +1722,7 @@ void View::DrawGpuInfoChildren( const V& children, int64_t ztime )
if( ImGui::IsItemHovered() )
{
m_gpuHighlight = &cev;
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToZone( cev );
}
@@ -1778,7 +1778,7 @@ void View::DrawGpuInfoChildren( const V& children, int64_t ztime )
if( ImGui::IsItemHovered() )
{
m_gpuHighlight = &cev;
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToZone( cev );
}
@@ -161,12 +161,12 @@ void View::DrawThreadMessagesList( const TimelineContext& ctx, const std::vector
ImGui::EndTooltip();
m_msgHighlight = &msg;
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_showMessages = true;
m_msgToFocus = &msg;
}
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
CenterAtTime( msg.time );
}
@@ -188,14 +188,14 @@ void View::DrawThreadMessagesList( const TimelineContext& ctx, const std::vector
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( px - (ty - to) * 0.5 - 1, offset ), wpos + ImVec2( px + (ty - to) * 0.5 + 1, offset + ty ) ) )
{
CrashTooltip();
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
m_callstackView = {
.id = crash.callstack,
.thread = crash.thread
};
}
if( IsMouseClicked( 2 ) )
if( IsMouseClicked( ImGuiMouseButton_Middle ) )
{
CenterAtTime( crash.time );
}
@@ -297,7 +297,7 @@ void View::DrawZoneList( const TimelineContext& ctx, const std::vector<TimelineD
DrawZigZag( draw, wpos + ImVec2( 0, offset + ty/2 ), std::max( px0, -10.0 ), std::min( std::max( px1, px0+MinVisSize ), double( w + 10 ) ), ty/4, DarkenColor( color ) );
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( std::max( px0, -10.0 ), offset ), wpos + ImVec2( std::min( std::max( px1, px0+MinVisSize ), double( w + 10 ) ), offset + ty + 1 ) ) )
{
if( IsMouseClickReleased( 1 ) ) m_setRangePopup = RangeSlim { ev.Start(), rend, true };
if( IsMouseClickReleased( ImGuiMouseButton_Right ) ) m_setRangePopup = RangeSlim { ev.Start(), rend, true };
if( v.num > 1 )
{
ImGui::BeginTooltip();
@@ -306,7 +306,7 @@ void View::DrawZoneList( const TimelineContext& ctx, const std::vector<TimelineD
TextFocused( "Execution time:", TimeToString( rend - ev.Start() ) );
ImGui::EndTooltip();
if( IsMouseClicked( 2 ) && rend - ev.Start() > 0 )
if( IsMouseClicked( ImGuiMouseButton_Middle ) && rend - ev.Start() > 0 )
{
ZoomToRange( ev.Start(), rend );
}
@@ -315,11 +315,11 @@ void View::DrawZoneList( const TimelineContext& ctx, const std::vector<TimelineD
{
ZoneTooltip( ev );
if( IsMouseClicked( 2 ) && rend - ev.Start() > 0 )
if( IsMouseClicked( ImGuiMouseButton_Middle ) && rend - ev.Start() > 0 )
{
ZoomToZone( ev );
}
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
if( ImGui::GetIO().KeyCtrl )
{
@@ -388,13 +388,13 @@ void View::DrawZoneList( const TimelineContext& ctx, const std::vector<TimelineD
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y + 1 ) ) )
{
ZoneTooltip( ev );
if( IsMouseClickReleased( 1 ) ) m_setRangePopup = RangeSlim { ev.Start(), m_worker.GetZoneEnd( ev ), true };
if( IsMouseClickReleased( ImGuiMouseButton_Right ) ) m_setRangePopup = RangeSlim { ev.Start(), m_worker.GetZoneEnd( ev ), true };
if( !m_zoomAnim.active && IsMouseClicked( 2 ) )
if( !m_zoomAnim.active && IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToZone( ev );
}
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
if( ImGui::GetIO().KeyCtrl )
{
@@ -423,14 +423,14 @@ void View::DrawZoneList( const TimelineContext& ctx, const std::vector<TimelineD
DrawZigZag( draw, wpos + ImVec2( 0, offset + ty/2 ), std::max( px0, -10.0 ), std::min( std::max( px1, px0+MinVisSize ), double( w + 10 ) ), ty/4, DarkenColor( color ) );
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( std::max( px0, -10.0 ), offset ), wpos + ImVec2( std::min( std::max( px1, px0+MinVisSize ), double( w + 10 ) ), offset + ty + 1 ) ) )
{
if( IsMouseClickReleased( 1 ) ) m_setRangePopup = RangeSlim { ev.start.Val(), rend , true };
if( IsMouseClickReleased( ImGuiMouseButton_Right ) ) m_setRangePopup = RangeSlim { ev.start.Val(), rend , true };
ImGui::BeginTooltip();
ImGui::TextUnformatted( "Multiple ghost zones" );
ImGui::Separator();
TextFocused( "Execution time:", TimeToString( rend - ev.start.Val() ) );
ImGui::EndTooltip();
if( IsMouseClicked( 2 ) && rend - ev.start.Val() > 0 )
if( IsMouseClicked( ImGuiMouseButton_Middle ) && rend - ev.start.Val() > 0 )
{
ZoomToRange( ev.start.Val(), rend );
}
@@ -485,7 +485,7 @@ void View::DrawZoneList( const TimelineContext& ctx, const std::vector<TimelineD
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y + 1 ) ) )
{
if( IsMouseClickReleased( 1 ) ) m_setRangePopup = RangeSlim { ev.start.Val(), ev.end.Val() , true };
if( IsMouseClickReleased( ImGuiMouseButton_Right ) ) m_setRangePopup = RangeSlim { ev.start.Val(), ev.end.Val() , true };
ImGui::BeginTooltip();
TextDisabledUnformatted( ICON_FA_GHOST " Ghost zone" );
ImGui::Separator();
@@ -501,7 +501,7 @@ void View::DrawZoneList( const TimelineContext& ctx, const std::vector<TimelineD
ImGui::Separator();
TextFocused( "Execution time:", TimeToString( ev.end.Val() - ev.start.Val() ) );
ImGui::EndTooltip();
if( !m_zoomAnim.active && IsMouseClicked( 2 ) )
if( !m_zoomAnim.active && IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToRange( ev.start.Val(), ev.end.Val() );
}
@@ -544,7 +544,7 @@ void View::DrawZoneList( const TimelineContext& ctx, const std::vector<TimelineD
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y + 1 ) ) )
{
if( IsMouseClickReleased( 1 ) ) m_setRangePopup = RangeSlim { ev.start.Val(), ev.end.Val(), true };
if( IsMouseClickReleased( ImGuiMouseButton_Right ) ) m_setRangePopup = RangeSlim { ev.start.Val(), ev.end.Val(), true };
ImGui::BeginTooltip();
TextDisabledUnformatted( ICON_FA_GHOST " Ghost zone" );
if( sym.symAddr >> 63 != 0 )
@@ -587,11 +587,11 @@ void View::DrawZoneList( const TimelineContext& ctx, const std::vector<TimelineD
TextFocused( "Execution time:", TimeToString( ev.end.Val() - ev.start.Val() ) );
ImGui::EndTooltip();
if( IsMouseClicked( 0 ) )
if( IsMouseClicked( ImGuiMouseButton_Left ) )
{
ViewDispatch( file, line, sym.symAddr );
}
else if( !m_zoomAnim.active && IsMouseClicked( 2 ) )
else if( !m_zoomAnim.active && IsMouseClicked( ImGuiMouseButton_Middle ) )
{
ZoomToRange( ev.start.Val(), ev.end.Val() );
}
@@ -609,7 +609,7 @@ void View::DrawZoneList( const TimelineContext& ctx, const std::vector<TimelineD
void View::DrawThreadCropper( const int depth, const uint64_t tid, const float xPos, const float yPos, const float ostep, const float cropperWidth, const bool hasCtxSwitches )
{
const ImVec2 mousePos = ImGui::GetMousePos();
const bool clicked = ImGui::IsMouseClicked( 0 );
const bool clicked = ImGui::IsMouseClicked( ImGuiMouseButton_Left );
auto draw = ImGui::GetWindowDrawList();
bool isCropped = ( m_threadDepthLimit.find( tid ) != m_threadDepthLimit.end() );
const int depthLimit = isCropped ? m_threadDepthLimit[tid] : depth;