mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-31 15:32:51 +00:00
Userland: Set Button text using the new String class
This commit is contained in:
parent
b5cb9a9ebb
commit
e39adc4772
Notes:
sideshowbarker
2024-07-17 00:27:10 +09:00
Author: https://github.com/krkk
Commit: e39adc4772
Pull-request: https://github.com/SerenityOS/serenity/pull/17454
Reviewed-by: https://github.com/linusg ✅
49 changed files with 134 additions and 127 deletions
|
@ -111,12 +111,12 @@ CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window)
|
|||
};
|
||||
|
||||
auto& set_defaults_checkbox = main_widget->add<GUI::CheckBox>();
|
||||
set_defaults_checkbox.set_text_deprecated("Use these settings as default");
|
||||
set_defaults_checkbox.set_text(String::from_utf8("Use these settings as default"sv).release_value_but_fixme_should_propagate_errors());
|
||||
|
||||
auto& button_container = main_widget->add<GUI::Widget>();
|
||||
button_container.set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto& ok_button = button_container.add<GUI::Button>("OK");
|
||||
auto& ok_button = button_container.add<GUI::Button>(String::from_utf8_short_string("OK"sv));
|
||||
ok_button.on_click = [&](auto) {
|
||||
if (set_defaults_checkbox.is_checked()) {
|
||||
Config::write_string("PixelPaint"sv, "NewImage"sv, "Name"sv, m_image_name);
|
||||
|
@ -129,7 +129,7 @@ CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window)
|
|||
};
|
||||
ok_button.set_default(true);
|
||||
|
||||
auto& cancel_button = button_container.add<GUI::Button>("Cancel");
|
||||
auto& cancel_button = button_container.add<GUI::Button>(String::from_utf8_short_string("Cancel"sv));
|
||||
cancel_button.on_click = [this](auto) {
|
||||
done(ExecResult::Cancel);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue