aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui.c')
-rw-r--r--src/ui.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/src/ui.c b/src/ui.c
index 6fbc250..6cd8d43 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -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;