@@ -97,6 +97,8 @@ static TLESource_t RETLECTOR_SOURCES[] = {
9797 {"25" , "CubeSats" , "https://retlector.eu/tle/cubesat" }
9898};
9999#define NUM_RETLECTOR_SOURCES 25
100+ #define HELP_WINDOW_W 420.0f
101+ #define HELP_WINDOW_H 500.0f
100102
101103/* window z-ordering management */
102104typedef enum
@@ -789,7 +791,7 @@ static void FindSmartWindowPosition(float w, float h, AppConfig *cfg, float *out
789791 Rectangle active [10 ];
790792 int count = 0 ;
791793 if (show_help )
792- active [count ++ ] = (Rectangle ){hw_x , hw_y , 420 * cfg -> ui_scale , 480 * cfg -> ui_scale };
794+ active [count ++ ] = (Rectangle ){hw_x , hw_y , HELP_WINDOW_W * cfg -> ui_scale , HELP_WINDOW_H * cfg -> ui_scale };
793795 if (show_settings )
794796 active [count ++ ] = (Rectangle ){sw_x , sw_y , 250 * cfg -> ui_scale , 520 * cfg -> ui_scale };
795797 if (show_time_dialog )
@@ -884,7 +886,7 @@ bool IsMouseOverUI(AppConfig *cfg)
884886 bool over_window = false;
885887 float pass_w = 357 * cfg -> ui_scale , pass_h = 380 * cfg -> ui_scale ;
886888
887- if (show_help && CheckCollisionPointRec (GetMousePosition (), (Rectangle ){hw_x , hw_y , 420 * cfg -> ui_scale , 480 * cfg -> ui_scale }))
889+ if (show_help && CheckCollisionPointRec (GetMousePosition (), (Rectangle ){hw_x , hw_y , HELP_WINDOW_W * cfg -> ui_scale , HELP_WINDOW_H * cfg -> ui_scale }))
888890 over_window = true;
889891 if (show_settings && CheckCollisionPointRec (GetMousePosition (), (Rectangle ){sw_x , sw_y , 250 * cfg -> ui_scale , 520 * cfg -> ui_scale }))
890892 over_window = true;
@@ -1231,7 +1233,7 @@ void DrawGUI(UIContext *ctx, AppConfig *cfg, Font customFont)
12311233 }
12321234
12331235 /* calculate interactive window rects */
1234- Rectangle helpWindow = {hw_x , hw_y , 420 * cfg -> ui_scale , 480 * cfg -> ui_scale };
1236+ Rectangle helpWindow = {hw_x , hw_y , HELP_WINDOW_W * cfg -> ui_scale , HELP_WINDOW_H * cfg -> ui_scale };
12351237 Rectangle settingsWindow = {sw_x , sw_y , 250 * cfg -> ui_scale , 520 * cfg -> ui_scale };
12361238 Rectangle timeWindow = {td_x , td_y , 252 * cfg -> ui_scale , 320 * cfg -> ui_scale };
12371239 Rectangle tleWindow = {(GetScreenWidth () - 300 * cfg -> ui_scale ) / 2.0f , (GetScreenHeight () - 130 * cfg -> ui_scale ) / 2.0f , 300 * cfg -> ui_scale , 130 * cfg -> ui_scale };
@@ -1554,11 +1556,14 @@ void DrawGUI(UIContext *ctx, AppConfig *cfg, Font customFont)
15541556 Rectangle btnClock = {btn_start_x + 140 * cfg -> ui_scale , GetScreenHeight () - 40 * cfg -> ui_scale , 30 * cfg -> ui_scale , 30 * cfg -> ui_scale };
15551557
15561558 /* main toolbar rendering */
1557- if (top_hovered_wnd != -1 )
1559+ bool toolbar_blocked_by_window = (top_hovered_wnd != -1 );
1560+ int old_toolbar_disabled_text = GuiGetStyle (DEFAULT , TEXT_COLOR_DISABLED );
1561+ GuiSetStyle (DEFAULT , TEXT_COLOR_DISABLED , GuiGetStyle (DEFAULT , TEXT_COLOR_NORMAL ));
1562+ if (toolbar_blocked_by_window )
15581563 GuiDisable ();
15591564
15601565 int normal_text = ColorToInt (cfg -> text_main );
1561- int disabled_text = ColorToInt (cfg -> text_secondary );
1566+ int disabled_text = toolbar_blocked_by_window ? normal_text : ColorToInt (cfg -> text_secondary );
15621567
15631568#define HIGHLIGHT_START (cond ) \
15641569 if (cond) \
@@ -1590,7 +1595,7 @@ void DrawGUI(UIContext *ctx, AppConfig *cfg, Font customFont)
15901595 {
15911596 if (!show_help )
15921597 {
1593- FindSmartWindowPosition (420 * cfg -> ui_scale , 480 * cfg -> ui_scale , cfg , & hw_x , & hw_y );
1598+ FindSmartWindowPosition (HELP_WINDOW_W * cfg -> ui_scale , HELP_WINDOW_H * cfg -> ui_scale , cfg , & hw_x , & hw_y );
15941599 }
15951600 show_help = !show_help ;
15961601 BringToFront (WND_HELP );
@@ -1763,16 +1768,23 @@ void DrawGUI(UIContext *ctx, AppConfig *cfg, Font customFont)
17631768#undef HIGHLIGHT_START
17641769#undef HIGHLIGHT_END
17651770
1766- GuiEnable ();
1771+ if (toolbar_blocked_by_window )
1772+ GuiEnable ();
1773+ GuiSetStyle (DEFAULT , TEXT_COLOR_DISABLED , old_toolbar_disabled_text );
17671774
17681775 /* Render dialogs respecting Z-Order to enforce click consumption logically */
17691776 for (int win_idx = 0 ; win_idx < WND_MAX ; win_idx ++ )
17701777 {
17711778 WindowID current_id = z_order [win_idx ];
17721779 bool is_topmost = (top_hovered_wnd == -1 ) || (top_hovered_wnd == current_id );
1773-
1774- if (!is_topmost )
1780+ bool window_blocked = !is_topmost ;
1781+ int old_window_disabled_text = 0 ;
1782+ if (window_blocked )
1783+ {
1784+ old_window_disabled_text = GuiGetStyle (DEFAULT , TEXT_COLOR_DISABLED );
1785+ GuiSetStyle (DEFAULT , TEXT_COLOR_DISABLED , GuiGetStyle (DEFAULT , TEXT_COLOR_NORMAL ));
17751786 GuiDisable ();
1787+ }
17761788
17771789 switch (current_id )
17781790 {
@@ -2157,7 +2169,7 @@ void DrawGUI(UIContext *ctx, AppConfig *cfg, Font customFont)
21572169 if (DrawMaterialWindow (helpWindow , "#193# Help & Controls" , cfg , customFont , true))
21582170 show_help = false;
21592171
2160- Rectangle contentRec = {0 , 0 , helpWindow .width - 32 * cfg -> ui_scale , 620 * cfg -> ui_scale };
2172+ Rectangle contentRec = {0 , 0 , helpWindow .width - 32 * cfg -> ui_scale , 660 * cfg -> ui_scale };
21612173 Rectangle viewRec = {0 };
21622174
21632175 int oldFocusD = GuiGetStyle (DEFAULT , BORDER_COLOR_FOCUSED );
@@ -3472,8 +3484,11 @@ case WND_SCOPE:
34723484 break ;
34733485 }
34743486
3475- if (!is_topmost )
3487+ if (window_blocked )
3488+ {
34763489 GuiEnable ();
3490+ GuiSetStyle (DEFAULT , TEXT_COLOR_DISABLED , old_window_disabled_text );
3491+ }
34773492 }
34783493
34793494 if (show_tle_warning )
@@ -3550,7 +3565,7 @@ case WND_SCOPE:
35503565 else SetTargetFPS (0 );
35513566 SaveAppConfig ("settings.json" , cfg );
35523567 if (!show_help ) {
3553- FindSmartWindowPosition (420 * cfg -> ui_scale , 480 * cfg -> ui_scale , cfg , & hw_x , & hw_y );
3568+ FindSmartWindowPosition (HELP_WINDOW_W * cfg -> ui_scale , HELP_WINDOW_H * cfg -> ui_scale , cfg , & hw_x , & hw_y );
35543569 show_help = true;
35553570 BringToFront (WND_HELP );
35563571 }
@@ -3575,7 +3590,7 @@ case WND_SCOPE:
35753590 else SetTargetFPS (0 );
35763591 SaveAppConfig ("settings.json" , cfg );
35773592 if (!show_help ) {
3578- FindSmartWindowPosition (420 * cfg -> ui_scale , 480 * cfg -> ui_scale , cfg , & hw_x , & hw_y );
3593+ FindSmartWindowPosition (HELP_WINDOW_W * cfg -> ui_scale , HELP_WINDOW_H * cfg -> ui_scale , cfg , & hw_x , & hw_y );
35793594 show_help = true;
35803595 BringToFront (WND_HELP );
35813596 }
0 commit comments