mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +00:00
Don't show image tooltip, if there's no shortening and it fits the space.
This commit is contained in:
parent
cfc67727a0
commit
526e41b5dc
@ -524,11 +524,14 @@ void View::DrawSamplesStatistics( Vector<SymList>& data, int64_t timeRange, Accu
|
|||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
if( m_shortImageNames )
|
if( m_shortImageNames )
|
||||||
{
|
{
|
||||||
const char* end = imageName + strlen( imageName ) - 1;
|
const char* end = imageName + strlen( imageName );
|
||||||
while( end > imageName && *end != '/' && *end != '\\' ) end--;
|
const char* ptr = end - 1;
|
||||||
if( *end == '/' || *end == '\\' ) end++;
|
while( ptr > imageName && *ptr != '/' && *ptr != '\\' ) ptr--;
|
||||||
TextDisabledUnformatted( end );
|
if( *ptr == '/' || *ptr == '\\' ) ptr++;
|
||||||
TooltipIfHovered( imageName );
|
const auto cw = ImGui::GetContentRegionAvail().x;
|
||||||
|
const auto tw = ImGui::CalcTextSize( imageName, end ).x;
|
||||||
|
TextDisabledUnformatted( ptr );
|
||||||
|
if( ptr != imageName || tw > cw ) TooltipIfHovered( imageName );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user