diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-05-24 16:32:20 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-24 16:32:20 +0200 |
commit | 21c56477b046a7e22c8cd7c675b9459ee794df43 (patch) | |
tree | b84b41dd6286480b35a559f5ec189629d3655430 /Applications | |
parent | abbcdba72e63f223c4207242f6d776abb6fdaa8b (diff) | |
download | serenity-21c56477b046a7e22c8cd7c675b9459ee794df43.zip |
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.
Diffstat (limited to 'Applications')
-rw-r--r-- | Applications/About/main.cpp | 2 | ||||
-rw-r--r-- | Applications/FontEditor/FontEditor.cpp | 4 | ||||
-rw-r--r-- | Applications/Taskbar/TaskbarWindow.cpp | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/Applications/About/main.cpp b/Applications/About/main.cpp index 5bafc60c0e..e05fd3a7fc 100644 --- a/Applications/About/main.cpp +++ b/Applications/About/main.cpp @@ -46,7 +46,7 @@ int main(int argc, char** argv) version_label->set_preferred_size({ 0, 11 }); auto* quit_button = new GButton(widget); - quit_button->set_caption("Okay"); + quit_button->set_text("Okay"); quit_button->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed); quit_button->set_preferred_size({ 100, 20 }); quit_button->on_click = [] (GButton&) { diff --git a/Applications/FontEditor/FontEditor.cpp b/Applications/FontEditor/FontEditor.cpp index 0fa7cd1686..0d6be9e57e 100644 --- a/Applications/FontEditor/FontEditor.cpp +++ b/Applications/FontEditor/FontEditor.cpp @@ -50,7 +50,7 @@ FontEditorWidget::FontEditorWidget(const String& path, RetainPtr<Font>&& edited_ }; auto* save_button = new GButton(this); - save_button->set_caption("Save"); + save_button->set_text("Save"); save_button->set_relative_rect({ 5, 300, 105, 20 }); save_button->on_click = [this] (GButton&) { dbgprintf("write to file: '%s'\n", m_path.characters()); @@ -58,7 +58,7 @@ FontEditorWidget::FontEditorWidget(const String& path, RetainPtr<Font>&& edited_ }; auto* quit_button = new GButton(this); - quit_button->set_caption("Quit"); + quit_button->set_text("Quit"); quit_button->set_relative_rect({ 110, 300, 105, 20 }); quit_button->on_click = [] (GButton&) { exit(0); diff --git a/Applications/Taskbar/TaskbarWindow.cpp b/Applications/Taskbar/TaskbarWindow.cpp index 126a60bd73..c8189c1940 100644 --- a/Applications/Taskbar/TaskbarWindow.cpp +++ b/Applications/Taskbar/TaskbarWindow.cpp @@ -125,10 +125,10 @@ void TaskbarWindow::wm_event(GWMEvent& event) window.set_minimized(changed_event.is_minimized()); if (window.is_minimized()) { window.button()->set_foreground_color(Color::DarkGray); - window.button()->set_caption(String::format("[%s]", changed_event.title().characters())); + window.button()->set_text(String::format("[%s]", changed_event.title().characters())); } else { window.button()->set_foreground_color(Color::Black); - window.button()->set_caption(changed_event.title()); + window.button()->set_text(changed_event.title()); } window.button()->set_checked(changed_event.is_active()); break; |