mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-14 04:01:48 +00:00
Add implementation of disablable button.
This commit is contained in:
parent
6de8e6987f
commit
fc7f77eb7a
@ -74,6 +74,21 @@ namespace tracy
|
|||||||
ImGui::PopStyleVar();
|
ImGui::PopStyleVar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool ButtonDisablable( const char* label, bool disabled )
|
||||||
|
{
|
||||||
|
if( disabled )
|
||||||
|
{
|
||||||
|
ImGui::PushStyleColor( ImGuiCol_Button, (ImVec4)ImColor( 0.3f, 0.3f, 0.3f, 1.0f ) );
|
||||||
|
ImGui::ButtonEx( label, ImVec2( 0, 0 ), ImGuiButtonFlags_Disabled );
|
||||||
|
ImGui::PopStyleColor( 1 );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ImGui::Button( label );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user