Small toggle button.

This commit is contained in:
Bartosz Taudul 2020-05-03 20:49:21 +02:00
parent bb39913339
commit 74e55f584c

View File

@ -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