mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Use big icons in bad version dialogs.
This commit is contained in:
parent
46e0584cca
commit
be264896f0
@ -787,7 +787,7 @@ static void DrawContents()
|
||||
if( badVer.state != tracy::BadVersionState::Ok )
|
||||
{
|
||||
if( loadThread.joinable() ) { loadThread.join(); }
|
||||
tracy::BadVersion( badVer );
|
||||
tracy::BadVersion( badVer, bigFont );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -11,7 +11,7 @@ namespace tracy
|
||||
namespace detail
|
||||
{
|
||||
|
||||
void BadVersionImpl( BadVersionState& badVer )
|
||||
void BadVersionImpl( BadVersionState& badVer, ImFont* big )
|
||||
{
|
||||
assert( badVer.state != BadVersionState::Ok );
|
||||
|
||||
@ -35,7 +35,9 @@ void BadVersionImpl( BadVersionState& badVer )
|
||||
}
|
||||
if( ImGui::BeginPopupModal( "Bad file", nullptr, ImGuiWindowFlags_AlwaysAutoResize ) )
|
||||
{
|
||||
if( big ) ImGui::PushFont( big );
|
||||
TextCentered( ICON_FA_EXCLAMATION_TRIANGLE );
|
||||
if( big ) ImGui::PopFont();
|
||||
ImGui::Text( "The file you are trying to open is not a Tracy dump." );
|
||||
ImGui::Separator();
|
||||
if( ImGui::Button( "Oops" ) )
|
||||
@ -47,7 +49,9 @@ void BadVersionImpl( BadVersionState& badVer )
|
||||
}
|
||||
if( ImGui::BeginPopupModal( "File read error", nullptr, ImGuiWindowFlags_AlwaysAutoResize ) )
|
||||
{
|
||||
if( big ) ImGui::PushFont( big );
|
||||
TextCentered( ICON_FA_EXCLAMATION_TRIANGLE );
|
||||
if( big ) ImGui::PopFont();
|
||||
ImGui::Text( "The file you are trying to open cannot be mapped to memory." );
|
||||
ImGui::Separator();
|
||||
if( ImGui::Button( "OK" ) )
|
||||
@ -59,7 +63,9 @@ void BadVersionImpl( BadVersionState& badVer )
|
||||
}
|
||||
if( ImGui::BeginPopupModal( "Unsupported file version", nullptr, ImGuiWindowFlags_AlwaysAutoResize ) )
|
||||
{
|
||||
if( big ) ImGui::PushFont( big );
|
||||
TextCentered( ICON_FA_CLOUD_DOWNLOAD_ALT );
|
||||
if( big ) ImGui::PopFont();
|
||||
ImGui::Text( "The file you are trying to open is unsupported.\nYou should update to Tracy %i.%i.%i or newer and try again.", badVer.version >> 16, ( badVer.version >> 8 ) & 0xFF, badVer.version & 0xFF );
|
||||
ImGui::Separator();
|
||||
if( ImGui::Button( ICON_FA_DOWNLOAD " Download update" ) )
|
||||
@ -78,7 +84,9 @@ void BadVersionImpl( BadVersionState& badVer )
|
||||
}
|
||||
if( ImGui::BeginPopupModal( "Legacy file version", nullptr, ImGuiWindowFlags_AlwaysAutoResize ) )
|
||||
{
|
||||
if( big ) ImGui::PushFont( big );
|
||||
TextCentered( ICON_FA_GHOST );
|
||||
if( big ) ImGui::PopFont();
|
||||
ImGui::Text( "You are trying to open a file which was created by legacy version %i.%i.%i.\nUse the update utility from an older version of the profiler to convert the file to a supported version.", badVer.version >> 16, ( badVer.version >> 8 ) & 0xFF, badVer.version & 0xFF );
|
||||
ImGui::Separator();
|
||||
if( ImGui::Button( "Maybe I don't need it" ) )
|
||||
|
@ -1,6 +1,7 @@
|
||||
#ifndef __TRACYBADVERSION_HPP__
|
||||
#define __TRACYBADVERSION_HPP__
|
||||
|
||||
#include <imgui.h>
|
||||
#include "../common/TracyForceInline.hpp"
|
||||
|
||||
namespace tracy
|
||||
@ -23,10 +24,10 @@ struct BadVersionState
|
||||
|
||||
namespace detail
|
||||
{
|
||||
void BadVersionImpl( BadVersionState& badVer );
|
||||
void BadVersionImpl( BadVersionState& badVer, ImFont* big );
|
||||
}
|
||||
|
||||
tracy_force_inline void BadVersion( BadVersionState& badVer ) { if( badVer.state != BadVersionState::Ok ) detail::BadVersionImpl( badVer ); }
|
||||
tracy_force_inline void BadVersion( BadVersionState& badVer, ImFont* big ) { if( badVer.state != BadVersionState::Ok ) detail::BadVersionImpl( badVer, big ); }
|
||||
|
||||
}
|
||||
|
||||
|
@ -11744,7 +11744,7 @@ void View::DrawCompare()
|
||||
}
|
||||
}
|
||||
}
|
||||
tracy::BadVersion( m_compare.badVer );
|
||||
tracy::BadVersion( m_compare.badVer, m_bigFont );
|
||||
ImGui::End();
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user