mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibGUI: Add on_return_pressed function to SpinBox
This commit is contained in:
parent
f9940390a3
commit
abaecb878b
Notes:
sideshowbarker
2024-07-17 20:33:50 +09:00
Author: https://github.com/ClysmiC Commit: https://github.com/SerenityOS/serenity/commit/abaecb878b Pull-request: https://github.com/SerenityOS/serenity/pull/14086
2 changed files with 5 additions and 0 deletions
|
@ -35,6 +35,10 @@ SpinBox::SpinBox()
|
|||
m_editor->on_down_pressed = [this] {
|
||||
set_value(m_value - 1);
|
||||
};
|
||||
m_editor->on_return_pressed = [this] {
|
||||
if (on_return_pressed)
|
||||
on_return_pressed();
|
||||
};
|
||||
|
||||
m_increment_button = add<Button>();
|
||||
m_increment_button->set_button_style(Gfx::ButtonStyle::ThickCap);
|
||||
|
|
|
@ -26,6 +26,7 @@ public:
|
|||
void set_range(int min, int max, AllowCallback = AllowCallback::Yes);
|
||||
|
||||
Function<void(int value)> on_change;
|
||||
Function<void()> on_return_pressed;
|
||||
|
||||
protected:
|
||||
SpinBox();
|
||||
|
|
Loading…
Reference in a new issue