Adding a copy button to the source view.

This commit is contained in:
Ben Vanik
2024-03-13 09:35:16 -07:00
parent f1998292a4
commit 605cdcb5d5
4 changed files with 16 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
#include <ctype.h>
#include <inttypes.h>
#include <sstream>
#include <stdio.h>
#include <capstone.h>
@@ -1058,6 +1059,17 @@ void SourceView::Render( Worker& worker, View& view )
if( m_symAddr == 0 )
{
ImGui::PushFont( m_bigFont );
if( ClipboardButton() )
{
std::ostringstream stream;
stream.write( m_source.data(), m_source.data_size() );
ImGui::SetClipboardText( stream.str().c_str() );
}
ImGui::PopFont();
ImGui::SameLine();
ImGui::Spacing();
ImGui::SameLine();
if( m_source.filename() )
{
ImGui::PushFont( m_bigFont );