From 6b7352bc6cc648a00195baada33073ca2873818e Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 4 Mar 2019 12:45:55 +0100 Subject: [PATCH] Added mouse wheel scroll to GuiScrollPanel() Reviewed GuiWindow() top status bar --- src/raygui.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/raygui.h b/src/raygui.h index d23418c..6b49d3e 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -766,9 +766,12 @@ RAYGUIDEF bool GuiWindowBox(Rectangle bounds, const char *text) // Draw window header as status bar int defaultPadding = GuiGetStyle(DEFAULT, GROUP_PADDING); + int defaultTextAlign = GuiGetStyle(DEFAULT, TEXT_ALIGNMENT); GuiSetStyle(DEFAULT, INNER_PADDING, 8); + GuiSetStyle(DEFAULT, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT); GuiStatusBar(statusBar, text); GuiSetStyle(DEFAULT, INNER_PADDING, defaultPadding); + GuiSetStyle(DEFAULT, TEXT_ALIGNMENT, defaultTextAlign); // Draw window close button int buttonBorder = GuiGetStyle(BUTTON, BORDER_WIDTH); @@ -908,6 +911,8 @@ RAYGUIDEF Rectangle GuiScrollPanel(Rectangle bounds, Rectangle content, Vector2 if (IsKeyDown(KEY_DOWN)) scrollPos.y -= GuiGetStyle(SCROLLBAR, SCROLLBAR_SCROLL_SPEED); if (IsKeyDown(KEY_UP)) scrollPos.y += GuiGetStyle(SCROLLBAR, SCROLLBAR_SCROLL_SPEED); } + + scrollPos.y += GetMouseWheelMove()*20; } }