Something went wrong. Try again.
art software for the rest of us
drawing paint image sdl art
Something went wrong. Try again.
740 B · 26 lines
C
123456789101112131415161718192021222324252627#pragma once
#include "../../Widgets/Widget.h"#include "LayoutTypes.h"
namespace UI {
class StackLayout : public Widget {private: Orientation orientation = Orientation::Vertical; float spacing = 8.0f;
public: StackLayout(Orientation orientation = Orientation::Vertical, float spacing = 8.0f) : orientation(orientation), spacing(spacing) {}
void SetOrientation(Orientation o) { orientation = o; MarkDirty(DirtyFlags::Layout); } Orientation GetOrientation() const { return orientation; }
void SetSpacing(float s) { spacing = s; MarkDirty(DirtyFlags::Layout); } float GetSpacing() const { return spacing; }
void Measure(Size availableSpace) override; void Arrange(Rect finalBounds) override;};
}