1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:38:13 +00:00

LibGUI: Rename CallOnChange => AllowCallback and implement elsewhere

This is a helpful option to prevent unwanted side effects, distinguish
between user and programmatic input, etc. Sliders and SpinBoxes were
implementing it idiosyncratically, so let's generalize the API and
give Buttons and TextEditors the same ability.
This commit is contained in:
thankyouverycool 2021-09-21 17:02:48 -04:00 committed by Andreas Kling
parent d47e431d54
commit 92fffc3abc
15 changed files with 40 additions and 39 deletions

View file

@ -141,9 +141,9 @@ int ValueSlider::value_at(const Gfx::IntPoint& position) const
return (int)(relative_offset * (float)max());
}
void ValueSlider::set_value(int value, CallOnChange call_on_change)
void ValueSlider::set_value(int value, AllowCallback allow_callback)
{
AbstractSlider::set_value(value, call_on_change);
AbstractSlider::set_value(value, allow_callback);
m_textbox->set_text(formatted_value());
}