ZenitUI
Retained-mode C++20 UI framework
Loading...
Searching...
No Matches
ProgressBar.hpp
Go to the documentation of this file.
1#pragma once
2
11
12#include "Common.hpp"
13#include "Layout.hpp"
14
15namespace ZenitUI::UI
16{
20
28 class ProgressBar : public TLayout<ProgressBar>
29 {
30 public:
32 explicit ProgressBar(float v = 0.0f);
33
35 void setValue(float v);
36
38 float getValue() const { return value; }
39
40 static constexpr const char *PART_TRACK = "track";
41 static constexpr const char *PART_FILL = "fill";
42
43 protected:
44 Vec2 computeIntrinsicSize(float availW, float availH) override;
45 void renderContent(float op, const ComputedStyle &style) override;
46
47 private:
48 float value;
49 };
50
51} // namespace ZenitUI::UI
Centralized standard library includes used throughout ZenitUI.
The node class: tree structure, layout pass, style resolution, input dispatch, render orchestration,...
TLayout(Args &&...args)
Definition Layout.hpp:1401
float getValue() const
Current value in [0, 1].
Definition ProgressBar.hpp:38
void setValue(float v)
Set the value, clamped to [0, 1].
void renderContent(float op, const ComputedStyle &style) override
Draw the node's content (text, images, custom geometry).
ProgressBar(float v=0.0f)
Construct with an initial value, clamped to [0, 1].
Vec2 computeIntrinsicSize(float availW, float availH) override
Compute the intrinsic size, excluding padding and border.
Dense style: every property has a concrete value.
Definition Style.hpp:1036
2D vector with component-wise arithmetic.
Definition CoreTypes.hpp:25