Starting work on moving GUI to event system (doesnt compile)

This commit is contained in:
Yousef Khadadeh 2026-03-27 09:51:53 +03:00
parent f1a855edc3
commit ef7dfcef05
69 changed files with 4296 additions and 3709 deletions

View file

@ -0,0 +1,42 @@
#pragma once
#include "Element.hpp"
#include "Helpers/ConvertVec.hpp"
namespace GUIStuff {
class ScrollArea : public Element {
public:
ScrollArea(GUIManager& gui);
struct InnerContentParameters {
Vector2f contentDimensions;
Vector2f containerDimensions;
Vector2f scrollOffset;
};
struct Options {
bool scrollVertical = false;
bool scrollHorizontal = false;
bool clipHorizontal = false;
bool clipVertical = false;
bool showScrollbarX = false;
bool showScrollbarY = false;
Clay_LayoutDirection layoutDirection = CLAY_TOP_TO_BOTTOM;
std::function<void(const InnerContentParameters&)> innerContent;
};
void layout(const Options& options);
virtual bool input_mouse_button_callback(const InputManager::MouseButtonCallbackArgs& button, bool mouseHovering) override;
virtual bool input_mouse_motion_callback(const InputManager::MouseMotionCallbackArgs& motion, bool mouseHovering) override;
virtual bool input_mouse_wheel_callback(const InputManager::MouseWheelCallbackArgs& wheel, bool mouseHovering) override;
private:
Options opts;
bool isScrollbarXHeld = false;
bool isScrollbarYHeld = false;
Vector2f contentDimensions = {0.0f, 0.0f};
Vector2f containerDimensions = {0.0f, 0.0f};
Vector2f scrollOffset = {0.0f, 0.0f};
};
}