mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Don't print "connected to" after disconnection.
This commit is contained in:
parent
3fe4e7c3a7
commit
78fd523a4b
@ -1345,10 +1345,11 @@ bool View::DrawConnection()
|
|||||||
{
|
{
|
||||||
const auto ty = ImGui::GetFontSize();
|
const auto ty = ImGui::GetFontSize();
|
||||||
const auto cs = ty * 0.9f;
|
const auto cs = ty * 0.9f;
|
||||||
|
const auto isConnected = m_worker.IsConnected();
|
||||||
|
|
||||||
{
|
{
|
||||||
std::shared_lock<std::shared_mutex> lock( m_worker.GetMbpsDataLock() );
|
std::shared_lock<std::shared_mutex> lock( m_worker.GetMbpsDataLock() );
|
||||||
TextFocused( "Connected to:", m_worker.GetAddr().c_str() );
|
TextFocused( isConnected ? "Connected to:" : "Disconnected:", m_worker.GetAddr().c_str() );
|
||||||
const auto& mbpsVector = m_worker.GetMbpsData();
|
const auto& mbpsVector = m_worker.GetMbpsData();
|
||||||
const auto mbps = mbpsVector.back();
|
const auto mbps = mbpsVector.back();
|
||||||
char buf[64];
|
char buf[64];
|
||||||
@ -1375,7 +1376,7 @@ bool View::DrawConnection()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const auto wpos = ImGui::GetWindowPos() + ImGui::GetWindowContentRegionMin();
|
const auto wpos = ImGui::GetWindowPos() + ImGui::GetWindowContentRegionMin();
|
||||||
ImGui::GetWindowDrawList()->AddCircleFilled( wpos + ImVec2( 1 + cs * 0.5, 3 + ty * 1.75 ), cs * 0.5, m_worker.IsConnected() ? 0xFF2222CC : 0xFF444444, 10 );
|
ImGui::GetWindowDrawList()->AddCircleFilled( wpos + ImVec2( 1 + cs * 0.5, 3 + ty * 1.75 ), cs * 0.5, isConnected ? 0xFF2222CC : 0xFF444444, 10 );
|
||||||
|
|
||||||
{
|
{
|
||||||
std::shared_lock<std::shared_mutex> lock( m_worker.GetDataLock() );
|
std::shared_lock<std::shared_mutex> lock( m_worker.GetDataLock() );
|
||||||
|
Loading…
Reference in New Issue
Block a user