9#ifndef AVARA3D_UI_PANEL_H
10#define AVARA3D_UI_PANEL_H
59 return {0.0f, 0.0f, 0.0f, 0.0f};
101 Padding padding = {12.0f, 4.0f, 0.0f, 0.0f});
122 void row(
unsigned itemCount);
129 bool button(std::string_view label,
Padding padding = {2.0f, 0.0f, 0.0f, 0.0f});
139 bool option(std::string_view label,
bool selected,
Padding padding = {2.0f, 0.0f, 0.0f, 0.0f});
149 bool subOption(std::string_view label,
bool selected,
Padding padding = {2.0f, 0.0f, 0.0f, 0.0f});
160 std::string_view format =
"%.2f",
161 Padding padding = {2.0f, 0.0f, 0.0f, 0.0f});
172 std::string_view format =
"%d",
173 Padding padding = {2.0f, 0.0f, 0.0f, 0.0f});
188 float beginItem()
const;
190 bool drawButton(std::string_view label,
bool selected,
Padding padding);
194 std::string _windowName;
195 unsigned _rowItemsRemaining;
Transient immediate-mode overlay panel for application controls and status.
bool slider(std::string_view label, float &value, float minimum, float maximum, std::string_view format="%.2f", Padding padding={2.0f, 0.0f, 0.0f, 0.0f})
Draws a floating-point slider and reports whether value changed.
void row(unsigned itemCount)
Arranges the next itemCount items horizontally with equal widths.
bool button(std::string_view label, Padding padding={2.0f, 0.0f, 0.0f, 0.0f})
Draws a button and reports activation once.
void text(std::string_view text, Padding padding=Padding::Default())
Draws body text, wrapping it to the available item width.
void value(std::string_view label, std::string_view value, Padding padding=Padding::Default())
Draws a left-aligned label and right-aligned textual value.
bool slider(std::string_view label, int &value, int minimum, int maximum, std::string_view format="%d", Padding padding={2.0f, 0.0f, 0.0f, 0.0f})
Draws an integer slider and reports whether value changed.
bool toggle(std::string_view label, bool &value, Padding padding=Padding::Default())
Draws a boolean toggle and reports whether value changed.
void spacer(float height)
Inserts vertical space of height logical UI units.
bool hovered() const
Returns whether the pointer is hovering the panel during the current frame.
Panel(std::string_view id, const Options &options=Options::Default())
Begins an immediate-mode panel for the current frame.
bool subOption(std::string_view label, bool selected, Padding padding={2.0f, 0.0f, 0.0f, 0.0f})
Draws a visually subordinate selectable option button and reports activation once.
void section(std::string_view text, SectionConfig config=SectionConfig::Default(), Padding padding={12.0f, 4.0f, 0.0f, 0.0f})
Draws a section heading with optional separator line, capitalization, and padding.
bool option(std::string_view label, bool selected, Padding padding={2.0f, 0.0f, 0.0f, 0.0f})
Draws a selectable option button and reports activation once.
Controls panel width and its inset from the upper-right viewport corner.
float width
Panel width in logical UI units.
static Options Default()
Returns the Options value currently used as Panel's default argument.
float margin
Top and right viewport margin in logical UI units.
Per-item padding in logical UI units.
float left
Padding to the left of the item contents.
static Padding Default()
Returns zero padding on all sides.
float bottom
Padding below the item contents.
float right
Padding to the right of the item contents.
float top
Padding above the item contents.
Controls the optional separator line and capitalization of section headings.
static SectionConfig Default()
Returns the default section-heading configuration.
bool line
Draw a separator line beneath the heading when true.
bool uppercase
Convert the displayed heading to uppercase when true.