mirror of
https://github.com/wolfpld/tracy
synced 2025-05-01 13:13:53 +00:00
Fix welcome window resizes.
This commit is contained in:
parent
55f9341aec
commit
8ebe62ed85
@ -99,6 +99,7 @@ static float dpiScale = 1.f;
|
|||||||
static bool dpiScaleOverriddenFromEnv = false;
|
static bool dpiScaleOverriddenFromEnv = false;
|
||||||
static float userScale = 1.f;
|
static float userScale = 1.f;
|
||||||
static float prevScale = 1.f;
|
static float prevScale = 1.f;
|
||||||
|
static int dpiChanged = 0;
|
||||||
static Filters* filt;
|
static Filters* filt;
|
||||||
static RunQueue mainThreadTasks;
|
static RunQueue mainThreadTasks;
|
||||||
static uint32_t updateVersion = 0;
|
static uint32_t updateVersion = 0;
|
||||||
@ -150,6 +151,7 @@ static void SetupDPIScale()
|
|||||||
auto scale = dpiScale * userScale;
|
auto scale = dpiScale * userScale;
|
||||||
|
|
||||||
if( prevScale == scale ) return;
|
if( prevScale == scale ) return;
|
||||||
|
dpiChanged = 2;
|
||||||
|
|
||||||
LoadFonts( scale );
|
LoadFonts( scale );
|
||||||
if( view ) view->UpdateFont( s_fixedWidth, s_smallFont, s_bigFont );
|
if( view ) view->UpdateFont( s_fixedWidth, s_smallFont, s_bigFont );
|
||||||
@ -610,11 +612,14 @@ static void DrawContents()
|
|||||||
ImGui::PushFont( s_bigFont );
|
ImGui::PushFont( s_bigFont );
|
||||||
tracy::TextCentered( buf );
|
tracy::TextCentered( buf );
|
||||||
ImGui::PopFont();
|
ImGui::PopFont();
|
||||||
|
if( dpiChanged == 0 )
|
||||||
|
{
|
||||||
ImGui::SameLine( ImGui::GetWindowContentRegionMax().x - ImGui::CalcTextSize( ICON_FA_WRENCH ).x - ImGui::GetStyle().FramePadding.x * 2 );
|
ImGui::SameLine( ImGui::GetWindowContentRegionMax().x - ImGui::CalcTextSize( ICON_FA_WRENCH ).x - ImGui::GetStyle().FramePadding.x * 2 );
|
||||||
if( ImGui::Button( ICON_FA_WRENCH ) )
|
if( ImGui::Button( ICON_FA_WRENCH ) )
|
||||||
{
|
{
|
||||||
ImGui::OpenPopup( "About Tracy" );
|
ImGui::OpenPopup( "About Tracy" );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
bool keepOpenAbout = true;
|
bool keepOpenAbout = true;
|
||||||
if( ImGui::BeginPopupModal( "About Tracy", &keepOpenAbout, ImGuiWindowFlags_AlwaysAutoResize ) )
|
if( ImGui::BeginPopupModal( "About Tracy", &keepOpenAbout, ImGuiWindowFlags_AlwaysAutoResize ) )
|
||||||
{
|
{
|
||||||
@ -1161,4 +1166,5 @@ static void DrawContents()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bptr->EndFrame();
|
bptr->EndFrame();
|
||||||
|
if( dpiChanged > 0 ) dpiChanged--;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user