mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 13:35:07 +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:
parent
abbcdba72e
commit
21c56477b0
18 changed files with 202 additions and 211 deletions
|
@ -15,10 +15,10 @@ GSpinBox::GSpinBox(GWidget* parent)
|
|||
m_editor->set_text(String::format("%d", m_value));
|
||||
};
|
||||
m_increment_button = new GButton(this);
|
||||
m_increment_button->set_caption("\xf6");
|
||||
m_increment_button->set_text("\xf6");
|
||||
m_increment_button->on_click = [this] (GButton&) { set_value(m_value + 1); };
|
||||
m_decrement_button = new GButton(this);
|
||||
m_decrement_button->set_caption("\xf7");
|
||||
m_decrement_button->set_text("\xf7");
|
||||
m_decrement_button->on_click = [this] (GButton&) { set_value(m_value - 1); };
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue