mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Add support for handling keyboard shortcuts.
This commit is contained in:
parent
4bb4a568ca
commit
2d143ce516
@ -482,6 +482,17 @@ bool View::DrawImpl()
|
||||
return !wasCancelled;
|
||||
}
|
||||
|
||||
const auto& io = ImGui::GetIO();
|
||||
|
||||
assert( m_shortcut == ShortcutAction::None );
|
||||
if( io.KeyCtrl )
|
||||
{
|
||||
if( ImGui::IsKeyPressed( 'F' ) )
|
||||
{
|
||||
m_shortcut = ShortcutAction::OpenFind;
|
||||
}
|
||||
}
|
||||
|
||||
if( !m_frames ) m_frames = m_worker.GetFramesBase();
|
||||
|
||||
const auto th = ImGui::GetTextLineHeight();
|
||||
@ -700,7 +711,6 @@ bool View::DrawImpl()
|
||||
if( m_goToFrame ) DrawGoToFrame();
|
||||
if( m_lockInfoWindow != InvalidId ) DrawLockInfoWindow();
|
||||
|
||||
const auto& io = ImGui::GetIO();
|
||||
if( m_zoomAnim.active )
|
||||
{
|
||||
m_zoomAnim.progress += io.DeltaTime * m_zoomAnim.lenMod;
|
||||
|
@ -64,6 +64,12 @@ private:
|
||||
Short
|
||||
};
|
||||
|
||||
enum class ShortcutAction : uint8_t
|
||||
{
|
||||
None,
|
||||
OpenFind
|
||||
};
|
||||
|
||||
enum { InvalidId = 0xFFFFFFFF };
|
||||
|
||||
void InitTextEditor();
|
||||
@ -256,6 +262,7 @@ private:
|
||||
bool m_showCallstackFrameAddress = false;
|
||||
bool m_showUnknownFrames = true;
|
||||
|
||||
ShortcutAction m_shortcut = ShortcutAction::None;
|
||||
Namespace m_namespace = Namespace::Full;
|
||||
Animation m_zoomAnim;
|
||||
BuzzAnim<int> m_callstackBuzzAnim;
|
||||
|
Loading…
Reference in New Issue
Block a user