From 2ef80a5d341d8435f2ff9e25762a2ab794427c67 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 25 Jul 2021 16:48:50 +1000 Subject: [PATCH] [client] overlay: cosmetic changes to the overlay display --- client/src/core.h | 1 - client/src/main.c | 2 +- client/src/overlay/alert.c | 4 ++++ client/src/overlay/fps.c | 4 ++++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/client/src/core.h b/client/src/core.h index 01e1d289..19d82395 100644 --- a/client/src/core.h +++ b/client/src/core.h @@ -37,5 +37,4 @@ void core_handleGuestMouseUpdate(void); void core_handleMouseGrabbed(double ex, double ey); void core_handleMouseNormal(double ex, double ey); - #endif diff --git a/client/src/main.c b/client/src/main.c index ee22ffca..dd7a86cb 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -192,7 +192,7 @@ static int renderThread(void * unused) ImFontAtlas_AddFontFromFileTTF(g_state.io->Fonts, g_state.fontName, g_params.uiSize * g_state.windowScale, NULL, NULL); g_state.fontLarge = ImFontAtlas_AddFontFromFileTTF(g_state.io->Fonts, - g_state.fontName, 2 * g_params.uiSize * g_state.windowScale, NULL, NULL); + g_state.fontName, 1.3f * g_params.uiSize * g_state.windowScale, NULL, NULL); ImFontAtlas_Build(g_state.io->Fonts); if (g_state.lgr) diff --git a/client/src/overlay/alert.c b/client/src/overlay/alert.c index 5e7eac42..c6532407 100644 --- a/client/src/overlay/alert.c +++ b/client/src/overlay/alert.c @@ -60,6 +60,8 @@ static int alert_render(void * udata, bool interactive, struct Rect * windowRect igSetNextWindowPos((ImVec2) { screen->x / 2.0f, screen->y / 2.0f }, 0, (ImVec2) { 0.5f, 0.5f }); igPushStyleColorU32(ImGuiCol_WindowBg, colours[g_state.alertType]); + igPushStyleVarVec2(ImGuiStyleVar_WindowPadding, (ImVec2) { 4.0f , 4.0f }); + igPushStyleVarVec2(ImGuiStyleVar_WindowMinSize, (ImVec2) { 0.0f , 0.0f }); igBegin( "Alert", @@ -75,6 +77,8 @@ static int alert_render(void * udata, bool interactive, struct Rect * windowRect overlayGetImGuiRect(windowRects); igEnd(); + + igPopStyleVar(2); igPopStyleColor(1); return 1; diff --git a/client/src/overlay/fps.c b/client/src/overlay/fps.c index 30c03d17..dce50054 100644 --- a/client/src/overlay/fps.c +++ b/client/src/overlay/fps.c @@ -42,6 +42,8 @@ static int fps_render(void * udata, bool interactive, struct Rect * windowRects, ImVec2 pos = {0.0f, 0.0f}; igSetNextWindowBgAlpha(0.6f); igSetNextWindowPos(pos, 0, pos); + igPushStyleVarVec2(ImGuiStyleVar_WindowPadding, (ImVec2) { 4.0f , 4.0f }); + igPushStyleVarVec2(ImGuiStyleVar_WindowMinSize, (ImVec2) { 0.0f , 0.0f }); igBegin( "FPS", @@ -58,6 +60,8 @@ static int fps_render(void * udata, bool interactive, struct Rect * windowRects, overlayGetImGuiRect(windowRects); igEnd(); + igPopStyleVar(2); + return 1; }