17 using PropertyValue = std::variant<std::string, float, int, bool, Color>;
31 const std::vector<Property>&
properties()
const {
return properties_; }
59 std::vector<Property> properties_;
60 float row_height_ = 28.0f;
61 float label_width_ = 0.4f;
62 bool show_categories_ =
true;
63 int editing_index_ = -1;
Definition canvas.hpp:240
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 property_list.hpp:54
bool show_categories() const
Definition property_list.hpp:50
const std::vector< Property > & properties() const
Definition property_list.hpp:31
std::variant< std::string, float, int, bool, Color > PropertyValue
Property value types.
Definition property_list.hpp:17
float label_width_fraction() const
Definition property_list.hpp:47
void set_properties(std::vector< Property > props)
Set the list of properties.
void paint(canvas::Canvas &canvas) override
void set_value(const std::string &key, PropertyValue value)
Update a single property value by key.
float intrinsic_height() const override
void set_label_width_fraction(float f)
Definition property_list.hpp:46
void on_mouse_down(Point pos) override
std::function< void(const std::string &key, PropertyValue new_value)> on_change
Callback when a property value changes.
Definition property_list.hpp:40
void set_row_height(float h)
Display options.
Definition property_list.hpp:43
void set_show_categories(bool show)
Definition property_list.hpp:49
float row_height() const
Definition property_list.hpp:44
const Property * find_property(const std::string &key) const
Get a property value by key. Returns nullptr if not found.
Definition affine_transform.hpp:24
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
@ value
the widget's primary value (Knob, Fader, RangeSlider, Toggle, ProgressBar)
Definition binding_diagnostics.hpp:19
@ h
Definition input_events.hpp:39
@ f
Definition input_events.hpp:39
Definition geometry.hpp:20
Definition property_list.hpp:19
std::string label
Definition property_list.hpp:21
PropertyValue value
Definition property_list.hpp:22
bool read_only
Definition property_list.hpp:23
std::string key
Definition property_list.hpp:20
std::string category
Definition property_list.hpp:24