1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Add visual notification of an active toggle.

This commit is contained in:
Bartosz Taudul 2018-12-18 16:22:12 +01:00
parent 9e18db01c9
commit c2485fbcb0

View File

@ -269,7 +269,15 @@ static void TextFocused( const char* label, const char* value )
static void ToggleButton( const char* label, bool& toggle )
{
const auto active = toggle;
if( active )
{
ImGui::PushStyleColor( ImGuiCol_Button, (ImVec4)ImColor::HSV( 0.45f, 0.6f, 0.6f ) );
ImGui::PushStyleColor( ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV( 0.45f, 0.7f, 0.7f ) );
ImGui::PushStyleColor( ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV( 0.45f, 0.8f, 0.8f ) );
}
if( ImGui::Button( label ) ) toggle = !toggle;
if( active ) ImGui::PopStyleColor( 3 );
}
enum { MinVisSize = 3 };