MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Portal::Forma::Collapsible Struct Reference

A collapsible header strip. More...

#include <Collapsible.hpp>

+ Collaboration diagram for MayaFlux::Portal::Forma::Collapsible:

Public Member Functions

MAYAFLUX_API void attach (Layer &layer, uint32_t body_id) const
 Relate a body element to this collapsible and sync its visibility to the current open state.
 
Kinesis::AABB2D bounds () const noexcept
 Header strip region, satisfying Kinesis::HasBounds.
 
Collapsible & closed_color (glm::vec3 c)
 
Collapsible & initially_open (bool v)
 
Collapsible & label (std::string text)
 Draw a text label over the header, background included.
 
Collapsible & label_color (glm::vec4 c)
 Label text color. Only meaningful when label() is non-empty.
 
Collapsible & open_color (glm::vec3 c)
 
MAYAFLUX_API Collapsible & place (FormaTarget buf, Surface &surface, LayoutCursor &cursor, float row_h)
 Register the header element using the cursor's column extents.
 
MAYAFLUX_API Collapsible & place (FormaTarget buf, Surface &surface, LayoutCursor &cursor, float x_min, float x_max, float row_h)
 Register the header element and wire the toggle callback.
 

Public Attributes

FormaTarget buf
 FormaBuffer backing the header geometry. Valid after place().
 
LayoutCursor cursor_out
 Cursor positioned below the header, ready for body elements. Valid after place().
 
Kinesis::AABB2D header_bounds {}
 NDC region occupied by the header strip. Valid after place().
 
uint32_t header_id {}
 Element id of the header strip. Valid after place().
 
glm::vec3 m_color_closed { 0.25F }
 Background color when closed. Default: glm::vec3(0.25F).
 
glm::vec3 m_color_open { 0.35F }
 Background color when open. Default: glm::vec3(0.35F).
 
bool m_initially_open { true }
 Starting toggle state. Default: true (open).
 
glm::vec4 m_label_color { 1.F, 1.F, 1.F, 1.F }
 Label text color. Default opaque white.
 
std::string m_label_text
 Text label drawn over the header. Empty = color only.
 
std::shared_ptr< MappedState< bool > > open
 Open/closed state. Valid after place(). Write to toggle.
 

Detailed Description

A collapsible header strip.

Before place() is called, the struct carries only configuration. After place(), header_id, open, buf, and cursor_out are populated. This mirrors the Element pattern: configure with setters, register with a single explicit call.

auto col = Collapsible{}
.closed_color({ 0.2F, 0.2F, 0.2F })
.label("Oscillator")
.place(window, layer, ctx, cursor, x_min, x_max, row_h);
col.attach(layer, body_id);
uint32_t label
Definition Contours.cpp:16
std::weak_ptr< Core::Window > window
Definition Picker.cpp:23
MAYAFLUX_API Collapsible & place(FormaTarget buf, Surface &surface, LayoutCursor &cursor, float x_min, float x_max, float row_h)
Register the header element and wire the toggle callback.
Collapsible & closed_color(glm::vec3 c)
Collapsible & initially_open(bool v)
MAYAFLUX_API void attach(Layer &layer, uint32_t body_id) const
Relate a body element to this collapsible and sync its visibility to the current open state.
A collapsible header strip.

Definition at line 39 of file Collapsible.hpp.


The documentation for this struct was generated from the following files: