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:
parent
9e18db01c9
commit
c2485fbcb0
@ -269,7 +269,15 @@ static void TextFocused( const char* label, const char* value )
|
|||||||
|
|
||||||
static void ToggleButton( const char* label, bool& toggle )
|
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( ImGui::Button( label ) ) toggle = !toggle;
|
||||||
|
if( active ) ImGui::PopStyleColor( 3 );
|
||||||
}
|
}
|
||||||
|
|
||||||
enum { MinVisSize = 3 };
|
enum { MinVisSize = 3 };
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user