mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02: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:
committed by
Andreas Kling
parent
d47e431d54
commit
92fffc3abc
Notes:
sideshowbarker
2024-07-18 03:33:54 +09:00
Author: https://github.com/thankyouverycool Commit: https://github.com/SerenityOS/serenity/commit/92fffc3abc5 Pull-request: https://github.com/SerenityOS/serenity/pull/10175
@@ -30,7 +30,7 @@ public:
|
||||
bool is_max() const { return m_value == m_max; }
|
||||
|
||||
void set_range(int min, int max);
|
||||
virtual void set_value(int, CallOnChange call_on_change = CallOnChange::Yes);
|
||||
virtual void set_value(int, AllowCallback = AllowCallback::Yes);
|
||||
|
||||
void set_min(int min) { set_range(min, max()); }
|
||||
void set_max(int max) { set_range(min(), max); }
|
||||
|
||||
Reference in New Issue
Block a user