mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Add centered button function.
This commit is contained in:
parent
05d00388ed
commit
293c76625c
@ -83,6 +83,13 @@ static constexpr const uint32_t AsmSyntaxColors[] = {
|
||||
ImGui::TextUnformatted( text );
|
||||
}
|
||||
|
||||
[[maybe_unused]] static inline bool ButtonCentered( const char* text )
|
||||
{
|
||||
const auto tw = ImGui::CalcTextSize( text ).x + ImGui::GetStyle().FramePadding.x * 2;
|
||||
ImGui::SetCursorPosX( ( ImGui::GetWindowWidth() - tw ) * 0.5f );
|
||||
return ImGui::Button( text );
|
||||
}
|
||||
|
||||
[[maybe_unused]] static inline void TextColoredUnformatted( uint32_t col, const char* text, const char* end = nullptr )
|
||||
{
|
||||
ImGui::PushStyleColor( ImGuiCol_Text, col );
|
||||
|
Loading…
Reference in New Issue
Block a user