mirror of
https://github.com/wolfpld/tracy.git
synced 2026-10-30 04:25:27 +00:00
Constrain callstack window size.
This commit is contained in:
@@ -1538,6 +1538,7 @@ void View::DpiScaleChanged()
|
||||
m_waitStacksConstraint.Reset();
|
||||
m_frameStatsConstraint.Reset();
|
||||
m_sampleEntryConstraint.Reset();
|
||||
m_callstackConstraint.Reset();
|
||||
}
|
||||
|
||||
void View::AddLlmAttachment( const nlohmann::json& json )
|
||||
|
||||
@@ -86,6 +86,7 @@ struct CallstackTableParams
|
||||
bool showThread = false;
|
||||
bool hasCrashed = false;
|
||||
int64_t callstack = -1;
|
||||
WindowConstraints* constraints = nullptr;
|
||||
};
|
||||
|
||||
|
||||
@@ -1103,6 +1104,7 @@ private:
|
||||
WindowConstraints m_waitStacksConstraint;
|
||||
WindowConstraints m_frameStatsConstraint;
|
||||
WindowConstraints m_sampleEntryConstraint;
|
||||
WindowConstraints m_callstackConstraint;
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
TracyLlm m_llm;
|
||||
|
||||
@@ -21,6 +21,7 @@ void View::DrawCallstackWindow()
|
||||
bool show = true;
|
||||
const auto scale = GetScale();
|
||||
ImGui::SetNextWindowSize( ImVec2( 1400 * scale, 500 * scale ), ImGuiCond_FirstUseEver );
|
||||
m_callstackConstraint.Constrain();
|
||||
ImGui::Begin( "Call stack", &show, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse );
|
||||
if( !ImGui::GetCurrentWindowRead()->SkipItems )
|
||||
{
|
||||
@@ -29,6 +30,7 @@ void View::DrawCallstackWindow()
|
||||
.wait = m_callstackView.wait,
|
||||
.entryStacks = true,
|
||||
.showThread = true,
|
||||
.constraints = &m_callstackConstraint
|
||||
} );
|
||||
}
|
||||
ImGui::End();
|
||||
@@ -47,6 +49,7 @@ void View::DrawCallstackTable( uint32_t callstack, const CallstackTableParams& p
|
||||
.showThread = params.showThread,
|
||||
.hasCrashed = crash.thread != 0 && crash.callstack == callstack,
|
||||
.callstack = callstack,
|
||||
.constraints = params.constraints
|
||||
} );
|
||||
}
|
||||
|
||||
@@ -387,6 +390,7 @@ void View::DrawCallstackTable( const CallstackFrameId* data, size_t size, const
|
||||
TextColoredUnformatted( ImVec4( 0.2f, 0.6f, 0.2f, 1.f ), "Fiber" );
|
||||
}
|
||||
}
|
||||
if( params.constraints ) params.constraints->MarkMinWidth();
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
if( s_config.llm && params.callstack >= 0 )
|
||||
|
||||
Reference in New Issue
Block a user