diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp index 1018150a..0b27109a 100644 --- a/profiler/src/main.cpp +++ b/profiler/src/main.cpp @@ -237,6 +237,7 @@ int main( int argc, char** argv ) io.Fonts->AddFontFromMemoryCompressedTTF( tracy::FontAwesomeSolid_compressed_data, tracy::FontAwesomeSolid_compressed_size, 14.0f * dpiScale, &configMerge, rangesIcons ); auto fixedWidth = io.Fonts->AddFontFromMemoryCompressedTTF( tracy::Cousine_compressed_data, tracy::Cousine_compressed_size, 15.0f * dpiScale ); auto bigFont = io.Fonts->AddFontFromMemoryCompressedTTF( tracy::Arimo_compressed_data, tracy::Cousine_compressed_size, 20.0f * dpiScale ); + auto smallFont = io.Fonts->AddFontFromMemoryCompressedTTF( tracy::Arimo_compressed_data, tracy::Cousine_compressed_size, 10.0f * dpiScale ); ImGuiFreeType::BuildFontAtlas( io.Fonts, ImGuiFreeType::LightHinting ); @@ -456,7 +457,7 @@ int main( int argc, char** argv ) } connHistVec = RebuildConnectionHistory( connHistMap ); - view = std::make_unique( addr, fixedWidth, bigFont, SetWindowTitleCallback ); + view = std::make_unique( addr, fixedWidth, smallFont, bigFont, SetWindowTitleCallback ); } ImGui::SameLine( 0, ImGui::GetFontSize() * 2 ); if( ImGui::Button( ICON_FA_FOLDER_OPEN " Open saved trace" ) && !loadThread.joinable() ) @@ -470,10 +471,10 @@ int main( int argc, char** argv ) auto f = std::shared_ptr( tracy::FileRead::Open( fn ) ); if( f ) { - loadThread = std::thread( [&view, f, &badVer, fixedWidth, bigFont] { + loadThread = std::thread( [&view, f, &badVer, fixedWidth, smallFont, bigFont] { try { - view = std::make_unique( *f, fixedWidth, bigFont, SetWindowTitleCallback ); + view = std::make_unique( *f, fixedWidth, smallFont, bigFont, SetWindowTitleCallback ); } catch( const tracy::UnsupportedVersion& e ) { @@ -527,7 +528,7 @@ int main( int argc, char** argv ) if( badProto ) flags |= ImGuiSelectableFlags_Disabled; if( ImGui::Selectable( name->second.c_str(), &sel, flags ) && !loadThread.joinable() ) { - view = std::make_unique( v.second.address.c_str(), fixedWidth, bigFont, SetWindowTitleCallback ); + view = std::make_unique( v.second.address.c_str(), fixedWidth, smallFont, bigFont, SetWindowTitleCallback ); } ImGui::NextColumn(); const auto acttime = ( v.second.activeTime + ( time - v.second.time ) / 1000 ) * 1000000000ll; diff --git a/server/TracyView.cpp b/server/TracyView.cpp index e60a594a..3c7b9d74 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -110,13 +110,14 @@ enum { MinFrameSize = 5 }; static View* s_instance = nullptr; -View::View( const char* addr, ImFont* fixedWidth, ImFont* bigFont, SetTitleCallback stcb ) +View::View( const char* addr, ImFont* fixedWidth, ImFont* smallFont, ImFont* bigFont, SetTitleCallback stcb ) : m_worker( addr ) , m_staticView( false ) , m_pause( false ) , m_frames( nullptr ) , m_messagesScrollBottom( true ) , m_textEditorFont( fixedWidth ) + , m_smallFont( smallFont ) , m_bigFont( bigFont ) , m_stcb( stcb ) , m_userData() @@ -127,13 +128,14 @@ View::View( const char* addr, ImFont* fixedWidth, ImFont* bigFont, SetTitleCallb InitTextEditor(); } -View::View( FileRead& f, ImFont* fixedWidth, ImFont* bigFont, SetTitleCallback stcb ) +View::View( FileRead& f, ImFont* fixedWidth, ImFont* smallFont, ImFont* bigFont, SetTitleCallback stcb ) : m_worker( f ) , m_staticView( true ) , m_pause( true ) , m_frames( m_worker.GetFramesBase() ) , m_messagesScrollBottom( false ) , m_textEditorFont( fixedWidth ) + , m_smallFont( smallFont ) , m_bigFont( bigFont ) , m_stcb( stcb ) , m_userData( m_worker.GetCaptureProgram().c_str(), m_worker.GetCaptureTime() ) diff --git a/server/TracyView.hpp b/server/TracyView.hpp index f7bf25ea..4cde43c2 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -62,9 +62,9 @@ public: using SetTitleCallback = void(*)( const char* ); - View( ImFont* fixedWidth = nullptr, ImFont* bigFont = nullptr, SetTitleCallback stcb = nullptr ) : View( "127.0.0.1", fixedWidth, bigFont, stcb ) {} - View( const char* addr, ImFont* fixedWidth = nullptr, ImFont* bigFont = nullptr, SetTitleCallback stcb = nullptr ); - View( FileRead& f, ImFont* fixedWidth = nullptr, ImFont* bigFont = nullptr, SetTitleCallback stcb = nullptr ); + View( ImFont* fixedWidth = nullptr, ImFont* smallFont = nullptr, ImFont* bigFont = nullptr, SetTitleCallback stcb = nullptr ) : View( "127.0.0.1", fixedWidth, smallFont, bigFont, stcb ) {} + View( const char* addr, ImFont* fixedWidth = nullptr, ImFont* smallFont = nullptr, ImFont* bigFont = nullptr, SetTitleCallback stcb = nullptr ); + View( FileRead& f, ImFont* fixedWidth = nullptr, ImFont* smallFont = nullptr, ImFont* bigFont = nullptr, SetTitleCallback stcb = nullptr ); ~View(); static bool Draw(); @@ -321,6 +321,7 @@ private: ImFont* m_textEditorFont; bool m_textEditorWhitespace = true; + ImFont* m_smallFont; ImFont* m_bigFont; float m_rootWidth, m_rootHeight;