Display complementary assembly address tooltips.

This commit is contained in:
Bartosz Taudul 2021-04-29 20:33:10 +02:00
parent 854439cdb1
commit de5f258b03
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -2723,13 +2723,42 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
{
TextDisabledUnformatted( buf );
}
if( ImGui::IsItemClicked( 0 ) )
if( ImGui::IsItemHovered() )
{
m_asmCountBase = asmIdx;
}
else if( ImGui::IsItemClicked( 1 ) )
{
m_asmCountBase = -1;
if( m_font ) ImGui::PopFont();
ImGui::BeginTooltip();
if( m_asmCountBase >= 0 )
{
TextDisabledUnformatted( "Absolute address:" );
ImGui::SameLine();
ImGui::Text( "%" PRIx64, line.addr );
TextDisabledUnformatted( "Relative address:" );
ImGui::SameLine();
ImGui::Text( "+%" PRIx64, line.addr - m_baseAddr );
}
else if( m_asmRelative )
{
TextDisabledUnformatted( "Absolute address:" );
ImGui::SameLine();
ImGui::Text( "%" PRIx64, line.addr );
}
else
{
TextDisabledUnformatted( "Relative address:" );
ImGui::SameLine();
ImGui::Text( "+%" PRIx64, line.addr - m_baseAddr );
}
ImGui::EndTooltip();
if( m_font ) ImGui::PushFont( m_font );
if( ImGui::IsItemClicked( 0 ) )
{
m_asmCountBase = asmIdx;
}
else if( ImGui::IsItemClicked( 1 ) )
{
m_asmCountBase = -1;
}
}
const auto stw = ImGui::CalcTextSize( " " ).x;