mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
React to enter key in "go to frame" dialog.
This commit is contained in:
parent
258cf38d64
commit
1024992493
@ -10024,14 +10024,16 @@ void View::DrawGoToFrame()
|
|||||||
const auto numFrames = mainFrameSet ? m_frames->frames.size() - 1 : m_frames->frames.size();
|
const auto numFrames = mainFrameSet ? m_frames->frames.size() - 1 : m_frames->frames.size();
|
||||||
const auto frameOffset = mainFrameSet ? 0 : 1;
|
const auto frameOffset = mainFrameSet ? 0 : 1;
|
||||||
|
|
||||||
|
bool goClicked = false;
|
||||||
ImGui::Begin( "Go to frame", &m_goToFrame, ImGuiWindowFlags_AlwaysAutoResize );
|
ImGui::Begin( "Go to frame", &m_goToFrame, ImGuiWindowFlags_AlwaysAutoResize );
|
||||||
ImGui::InputInt( "Frame", &frameNum );
|
goClicked |= ImGui::InputInt( "Frame", &frameNum, 1, 100, ImGuiInputTextFlags_EnterReturnsTrue );
|
||||||
frameNum = std::min( std::max( frameNum, 1 ), int( numFrames ) );
|
frameNum = std::min( std::max( frameNum, 1 ), int( numFrames ) );
|
||||||
#ifdef TRACY_EXTENDED_FONT
|
#ifdef TRACY_EXTENDED_FONT
|
||||||
if( ImGui::Button( ICON_FA_CROSSHAIRS " Go to" ) )
|
goClicked |= ImGui::Button( ICON_FA_CROSSHAIRS " Go to" );
|
||||||
#else
|
#else
|
||||||
if( ImGui::Button( "Go to" ) )
|
goClicked |= ImGui::Button( "Go to" );
|
||||||
#endif
|
#endif
|
||||||
|
if( goClicked )
|
||||||
{
|
{
|
||||||
ZoomToRange( m_worker.GetFrameBegin( *m_frames, frameNum - frameOffset ), m_worker.GetFrameEnd( *m_frames, frameNum - frameOffset ) );
|
ZoomToRange( m_worker.GetFrameBegin( *m_frames, frameNum - frameOffset ), m_worker.GetFrameEnd( *m_frames, frameNum - frameOffset ) );
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user