Open context menus without ctrl key.

This commit is contained in:
Bartosz Taudul 2020-08-01 12:35:30 +02:00
parent b4021d7d79
commit b33445c073

View File

@ -1415,7 +1415,7 @@ void View::DrawFrames()
ImGui::SameLine();
ImGui::TextDisabled( "(%.1f FPS)", 1000000000.0 / f );
if( ImGui::GetIO().KeyCtrl && IsMouseClicked( 1 ) ) m_setRangePopup = RangeSlim { m_worker.GetFrameTime( *m_frames, sel ), m_worker.GetFrameTime( *m_frames, sel + g - 1 ), true };
if( IsMouseClickReleased( 1 ) ) m_setRangePopup = RangeSlim { m_worker.GetFrameTime( *m_frames, sel ), m_worker.GetFrameTime( *m_frames, sel + g - 1 ), true };
}
else
{
@ -1521,7 +1521,7 @@ void View::DrawFrames()
}
}
if( io.KeyCtrl && IsMouseClicked( 1 ) ) m_setRangePopup = RangeSlim { m_worker.GetFrameBegin( *m_frames, sel ), m_worker.GetFrameEnd( *m_frames, sel + group - 1 ), true };
if( IsMouseClickReleased( 1 ) ) m_setRangePopup = RangeSlim { m_worker.GetFrameBegin( *m_frames, sel ), m_worker.GetFrameEnd( *m_frames, sel + group - 1 ), true };
}
if( m_pause && wheel != 0 )
@ -2184,7 +2184,7 @@ void View::DrawZoneFrames( const FrameData& frames )
if( ImGui::IsMouseHoveringRect( wpos + ImVec2( x0, 0 ), wpos + ImVec2( x1, ty ) ) )
{
tooltipDisplayed = true;
if( ImGui::GetIO().KeyCtrl && IsMouseClicked( 1 ) ) m_setRangePopup = RangeSlim { fbegin, fend, true };
if( IsMouseClickReleased( 1 ) ) m_setRangePopup = RangeSlim { fbegin, fend, true };
ImGui::BeginTooltip();
ImGui::TextUnformatted( GetFrameText( frames, i, ftime, m_worker.GetFrameOffset() ) );
@ -3980,7 +3980,7 @@ int View::DrawZoneLevel( const V& vec, bool hover, double pxns, int64_t nspx, co
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 ) ) )
{
if( ImGui::GetIO().KeyCtrl && IsMouseClicked( 1 ) ) m_setRangePopup = RangeSlim { ev.Start(), rend, true };
if( IsMouseClickReleased( 1 ) ) m_setRangePopup = RangeSlim { ev.Start(), rend, true };
if( num > 1 )
{
ImGui::BeginTooltip();
@ -4116,7 +4116,7 @@ int View::DrawZoneLevel( const V& vec, bool hover, double pxns, int64_t nspx, co
if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( px0, offset ), wpos + ImVec2( px1, offset + tsz.y ) ) )
{
ZoneTooltip( ev );
if( ImGui::GetIO().KeyCtrl && IsMouseClicked( 1 ) ) m_setRangePopup = RangeSlim { ev.Start(), m_worker.GetZoneEnd( ev ), true };
if( IsMouseClickReleased( 1 ) ) m_setRangePopup = RangeSlim { ev.Start(), m_worker.GetZoneEnd( ev ), true };
if( !m_zoomAnim.active && IsMouseClicked( 2 ) )
{