Disable wrapping of message lines in zone info window.

This unifies the behavior with message list in messages window.
This commit is contained in:
Bartosz Taudul 2024-10-04 22:47:25 +02:00
parent 471ed0ef65
commit 384646b03b
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -971,7 +971,19 @@ void View::DrawZoneInfoWindow()
ImGui::PopID();
ImGui::TableNextColumn();
ImGui::PushStyleColor( ImGuiCol_Text, (*msgit)->color );
ImGui::TextWrapped( "%s", m_worker.GetString( (*msgit)->ref ) );
const auto text = m_worker.GetString( (*msgit)->ref );
auto tend = text;
while( *tend != '\0' && *tend != '\n' ) tend++;
const auto cw = ImGui::GetContentRegionAvail().x;
const auto tw = ImGui::CalcTextSize( text, tend ).x;
ImGui::TextUnformatted( text, tend );
if( tw > cw && ImGui::IsItemHovered() )
{
ImGui::SetNextWindowSize( ImVec2( 1000 * GetScale(), 0 ) );
ImGui::BeginTooltip();
ImGui::TextWrapped( "%s", text );
ImGui::EndTooltip();
}
ImGui::PopStyleColor();
}
while( ++msgit != msgend );