20 void add_section(std::string title, std::unique_ptr<View> content,
21 bool initially_expanded =
false);
36 int section_count()
const {
return static_cast<int>(sections_.size()); }
56 std::unique_ptr<View> content;
57 bool expanded =
false;
60 std::vector<Section> sections_;
61 float header_height_ = 30.0f;
62 bool exclusive_ =
false;
Definition canvas.hpp:240
void on_mouse_down(Point pos) override
void set_exclusive(bool e)
Whether only one section can be open at a time (default: false).
Definition concertina_panel.hpp:43
float header_height() const
Definition concertina_panel.hpp:40
void expand(int index)
Expand a section by index.
void toggle(int index)
Toggle a section.
int section_count() const
Number of sections.
Definition concertina_panel.hpp:36
void paint(canvas::Canvas &canvas) override
bool is_expanded(int index) const
Whether a section is expanded.
bool wants_mouse_input() const override
True if this widget handles mouse down/drag through virtual methods even when it does not expose JS p...
Definition concertina_panel.hpp:48
void layout_sections()
Layout the sections vertically. Call after adding/toggling sections.
void collapse(int index)
Collapse a section by index.
bool is_exclusive() const
Definition concertina_panel.hpp:44
void set_header_height(float h)
Header height for each section.
Definition concertina_panel.hpp:39
void add_section(std::string title, std::unique_ptr< View > content, bool initially_expanded=false)
Add a section with a title and content view.
ConcertinaPanel()=default
Definition affine_transform.hpp:24
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
@ h
Definition input_events.hpp:39
@ e
Definition input_events.hpp:39
Definition geometry.hpp:20