Add implementation of disablable button.

This commit is contained in:
Bartosz Taudul 2019-10-14 20:06:57 +02:00
parent 6de8e6987f
commit fc7f77eb7a

View File

@ -74,6 +74,21 @@ namespace tracy
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