1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 18:15:07 +00:00

LibGUI: Register a whole bunch of properties in various widgets

This commit is contained in:
AnotherTest 2020-12-30 13:58:38 +03:30 committed by Andreas Kling
parent 20b74e4ede
commit 90aeacbb58
14 changed files with 65 additions and 7 deletions

View file

@ -36,12 +36,30 @@ namespace GUI {
Slider::Slider(Orientation orientation)
: m_orientation(orientation)
{
REGISTER_INT_PROPERTY("min", min, set_min);
REGISTER_INT_PROPERTY("max", max, set_max);
REGISTER_INT_PROPERTY("step", step, set_step);
REGISTER_ENUM_PROPERTY("knob_size_mode", knob_size_mode, set_knob_size_mode, KnobSizeMode,
{ KnobSizeMode::Fixed, "Fixed" },
{ KnobSizeMode::Proportional, "Proportional" });
REGISTER_ENUM_PROPERTY("orientation", this->orientation, set_orientation, Orientation,
{ Orientation::Horizontal, "Horizontal" },
{ Orientation::Vertical, "Vertical" });
}
Slider::~Slider()
{
}
void Slider::set_orientation(Orientation value)
{
if (m_orientation == value)
return;
m_orientation = value;
update();
}
void Slider::set_range(int min, int max)
{
ASSERT(min <= max);