mirror of
https://github.com/raysan5/raygui.git
synced 2026-02-04 05:09:18 -05:00
Added mouse wheel scroll to GuiScrollPanel()
Reviewed GuiWindow() top status bar
This commit is contained in:
@ -766,9 +766,12 @@ RAYGUIDEF bool GuiWindowBox(Rectangle bounds, const char *text)
|
|||||||
|
|
||||||
// Draw window header as status bar
|
// Draw window header as status bar
|
||||||
int defaultPadding = GuiGetStyle(DEFAULT, GROUP_PADDING);
|
int defaultPadding = GuiGetStyle(DEFAULT, GROUP_PADDING);
|
||||||
|
int defaultTextAlign = GuiGetStyle(DEFAULT, TEXT_ALIGNMENT);
|
||||||
GuiSetStyle(DEFAULT, INNER_PADDING, 8);
|
GuiSetStyle(DEFAULT, INNER_PADDING, 8);
|
||||||
|
GuiSetStyle(DEFAULT, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_LEFT);
|
||||||
GuiStatusBar(statusBar, text);
|
GuiStatusBar(statusBar, text);
|
||||||
GuiSetStyle(DEFAULT, INNER_PADDING, defaultPadding);
|
GuiSetStyle(DEFAULT, INNER_PADDING, defaultPadding);
|
||||||
|
GuiSetStyle(DEFAULT, TEXT_ALIGNMENT, defaultTextAlign);
|
||||||
|
|
||||||
// Draw window close button
|
// Draw window close button
|
||||||
int buttonBorder = GuiGetStyle(BUTTON, BORDER_WIDTH);
|
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_DOWN)) scrollPos.y -= GuiGetStyle(SCROLLBAR, SCROLLBAR_SCROLL_SPEED);
|
||||||
if (IsKeyDown(KEY_UP)) scrollPos.y += GuiGetStyle(SCROLLBAR, SCROLLBAR_SCROLL_SPEED);
|
if (IsKeyDown(KEY_UP)) scrollPos.y += GuiGetStyle(SCROLLBAR, SCROLLBAR_SCROLL_SPEED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scrollPos.y += GetMouseWheelMove()*20;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user