mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 17:15:26 +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:
committed by
Andreas Kling
parent
d47e431d54
commit
92fffc3abc
@@ -39,7 +39,7 @@ TextDocument::~TextDocument()
|
||||
{
|
||||
}
|
||||
|
||||
bool TextDocument::set_text(const StringView& text)
|
||||
bool TextDocument::set_text(const StringView& text, AllowCallback allow_callback)
|
||||
{
|
||||
m_client_notifications_enabled = false;
|
||||
m_undo_stack.clear();
|
||||
@@ -90,7 +90,7 @@ bool TextDocument::set_text(const StringView& text)
|
||||
m_client_notifications_enabled = true;
|
||||
|
||||
for (auto* client : m_clients)
|
||||
client->document_did_set_text();
|
||||
client->document_did_set_text(allow_callback);
|
||||
|
||||
clear_text_guard.disarm();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user