imroved spacer

This commit is contained in:
2026-03-16 03:06:14 +03:00
parent d8632dc74c
commit 2e8a74aaaf
4 changed files with 70 additions and 22 deletions

View File

@@ -119,10 +119,14 @@ namespace omath::hud
}
// ── Spacers ─────────────────────────────────────────────────────
EntityOverlay& add_right_spacer(float size);
EntityOverlay& add_left_spacer(float size);
EntityOverlay& add_top_spacer(float size);
EntityOverlay& add_bottom_spacer(float size);
EntityOverlay& add_right_space_vertical(float size);
EntityOverlay& add_right_space_horizontal(float size);
EntityOverlay& add_left_space_vertical(float size);
EntityOverlay& add_left_space_horizontal(float size);
EntityOverlay& add_top_space_vertical(float size);
EntityOverlay& add_top_space_horizontal(float size);
EntityOverlay& add_bottom_space_vertical(float size);
EntityOverlay& add_bottom_space_horizontal(float size);
// ── Progress rings ──────────────────────────────────────────────
EntityOverlay& add_right_progress_ring(const Color& color, const Color& bg, float radius, float ratio,

View File

@@ -99,8 +99,14 @@ namespace omath::hud::widget
template<typename W>
Centered(W) -> Centered<W>;
/// Empty gap that advances the side cursor without drawing.
struct Spacer
/// Empty vertical gap that advances the Y cursor without drawing.
struct SpaceVertical
{
float size;
};
/// Empty horizontal gap that advances the X cursor without drawing.
struct SpaceHorizontal
{
float size;
};
@@ -120,7 +126,7 @@ namespace omath::hud::widget
struct None
{
}; ///< No-op placeholder — used by widget::when for disabled elements.
using SideWidget = std::variant<None, Bar, DashedBar, Label, Centered<Label>, Spacer, ProgressRing>;
using SideWidget = std::variant<None, Bar, DashedBar, Label, Centered<Label>, SpaceVertical, SpaceHorizontal, ProgressRing>;
// ── Side containers ───────────────────────────────────────────────────────
// Storing std::initializer_list<SideWidget> is safe here: the backing array