diff options
| author | nathan <nathansmith@disroot.org> | 2025-11-17 06:33:27 +0000 |
|---|---|---|
| committer | nathan <nathansmith@disroot.org> | 2025-11-17 06:33:27 +0000 |
| commit | bbfc3fffc0e5f28681ebfb9fc0fd47777fded191 (patch) | |
| tree | 0dfb57799c2cf5a1ecfcc857e884b44a383c5299 /src/ui.c | |
| parent | f6922dc12deb981cf95498afeb939f24171a5fc4 (diff) | |
| download | FindThings-bbfc3fffc0e5f28681ebfb9fc0fd47777fded191.tar.gz FindThings-bbfc3fffc0e5f28681ebfb9fc0fd47777fded191.tar.bz2 FindThings-bbfc3fffc0e5f28681ebfb9fc0fd47777fded191.zip | |
Scrolling focus thingy
Diffstat (limited to 'src/ui.c')
| -rw-r--r-- | src/ui.c | 35 |
1 files changed, 24 insertions, 11 deletions
@@ -158,18 +158,31 @@ FocusCommand updateFloatingWindowNotMinimized(FloatingWindow* window, if (window->callback != NULL) { Rectangle scissor; - - GuiScrollPanel( - (Rectangle){ - window->rect.x, window->rect.y + RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT, + + // Handle scrolling. + if (window->hasFocus) + { + 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}, - NULL, - (Rectangle){ - window->rect.x, window->rect.y, - window->contentSize.x, window->contentSize.y}, - &window->scroll, - &scissor); + window->rect.height - RAYGUI_WINDOWBOX_STATUSBAR_HEIGHT + }; + } bool requireScissor = window->rect.width < window->contentSize.x || window->rect.height < window->contentSize.x; |
