Implement Separator widget class. Needs documentation and testing.

This commit is contained in:
2025-05-01 13:25:34 -05:00
parent faf312206e
commit d8c48a338d
2 changed files with 99 additions and 9 deletions

View File

@@ -1,24 +1,48 @@
#pragma once
#include <JUI/Base/Widget.hpp>
#include <JUI/JUI.hpp>
namespace JUI {
enum class Orientation { HORIZONTAL, VERTICAL };
/// The Separator Widget Class.
/// Fills space, and renders a single line through it, based on the given orientation.
/// Dashed, dotted, and solid lines of varying thickness are supported.
class Separator : public Widget {
public:
Separator() : Widget()
{
Name("Separator");
}
Separator();
explicit Separator(Widget* parent)
{
explicit Separator(Widget* parent);
enum Orientation Orientation() const;
void Orient(const enum Orientation& orientation);
enum LineFillMode LineFillMode() const;
void LineFillMode(const enum LineFillMode& line_mode);
Color4 LineColor() const;
void LineColor(const Color4& color);
void InnerDraw() override;
float Spacing() const;
void Spacing(float spacing);
}
protected:
enum LineFillMode line_mode = LineFillMode::Solid;
enum Orientation orientation = Orientation::Horizontal;
Color4 line_color = Colors::Black;
float line_thickness = 1.f;
float spacing = 2.f;
private:
};
}
}