mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Small toggle button.
This commit is contained in:
parent
bb39913339
commit
74e55f584c
@ -117,6 +117,16 @@ namespace tracy
|
||||
if( active ) ImGui::PopStyleColor( 3 );
|
||||
}
|
||||
|
||||
static void SmallToggleButton( const char* label, bool& toggle )
|
||||
{
|
||||
const auto active = toggle;
|
||||
if( active ) SetButtonHighlightColor();
|
||||
ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 0, 0 ) );
|
||||
if( ImGui::Button( label ) ) toggle = !toggle;
|
||||
ImGui::PopStyleVar( 1 );
|
||||
if( active ) ImGui::PopStyleColor( 3 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user