mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibGUI: Add AllowCallback parameter to ColorInput::set_color()
The `TextEditor::on_change` callback now only fires if the user types in the box, or `set_text()` is called with `AllowCallback::Yes`. Previously that callback was what set `m_color`, so I've rearranged things a little so that the color still updates regardless of what source the color came from.
This commit is contained in:
committed by
Andreas Kling
parent
91230ff28d
commit
5fd0140772
Notes:
sideshowbarker
2024-07-17 11:27:50 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/5fd0140772 Pull-request: https://github.com/SerenityOS/serenity/pull/13834 Reviewed-by: https://github.com/krkk
@@ -21,7 +21,7 @@ public:
|
||||
bool has_alpha_channel() const { return m_color_has_alpha_channel; }
|
||||
void set_color_has_alpha_channel(bool has_alpha) { m_color_has_alpha_channel = has_alpha; }
|
||||
|
||||
void set_color(Color);
|
||||
void set_color(Color, AllowCallback = AllowCallback::Yes);
|
||||
Color color() { return m_color; }
|
||||
|
||||
void set_color_picker_title(String title) { m_color_picker_title = move(title); }
|
||||
@@ -39,7 +39,7 @@ private:
|
||||
ColorInput();
|
||||
|
||||
Gfx::IntRect color_rect() const;
|
||||
void set_color_without_changing_text(Color);
|
||||
void set_color_internal(Color, AllowCallback, bool change_text);
|
||||
|
||||
Color m_color;
|
||||
String m_color_picker_title { "Select color" };
|
||||
|
||||
Reference in New Issue
Block a user