1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:07:43 +00:00

Userland: Set Button text using the new String class

This commit is contained in:
Karol Kosek 2023-02-11 20:51:04 +01:00 committed by Linus Groh
parent b5cb9a9ebb
commit e39adc4772
49 changed files with 134 additions and 127 deletions

View file

@ -156,17 +156,17 @@ ErrorOr<void> PropertiesWindow::create_widgets(bool disable_rename)
button_widget->layout()->add_spacer();
auto ok_button = TRY(make_button("OK", button_widget));
auto ok_button = TRY(make_button(String::from_utf8_short_string("OK"sv), button_widget));
ok_button->on_click = [this](auto) {
if (apply_changes())
close();
};
auto cancel_button = TRY(make_button("Cancel", button_widget));
auto cancel_button = TRY(make_button(String::from_utf8_short_string("Cancel"sv), button_widget));
cancel_button->on_click = [this](auto) {
close();
};
m_apply_button = TRY(make_button("Apply", button_widget));
m_apply_button = TRY(make_button(String::from_utf8_short_string("Apply"sv), button_widget));
m_apply_button->on_click = [this](auto) { apply_changes(); };
m_apply_button->set_enabled(false);
@ -268,7 +268,7 @@ ErrorOr<void> PropertiesWindow::setup_permission_checkboxes(GUI::CheckBox& box_r
return {};
}
ErrorOr<NonnullRefPtr<GUI::Button>> PropertiesWindow::make_button(DeprecatedString text, GUI::Widget& parent)
ErrorOr<NonnullRefPtr<GUI::Button>> PropertiesWindow::make_button(String text, GUI::Widget& parent)
{
auto button = TRY(parent.try_add<GUI::Button>(text));
button->set_fixed_size(70, 22);