mirror of
https://github.com/wolfpld/tracy
synced 2026-01-19 04:52:09 +00:00
Add in-line waiting dots drawer.
This commit is contained in:
@@ -133,6 +133,18 @@ static constexpr const uint32_t AsmSyntaxColors[] = {
|
||||
draw->AddCircleFilled( wpos + ImVec2( w * 0.5f + ty, h ), ty * ( 0.15f + 0.2f * ( pow( cos( time * 3.5f - 0.3f ), 16.f ) ) ), 0xFFBBBBBB, 12 );
|
||||
}
|
||||
|
||||
[[maybe_unused]] static inline void DrawWaitingDots( double time, bool windowPos = true )
|
||||
{
|
||||
s_wasActive = true;
|
||||
const auto pos = ( windowPos ? ImGui::GetWindowPos() : ImVec2( 0, 0 ) ) + ImGui::GetCursorPos();
|
||||
auto draw = ImGui::GetWindowDrawList();
|
||||
const auto ty = ImGui::GetTextLineHeight();
|
||||
draw->AddCircleFilled( pos + ImVec2( ty * 0.5f + 0 * ty, ty * 0.675f ), ty * ( 0.15f + 0.2f * ( pow( cos( time * 3.5f + 0.3f ), 16.f ) ) ), 0xFFBBBBBB, 12 );
|
||||
draw->AddCircleFilled( pos + ImVec2( ty * 0.5f + 1 * ty, ty * 0.675f ), ty * ( 0.15f + 0.2f * ( pow( cos( time * 3.5f ), 16.f ) ) ), 0xFFBBBBBB, 12 );
|
||||
draw->AddCircleFilled( pos + ImVec2( ty * 0.5f + 2 * ty, ty * 0.675f ), ty * ( 0.15f + 0.2f * ( pow( cos( time * 3.5f - 0.3f ), 16.f ) ) ), 0xFFBBBBBB, 12 );
|
||||
ImGui::Dummy( ImVec2( ty * 3, ty ) );
|
||||
}
|
||||
|
||||
[[maybe_unused]] static inline bool SmallCheckbox( const char* label, bool* var )
|
||||
{
|
||||
ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, ImVec2( 0, 0 ) );
|
||||
|
||||
@@ -582,13 +582,7 @@ void TracyLlm::Draw()
|
||||
if( ImGui::Button( ICON_FA_STOP " Stop" ) ) m_currentJob->stop = true;
|
||||
if( disabled ) ImGui::EndDisabled();
|
||||
ImGui::SameLine();
|
||||
const auto pos = ImGui::GetWindowPos() + ImGui::GetCursorPos();
|
||||
auto draw = ImGui::GetWindowDrawList();
|
||||
const auto ty = ImGui::GetTextLineHeight();
|
||||
draw->AddCircleFilled( pos + ImVec2( ty * 0.5f + 0 * ty, ty * 0.675f ), ty * ( 0.15f + 0.2f * ( pow( cos( s_time * 3.5f + 0.3f ), 16.f ) ) ), 0xFFBBBBBB, 12 );
|
||||
draw->AddCircleFilled( pos + ImVec2( ty * 0.5f + 1 * ty, ty * 0.675f ), ty * ( 0.15f + 0.2f * ( pow( cos( s_time * 3.5f ), 16.f ) ) ), 0xFFBBBBBB, 12 );
|
||||
draw->AddCircleFilled( pos + ImVec2( ty * 0.5f + 2 * ty, ty * 0.675f ), ty * ( 0.15f + 0.2f * ( pow( cos( s_time * 3.5f - 0.3f ), 16.f ) ) ), 0xFFBBBBBB, 12 );
|
||||
ImGui::Dummy( ImVec2( ty * 3, ty ) );
|
||||
DrawWaitingDots( s_time );
|
||||
ImGui::SameLine();
|
||||
if( disabled )
|
||||
{
|
||||
|
||||
@@ -227,12 +227,7 @@ void View::DrawNotificationArea()
|
||||
if( !m_worker.IsBackgroundDone() )
|
||||
{
|
||||
ImGui::SameLine();
|
||||
const auto pos = ImGui::GetCursorPos();
|
||||
auto draw = ImGui::GetWindowDrawList();
|
||||
draw->AddCircleFilled( pos + ImVec2( ty * 0.5f + 0 * ty, ty * 0.675f ), ty * ( 0.15f + 0.2f * ( pow( cos( s_time * 3.5f + 0.3f ), 16.f ) ) ), 0xFFBBBBBB, 12 );
|
||||
draw->AddCircleFilled( pos + ImVec2( ty * 0.5f + 1 * ty, ty * 0.675f ), ty * ( 0.15f + 0.2f * ( pow( cos( s_time * 3.5f ), 16.f ) ) ), 0xFFBBBBBB, 12 );
|
||||
draw->AddCircleFilled( pos + ImVec2( ty * 0.5f + 2 * ty, ty * 0.675f ), ty * ( 0.15f + 0.2f * ( pow( cos( s_time * 3.5f - 0.3f ), 16.f ) ) ), 0xFFBBBBBB, 12 );
|
||||
ImGui::Dummy( ImVec2( ty * 3, ty ) );
|
||||
DrawWaitingDots( s_time, false );
|
||||
auto rmin = ImGui::GetItemRectMin();
|
||||
const auto rmax = ImGui::GetItemRectMax();
|
||||
if( ImGui::IsMouseHoveringRect( rmin, rmax ) )
|
||||
|
||||
Reference in New Issue
Block a user