mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:17:35 +00:00
Userland: Set Button text using the new String class
This commit is contained in:
parent
b5cb9a9ebb
commit
e39adc4772
49 changed files with 134 additions and 127 deletions
|
@ -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);
|
||||
|
|
|
@ -79,7 +79,7 @@ private:
|
|||
return "Unknown";
|
||||
}
|
||||
|
||||
static ErrorOr<NonnullRefPtr<GUI::Button>> make_button(DeprecatedString, GUI::Widget& parent);
|
||||
static ErrorOr<NonnullRefPtr<GUI::Button>> make_button(String, GUI::Widget& parent);
|
||||
ErrorOr<void> setup_permission_checkboxes(GUI::CheckBox& box_read, GUI::CheckBox& box_write, GUI::CheckBox& box_execute, PermissionMasks masks, mode_t mode);
|
||||
void permission_changed(mode_t mask, bool set);
|
||||
bool apply_changes();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue