mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +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:
@@ -114,7 +114,7 @@ GFilePicker::GFilePicker(const String& path, CObject* parent)
|
||||
auto* cancel_button = new GButton(button_container);
|
||||
cancel_button->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill);
|
||||
cancel_button->set_preferred_size({ 80, 0 });
|
||||
cancel_button->set_caption("Cancel");
|
||||
cancel_button->set_text("Cancel");
|
||||
cancel_button->on_click = [this] (auto&) {
|
||||
done(ExecCancel);
|
||||
};
|
||||
@@ -122,7 +122,7 @@ GFilePicker::GFilePicker(const String& path, CObject* parent)
|
||||
auto* ok_button = new GButton(button_container);
|
||||
ok_button->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill);
|
||||
ok_button->set_preferred_size({ 80, 0 });
|
||||
ok_button->set_caption("OK");
|
||||
ok_button->set_text("OK");
|
||||
ok_button->on_click = [this, filename_textbox] (auto&) {
|
||||
FileSystemPath path(String::format("%s/%s", m_model->path().characters(), filename_textbox->text().characters()));
|
||||
m_selected_file = path.string();
|
||||
|
||||
Reference in New Issue
Block a user