Specify default state of 'Dragging' for Slider. Add Slider::Dragging and Slider::SetDragging

This commit is contained in:
2025-03-19 01:26:25 -04:00
parent 86aa41a3db
commit ee0e92d826
2 changed files with 10 additions and 2 deletions

View File

@@ -40,7 +40,7 @@ namespace JUI
[[nodiscard]] float CurrentValue() const;
[[nodiscard]] Color4 ScrubberColor() const;
[[nodiscard]] float ScrubberWidth() const;
[[nodiscard]] bool Dragging() const;
[[nodiscard]] float Range() const;
void Minimum(float min);
@@ -49,6 +49,8 @@ namespace JUI
void CurrentValue(float value);
void ScrubberColor(const Color4& color);
void ScrubberWidth(float width);
void SetDragging(bool value);
void OnClick(const J3ML::LinearAlgebra::Vector2 &MousePos, const JUI::MouseButton &MouseButton) override;
@@ -63,7 +65,7 @@ namespace JUI
float maximum = 1;
float interval = 0.1;
float current;
bool dragging;
bool dragging = false;
float scrubber_width = 20;
Color4 scrubber_color = Colors::White;
private:

View File

@@ -119,4 +119,10 @@ namespace JUI
Slider::Slider() {
Name("Slider");
}
void Slider::SetDragging(bool value) {
dragging = value;
}
bool Slider::Dragging() const { return dragging; }
}