diff options
| author | nathan <nathansmith@disroot.org> | 2025-11-21 04:25:16 +0000 |
|---|---|---|
| committer | nathan <nathansmith@disroot.org> | 2025-11-21 04:25:16 +0000 |
| commit | e00d5a923f69bd0b95b0ccf11d98f507fe6f08aa (patch) | |
| tree | a801bbdd25842d836adb7e046c8399a741f65403 | |
| parent | 04655283852b1b332ae9f8610aca20a553b3791f (diff) | |
| download | FindThings-e00d5a923f69bd0b95b0ccf11d98f507fe6f08aa.tar.gz FindThings-e00d5a923f69bd0b95b0ccf11d98f507fe6f08aa.tar.bz2 FindThings-e00d5a923f69bd0b95b0ccf11d98f507fe6f08aa.zip | |
Making wm idea less fuck
| -rw-r--r-- | src/ui.c | 62 |
1 files changed, 42 insertions, 20 deletions
@@ -145,13 +145,16 @@ void updateFloatingWindowMinimized(FloatingWindow* window) } FocusCommand updateFloatingWindowNotMinimized(FloatingWindow* window, - Game* game) + WindowManager* wm, Game* game) { FocusCommand focus = NO_FOCUS_ACTION; - - window->minimized = GuiWindowBox( - (Rectangle){window->rect.x, window->rect.y, window->rect.width, - window->rect.height}, window->title); + + if (wm->enabled) + { + window->minimized = GuiWindowBox( + (Rectangle){window->rect.x, window->rect.y, window->rect.width, + window->rect.height}, window->title); + } // Scissor and draw content within a scroll panel. if (window->callback != NULL) @@ -159,17 +162,30 @@ FocusCommand updateFloatingWindowNotMinimized(FloatingWindow* window, Rectangle scissor; // Handle scrolling. - GuiScrollPanel( - (Rectangle){ - window->rect.x, window->rect.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT, - window->rect.width, - window->rect.height - RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT}, - NULL, - (Rectangle){ - window->rect.x, window->rect.y, - window->contentSize.x, window->contentSize.y}, - &window->scroll, - &scissor); + if (wm->enabled) + { + GuiScrollPanel( + (Rectangle){ + window->rect.x, + window->rect.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT, + window->rect.width, + window->rect.height - RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT}, + NULL, + (Rectangle){ + window->rect.x, window->rect.y, + window->contentSize.x, window->contentSize.y}, + &window->scroll, + &scissor); + } + else + { + scissor = (Rectangle){ + window->rect.x, + window->rect.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT, + window->rect.width, + window->rect.height - RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + }; + } bool requireScissor = window->rect.width < window->contentSize.x || window->rect.height < window->contentSize.x; @@ -188,8 +204,11 @@ FocusCommand updateFloatingWindowNotMinimized(FloatingWindow* window, } // Draw the resize button/icon. - GuiDrawIcon(71, window->rect.x + window->rect.width - 20, - window->rect.y + window->rect.height - 20, 1, GREEN); + if (wm->enabled) + { + GuiDrawIcon(71, window->rect.x + window->rect.width - 20, + window->rect.y + window->rect.height - 20, 1, GREEN); + } return focus; } @@ -231,11 +250,14 @@ FocusCommand updateFloatingWindow(FloatingWindow* window, WindowManager* wm, // Window and content drawing with scissor and scroll area. if(window->minimized) { - updateFloatingWindowMinimized(window); + if (wm->enabled) + { + updateFloatingWindowMinimized(window); + } } else { - FocusCommand result = updateFloatingWindowNotMinimized(window, game); + FocusCommand result = updateFloatingWindowNotMinimized(window, wm, game); focus = result == NO_FOCUS_ACTION ? focus : result; } |
