mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
make scrollbar interactive
This commit is contained in:
parent
bad2b44c96
commit
b65ba61f9a
6 changed files with 65 additions and 16 deletions
|
|
@ -7,13 +7,19 @@
|
|||
|
||||
namespace gui {
|
||||
class Container : public UINode {
|
||||
int prevScrollY = -1;
|
||||
protected:
|
||||
std::vector<std::shared_ptr<UINode>> nodes;
|
||||
std::vector<IntervalEvent> intervalEvents;
|
||||
int scroll = 0;
|
||||
int scrollStep = 40;
|
||||
int scrollBarWidth = 10;
|
||||
int actualLength = 0;
|
||||
bool scrollable = true;
|
||||
|
||||
bool isScrolling() {
|
||||
return prevScrollY != -1;
|
||||
}
|
||||
public:
|
||||
Container(glm::vec2 size);
|
||||
virtual ~Container();
|
||||
|
|
@ -36,6 +42,9 @@ namespace gui {
|
|||
virtual void setScrollStep(int step);
|
||||
virtual void refresh() override;
|
||||
|
||||
virtual void mouseMove(GUI*, int x, int y) override;
|
||||
virtual void mouseRelease(GUI*, int x, int y) override;
|
||||
|
||||
const std::vector<std::shared_ptr<UINode>>& getNodes() const;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue