summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-10-27 20:30:41 +0100
committersalmonik <salmonik@tuta.io>2026-10-27 20:30:41 +0100
commit10791d0901369576c4268d4afaefceef5e151a58 (patch)
tree084b51d303d10bcbeca771e826642102627edcec /src
parentGUI: wrap all text instead of truncating (diff)
downloadhl2h-10791d0901369576c4268d4afaefceef5e151a58.tar.gz
hl2h-10791d0901369576c4268d4afaefceef5e151a58.zip
Toasts: account for panel padding when wrapping
Diffstat (limited to 'src')
-rw-r--r--src/gui.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui.cpp b/src/gui.cpp
index f4ba009..9af8003 100644
--- a/src/gui.cpp
+++ b/src/gui.cpp
@@ -1460,9 +1460,12 @@ void gui_draw_toasts() {
1460 pthread_mutex_unlock(&g_toast_mu); 1460 pthread_mutex_unlock(&g_toast_mu);
1461 1461
1462 int margin = S(16.0f); 1462 int margin = S(16.0f);
1463 int overhead = S(12.0f) * 2 + S(6.0f); // panel padding + accent stripe gap
1463 int max_w = S(420.0f); 1464 int max_w = S(420.0f);
1464 if (max_w > g_scr_w - margin * 2) 1465 if (max_w + overhead > g_scr_w - margin * 2)
1465 max_w = g_scr_w - margin * 2; 1466 max_w = g_scr_w - margin * 2 - overhead;
1467 if (max_w < S(60.0f))
1468 max_w = S(60.0f);
1466 int y = margin; 1469 int y = margin;
1467 for (int i = 0; i < n; i++) { 1470 for (int i = 0; i < n; i++) {
1468 const Toast &t = local[i]; 1471 const Toast &t = local[i];