mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-23 16:14:23 +00:00
LibGUI: Add a GAbstractButton base class for button widgets.
This patch moves GButton and GRadioButton to inherit from it. This allows them to share code for mouse event handling, etc.
This commit is contained in:
@@ -54,7 +54,7 @@ void GInputBox::build()
|
||||
m_cancel_button = new GButton(button_container_inner);
|
||||
m_cancel_button->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
||||
m_cancel_button->set_preferred_size({ 0, 20 });
|
||||
m_cancel_button->set_caption("Cancel");
|
||||
m_cancel_button->set_text("Cancel");
|
||||
m_cancel_button->on_click = [this] (auto&) {
|
||||
dbgprintf("GInputBox: Cancel button clicked\n");
|
||||
done(ExecCancel);
|
||||
@@ -63,7 +63,7 @@ void GInputBox::build()
|
||||
m_ok_button = new GButton(button_container_inner);
|
||||
m_ok_button->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
||||
m_ok_button->set_preferred_size({ 0, 20 });
|
||||
m_ok_button->set_caption("OK");
|
||||
m_ok_button->set_text("OK");
|
||||
m_ok_button->on_click = [this] (auto&) {
|
||||
dbgprintf("GInputBox: OK button clicked\n");
|
||||
m_text_value = m_text_editor->text();
|
||||
|
||||
Reference in New Issue
Block a user