diff --git a/server/TracyImGui.hpp b/server/TracyImGui.hpp index f8b1a6b3..bcbf34b7 100644 --- a/server/TracyImGui.hpp +++ b/server/TracyImGui.hpp @@ -117,6 +117,16 @@ namespace tracy if( active ) ImGui::PopStyleColor( 3 ); } + static void SmallToggleButton( const char* label, bool& toggle ) + { + const auto active = toggle; + if( active ) SetButtonHighlightColor(); + ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 0, 0 ) ); + if( ImGui::Button( label ) ) toggle = !toggle; + ImGui::PopStyleVar( 1 ); + if( active ) ImGui::PopStyleColor( 3 ); + } + } #endif