MayaFlux 0.4.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.
 
Collapsibleclosed_color (glm::vec3 c)
 
Collapsibleinitially_open (bool v)
 
Collapsiblelabel (std::shared_ptr< Core::VKImage > img)
 Attach a GPU image overlaid on the header as a text label.
 
Collapsibleopen_color (glm::vec3 c)
 
MAYAFLUX_API Collapsibleplace (std::shared_ptr< Buffers::FormaBuffer > 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

std::shared_ptr< Buffers::FormaBufferbuf
 FormaBuffer backing the header geometry. Valid after place().
 
LayoutCursor cursor_out
 Cursor positioned below the header, ready for body elements. 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).
 
std::shared_ptr< Core::VKImagem_label
 Optional GPU image overlaid as a text label. nullptr = 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(header_img)
.place(window, layer, ctx, cursor, x_min, x_max, row_h);
col.attach(layer, body_id);
Collapsible & closed_color(glm::vec3 c)
Collapsible & label(std::shared_ptr< Core::VKImage > img)
Attach a GPU image overlaid on the header as a text label.
MAYAFLUX_API Collapsible & place(std::shared_ptr< Buffers::FormaBuffer > buf, Surface &surface, LayoutCursor &cursor, float x_min, float x_max, float row_h)
Register the header element and wire the toggle callback.
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: