diff options
Diffstat (limited to 'Userland')
49 files changed, 134 insertions, 127 deletions
diff --git a/Userland/Applets/Audio/main.cpp b/Userland/Applets/Audio/main.cpp index a7607a9bdd..01135dd17d 100644 --- a/Userland/Applets/Audio/main.cpp +++ b/Userland/Applets/Audio/main.cpp @@ -87,7 +87,7 @@ private: m_root_container->layout()->set_spacing(0); m_root_container->set_frame_shape(Gfx::FrameShape::Window); - m_percent_box = m_root_container->add<GUI::CheckBox>("\xE2\x84\xB9"); + m_percent_box = m_root_container->add<GUI::CheckBox>(String::from_utf8_short_string("\xE2\x84\xB9"sv)); m_percent_box->set_tooltip(m_show_percent ? "Hide percent" : "Show percent"); m_percent_box->set_checked(m_show_percent); m_percent_box->on_checked = [&](bool show_percent) { @@ -112,7 +112,7 @@ private: update(); }; - m_mute_box = m_root_container->add<GUI::CheckBox>("\xE2\x9D\x8C"); + m_mute_box = m_root_container->add<GUI::CheckBox>(String::from_utf8_short_string("\xE2\x9D\x8C"sv)); m_mute_box->set_checked(m_audio_muted); m_mute_box->set_tooltip(m_audio_muted ? "Unmute" : "Mute"); m_mute_box->on_checked = [&](bool is_muted) { diff --git a/Userland/Applications/Assistant/main.cpp b/Userland/Applications/Assistant/main.cpp index 55e04052da..8a3da7be54 100644 --- a/Userland/Applications/Assistant/main.cpp +++ b/Userland/Applications/Assistant/main.cpp @@ -256,7 +256,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) auto& result = app_state.results[i]; auto& match = results_container.add<Assistant::ResultRow>(); match.set_icon(result.bitmap()); - match.set_text_deprecated(move(result.title())); + match.set_text(String::from_deprecated_string(result.title()).release_value_but_fixme_should_propagate_errors()); match.set_tooltip(move(result.tooltip())); match.on_click = [&result](auto) { result.activate(); diff --git a/Userland/Applications/Browser/BookmarksBarWidget.cpp b/Userland/Applications/Browser/BookmarksBarWidget.cpp index 069de668fc..9166057b48 100644 --- a/Userland/Applications/Browser/BookmarksBarWidget.cpp +++ b/Userland/Applications/Browser/BookmarksBarWidget.cpp @@ -205,7 +205,7 @@ void BookmarksBarWidget::model_did_update(unsigned) m_bookmarks.append(button); button.set_button_style(Gfx::ButtonStyle::Coolbar); - button.set_text_deprecated(title); + button.set_text(String::from_deprecated_string(title).release_value_but_fixme_should_propagate_errors()); button.set_icon(g_icon_bag.filetype_html); button.set_fixed_size(font().width(title) + 32, 20); button.set_relative_rect(rect); diff --git a/Userland/Applications/Browser/DownloadWidget.cpp b/Userland/Applications/Browser/DownloadWidget.cpp index 19a679b148..db3a1fab8d 100644 --- a/Userland/Applications/Browser/DownloadWidget.cpp +++ b/Userland/Applications/Browser/DownloadWidget.cpp @@ -86,7 +86,7 @@ DownloadWidget::DownloadWidget(const URL& url) destination_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); destination_label.set_fixed_height(16); - m_close_on_finish_checkbox = add<GUI::CheckBox>("Close when finished"); + m_close_on_finish_checkbox = add<GUI::CheckBox>(String::from_utf8("Close when finished"sv).release_value_but_fixme_should_propagate_errors()); m_close_on_finish_checkbox->set_checked(close_on_finish); m_close_on_finish_checkbox->on_checked = [&](bool checked) { @@ -96,7 +96,7 @@ DownloadWidget::DownloadWidget(const URL& url) auto& button_container = add<GUI::Widget>(); auto& button_container_layout = button_container.set_layout<GUI::HorizontalBoxLayout>(); button_container_layout.add_spacer(); - m_cancel_button = button_container.add<GUI::Button>("Cancel"); + m_cancel_button = button_container.add<GUI::Button>(String::from_utf8_short_string("Cancel"sv)); m_cancel_button->set_fixed_size(100, 22); m_cancel_button->on_click = [this](auto) { bool success = m_download->stop(); @@ -104,7 +104,7 @@ DownloadWidget::DownloadWidget(const URL& url) window()->close(); }; - m_close_button = button_container.add<GUI::Button>("OK"); + m_close_button = button_container.add<GUI::Button>(String::from_utf8_short_string("OK"sv)); m_close_button->set_enabled(false); m_close_button->set_fixed_size(100, 22); m_close_button->on_click = [this](auto) { @@ -153,7 +153,7 @@ void DownloadWidget::did_finish(bool success) m_browser_image->load_from_file("/res/graphics/download-finished.gif"sv); window()->set_title("Download finished!"); m_close_button->set_enabled(true); - m_cancel_button->set_text_deprecated("Open in Folder"); + m_cancel_button->set_text(String::from_utf8("Open in Folder"sv).release_value_but_fixme_should_propagate_errors()); m_cancel_button->on_click = [this](auto) { Desktop::Launcher::open(URL::create_with_file_scheme(Core::StandardPaths::downloads_directory(), m_url.basename())); window()->close(); diff --git a/Userland/Applications/Calculator/RoundingDialog.cpp b/Userland/Applications/Calculator/RoundingDialog.cpp index 3e2e0c3e50..8bda2d898f 100644 --- a/Userland/Applications/Calculator/RoundingDialog.cpp +++ b/Userland/Applications/Calculator/RoundingDialog.cpp @@ -46,8 +46,8 @@ RoundingDialog::RoundingDialog(GUI::Window* parent_window, StringView title) m_rounding_spinbox = GUI::SpinBox::construct(); m_buttons_container = GUI::Widget::construct(); - m_ok_button = GUI::DialogButton::construct("OK"); - m_cancel_button = GUI::DialogButton::construct("Cancel"); + m_ok_button = GUI::DialogButton::construct(String::from_utf8_short_string("OK"sv)); + m_cancel_button = GUI::DialogButton::construct(String::from_utf8_short_string("Cancel"sv)); main_widget->add_child(*m_rounding_spinbox); main_widget->add_child(*m_buttons_container); diff --git a/Userland/Applications/Calendar/AddEventDialog.cpp b/Userland/Applications/Calendar/AddEventDialog.cpp index 058bd52cdd..945ad8760f 100644 --- a/Userland/Applications/Calendar/AddEventDialog.cpp +++ b/Userland/Applications/Calendar/AddEventDialog.cpp @@ -93,7 +93,7 @@ AddEventDialog::AddEventDialog(Core::DateTime date_time, Window* parent_window) button_container.set_fixed_height(20); button_container.set_layout<GUI::HorizontalBoxLayout>(); button_container.layout()->add_spacer(); - 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.set_fixed_size(80, 20); ok_button.on_click = [this](auto) { dbgln("TODO: Add event icon on specific tile"); diff --git a/Userland/Applications/FileManager/PropertiesWindow.cpp b/Userland/Applications/FileManager/PropertiesWindow.cpp index 310f218137..75632ab82d 100644 --- a/Userland/Applications/FileManager/PropertiesWindow.cpp +++ b/Userland/Applications/FileManager/PropertiesWindow.cpp @@ -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); diff --git a/Userland/Applications/FileManager/PropertiesWindow.h b/Userland/Applications/FileManager/PropertiesWindow.h index ae6ab20819..030342d074 100644 --- a/Userland/Applications/FileManager/PropertiesWindow.h +++ b/Userland/Applications/FileManager/PropertiesWindow.h @@ -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(); diff --git a/Userland/Applications/HexEditor/FindDialog.cpp b/Userland/Applications/HexEditor/FindDialog.cpp index 739a31dbe2..fb3098010c 100644 --- a/Userland/Applications/HexEditor/FindDialog.cpp +++ b/Userland/Applications/HexEditor/FindDialog.cpp @@ -112,7 +112,7 @@ FindDialog::FindDialog() auto action = options[i]; auto& radio = radio_container.add<GUI::RadioButton>(); radio.set_enabled(action.enabled); - radio.set_text_deprecated(action.title); + radio.set_text(String::from_deprecated_string(action.title).release_value_but_fixme_should_propagate_errors()); radio.on_checked = [this, i](auto) { m_selected_option = options[i].opt; diff --git a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp index 85bc04b8ce..a602dbaf10 100644 --- a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp +++ b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp @@ -52,7 +52,7 @@ void KeyboardMapperWidget::create_frame() auto& tmp_button = main_widget.add<KeyButton>(); tmp_button.set_relative_rect(rect); - tmp_button.set_text_deprecated(keys[i].name); + tmp_button.set_text(String::from_deprecated_string(keys[i].name).release_value_but_fixme_should_propagate_errors()); tmp_button.set_enabled(keys[i].enabled); tmp_button.on_click = [this, &tmp_button]() { @@ -64,7 +64,7 @@ void KeyboardMapperWidget::create_frame() auto index = keys[i].map_index; VERIFY(index > 0); - tmp_button.set_text_deprecated(value); + tmp_button.set_text(String::from_deprecated_string(value).release_value_but_fixme_should_propagate_errors()); u32* map = map_from_name(m_current_map_name); if (value.length() == 0) @@ -89,16 +89,16 @@ void KeyboardMapperWidget::create_frame() m_map_group->set_layout<GUI::HorizontalBoxLayout>(); m_map_group->set_fixed_width(450); - add_map_radio_button("map"sv, "Default"sv); - add_map_radio_button("shift_map"sv, "Shift"sv); - add_map_radio_button("altgr_map"sv, "AltGr"sv); - add_map_radio_button("alt_map"sv, "Alt"sv); - add_map_radio_button("shift_altgr_map"sv, "Shift+AltGr"sv); + add_map_radio_button("map"sv, String::from_utf8_short_string("Default"sv)); + add_map_radio_button("shift_map"sv, String::from_utf8_short_string("Shift"sv)); + add_map_radio_button("altgr_map"sv, String::from_utf8_short_string("AltGr"sv)); + add_map_radio_button("alt_map"sv, String::from_utf8_short_string("Alt"sv)); + add_map_radio_button("shift_altgr_map"sv, String::from_utf8("Shift+AltGr"sv).release_value_but_fixme_should_propagate_errors()); bottom_widget.layout()->add_spacer(); } -void KeyboardMapperWidget::add_map_radio_button(const StringView map_name, const StringView button_text) +void KeyboardMapperWidget::add_map_radio_button(const StringView map_name, String button_text) { auto& map_radio_button = m_map_group->add<GUI::RadioButton>(button_text); map_radio_button.set_name(map_name); @@ -248,7 +248,7 @@ void KeyboardMapperWidget::set_current_map(const DeprecatedString current_map) StringBuilder sb; sb.append_code_point(map[index]); - m_keys.at(k)->set_text_deprecated(sb.to_deprecated_string()); + m_keys.at(k)->set_text(sb.to_string().release_value_but_fixme_should_propagate_errors()); } this->update(); diff --git a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h index 5ada870a38..fcd14be56e 100644 --- a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h +++ b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h @@ -39,7 +39,7 @@ private: Vector<KeyButton*> m_keys; RefPtr<GUI::Widget> m_map_group; - void add_map_radio_button(const StringView map_name, const StringView button_text); + void add_map_radio_button(const StringView map_name, String button_text); u32* map_from_name(const StringView map_name); void update_modifier_radio_buttons(GUI::KeyEvent&); diff --git a/Userland/Applications/PDFViewer/PDFViewerWidget.cpp b/Userland/Applications/PDFViewer/PDFViewerWidget.cpp index a0b72ebbbb..1f4d91b376 100644 --- a/Userland/Applications/PDFViewer/PDFViewerWidget.cpp +++ b/Userland/Applications/PDFViewer/PDFViewerWidget.cpp @@ -340,11 +340,11 @@ void PDFViewerWidget::initialize_toolbar(GUI::Toolbar& toolbar) toolbar.add_separator(); m_show_clipping_paths = toolbar.add<GUI::CheckBox>(); - m_show_clipping_paths->set_text_deprecated("Show clipping paths"); + m_show_clipping_paths->set_text(String::from_utf8("Show clipping paths"sv).release_value_but_fixme_should_propagate_errors()); m_show_clipping_paths->set_checked(m_viewer->show_clipping_paths(), GUI::AllowCallback::No); m_show_clipping_paths->on_checked = [&](auto checked) { m_viewer->set_show_clipping_paths(checked); }; m_show_images = toolbar.add<GUI::CheckBox>(); - m_show_images->set_text_deprecated("Show images"); + m_show_images->set_text(String::from_utf8("Show images"sv).release_value_but_fixme_should_propagate_errors()); m_show_images->set_checked(m_viewer->show_images(), GUI::AllowCallback::No); m_show_images->on_checked = [&](auto checked) { m_viewer->set_show_images(checked); }; } diff --git a/Userland/Applications/PixelPaint/CreateNewImageDialog.cpp b/Userland/Applications/PixelPaint/CreateNewImageDialog.cpp index 9fc5d1ae8a..51999deca5 100644 --- a/Userland/Applications/PixelPaint/CreateNewImageDialog.cpp +++ b/Userland/Applications/PixelPaint/CreateNewImageDialog.cpp @@ -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); }; diff --git a/Userland/Applications/PixelPaint/CreateNewLayerDialog.cpp b/Userland/Applications/PixelPaint/CreateNewLayerDialog.cpp index f8fd22806f..f22569127a 100644 --- a/Userland/Applications/PixelPaint/CreateNewLayerDialog.cpp +++ b/Userland/Applications/PixelPaint/CreateNewLayerDialog.cpp @@ -49,13 +49,13 @@ CreateNewLayerDialog::CreateNewLayerDialog(Gfx::IntSize suggested_size, GUI::Win 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 = [this](auto) { done(ExecResult::OK); }; 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); }; diff --git a/Userland/Applications/PixelPaint/FilterParams.h b/Userland/Applications/PixelPaint/FilterParams.h index 58568ccf26..30c14168aa 100644 --- a/Userland/Applications/PixelPaint/FilterParams.h +++ b/Userland/Applications/PixelPaint/FilterParams.h @@ -81,13 +81,13 @@ private: } } - auto& norm_checkbox = main_widget->template add<GUI::CheckBox>("Normalize"); + auto& norm_checkbox = main_widget->template add<GUI::CheckBox>(String::from_utf8("Normalize"sv).release_value_but_fixme_should_propagate_errors()); norm_checkbox.set_checked(false); - auto& wrap_checkbox = main_widget->template add<GUI::CheckBox>("Wrap"); + auto& wrap_checkbox = main_widget->template add<GUI::CheckBox>(String::from_utf8_short_string("Wrap"sv)); wrap_checkbox.set_checked(m_should_wrap); - auto& button = main_widget->template add<GUI::Button>("Done"); + auto& button = main_widget->template add<GUI::Button>(String::from_utf8_short_string("Done"sv)); button.on_click = [&](auto) { m_should_wrap = wrap_checkbox.is_checked(); if (norm_checkbox.is_checked()) diff --git a/Userland/Applications/PixelPaint/Filters/FastBoxBlur.cpp b/Userland/Applications/PixelPaint/Filters/FastBoxBlur.cpp index a5279c223c..7574b984ce 100644 --- a/Userland/Applications/PixelPaint/Filters/FastBoxBlur.cpp +++ b/Userland/Applications/PixelPaint/Filters/FastBoxBlur.cpp @@ -47,7 +47,7 @@ RefPtr<GUI::Widget> FastBoxBlur::get_settings_widget() name_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); name_label.set_fixed_height(10); - auto& asymmetric_checkbox = m_settings_widget->add<GUI::CheckBox>("Use Asymmetric Radii"); + auto& asymmetric_checkbox = m_settings_widget->add<GUI::CheckBox>(String::from_utf8("Use Asymmetric Radii"sv).release_value_but_fixme_should_propagate_errors()); asymmetric_checkbox.set_checked(false); asymmetric_checkbox.set_fixed_height(15); asymmetric_checkbox.on_checked = [&](bool checked) { @@ -68,7 +68,7 @@ RefPtr<GUI::Widget> FastBoxBlur::get_settings_widget() update_preview(); }; - m_vector_checkbox = m_settings_widget->add<GUI::CheckBox>("Use Direction and magnitude"); + m_vector_checkbox = m_settings_widget->add<GUI::CheckBox>(String::from_utf8("Use Direction and magnitude"sv).release_value_but_fixme_should_propagate_errors()); m_vector_checkbox->set_checked(false); m_vector_checkbox->set_visible(false); m_vector_checkbox->set_fixed_height(15); @@ -182,7 +182,7 @@ RefPtr<GUI::Widget> FastBoxBlur::get_settings_widget() gaussian_container.set_layout<GUI::HorizontalBoxLayout>(); gaussian_container.layout()->set_margins({ 4, 0, 4, 0 }); - m_gaussian_checkbox = gaussian_container.add<GUI::CheckBox>("Approximate Gaussian Blur"); + m_gaussian_checkbox = gaussian_container.add<GUI::CheckBox>(String::from_utf8("Approximate Gaussian Blur"sv).release_value_but_fixme_should_propagate_errors()); m_gaussian_checkbox->set_checked(m_approximate_gauss); m_gaussian_checkbox->set_tooltip("A real gaussian blur can be approximated by running the box blur multiple times with different weights."); m_gaussian_checkbox->on_checked = [this](bool checked) { diff --git a/Userland/Applications/PixelPaint/LayerPropertiesWidget.cpp b/Userland/Applications/PixelPaint/LayerPropertiesWidget.cpp index c0addb4d96..96ec8d72da 100644 --- a/Userland/Applications/PixelPaint/LayerPropertiesWidget.cpp +++ b/Userland/Applications/PixelPaint/LayerPropertiesWidget.cpp @@ -58,7 +58,7 @@ LayerPropertiesWidget::LayerPropertiesWidget() m_layer->set_opacity_percent(value); }; - m_visibility_checkbox = group_box.add<GUI::CheckBox>("Visible"); + m_visibility_checkbox = group_box.add<GUI::CheckBox>(String::from_utf8_short_string("Visible"sv)); m_visibility_checkbox->set_fixed_height(20); m_visibility_checkbox->on_checked = [this](bool checked) { if (m_layer) diff --git a/Userland/Applications/PixelPaint/Tools/EllipseTool.cpp b/Userland/Applications/PixelPaint/Tools/EllipseTool.cpp index 893005277c..d349ae0705 100644 --- a/Userland/Applications/PixelPaint/Tools/EllipseTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/EllipseTool.cpp @@ -157,9 +157,9 @@ GUI::Widget* EllipseTool::get_properties_widget() auto& mode_radio_container = mode_container.add<GUI::Widget>(); mode_radio_container.set_layout<GUI::VerticalBoxLayout>(); - auto& outline_mode_radio = mode_radio_container.add<GUI::RadioButton>("Outline"); - auto& fill_mode_radio = mode_radio_container.add<GUI::RadioButton>("Fill"); - auto& aa_enable_checkbox = mode_radio_container.add<GUI::CheckBox>("Anti-alias"); + auto& outline_mode_radio = mode_radio_container.add<GUI::RadioButton>(String::from_utf8_short_string("Outline"sv)); + auto& fill_mode_radio = mode_radio_container.add<GUI::RadioButton>(String::from_utf8_short_string("Fill"sv)); + auto& aa_enable_checkbox = mode_radio_container.add<GUI::CheckBox>(String::from_utf8("Anti-alias"sv).release_value_but_fixme_should_propagate_errors()); aa_enable_checkbox.on_checked = [&](bool checked) { m_antialias_enabled = checked; diff --git a/Userland/Applications/PixelPaint/Tools/EraseTool.cpp b/Userland/Applications/PixelPaint/Tools/EraseTool.cpp index 0b83e5dd30..8d22fa4836 100644 --- a/Userland/Applications/PixelPaint/Tools/EraseTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/EraseTool.cpp @@ -100,7 +100,7 @@ GUI::Widget* EraseTool::get_properties_widget() auto& use_secondary_color_checkbox = secondary_color_container.add<GUI::CheckBox>(); use_secondary_color_checkbox.set_checked(m_use_secondary_color); - use_secondary_color_checkbox.set_text_deprecated("Use secondary color"); + use_secondary_color_checkbox.set_text(String::from_utf8("Use secondary color"sv).release_value_but_fixme_should_propagate_errors()); use_secondary_color_checkbox.on_checked = [&](bool checked) { m_use_secondary_color = checked; }; @@ -114,8 +114,8 @@ GUI::Widget* EraseTool::get_properties_widget() auto& mode_radio_container = mode_container.add<GUI::Widget>(); mode_radio_container.set_layout<GUI::VerticalBoxLayout>(); - auto& pencil_mode_radio = mode_radio_container.add<GUI::RadioButton>("Pencil"); - auto& brush_mode_radio = mode_radio_container.add<GUI::RadioButton>("Brush"); + auto& pencil_mode_radio = mode_radio_container.add<GUI::RadioButton>(String::from_utf8_short_string("Pencil"sv)); + auto& brush_mode_radio = mode_radio_container.add<GUI::RadioButton>(String::from_utf8_short_string("Brush"sv)); pencil_mode_radio.on_checked = [&](bool) { m_draw_mode = DrawMode::Pencil; diff --git a/Userland/Applications/PixelPaint/Tools/GradientTool.cpp b/Userland/Applications/PixelPaint/Tools/GradientTool.cpp index cfe591dac8..9d035f00ae 100644 --- a/Userland/Applications/PixelPaint/Tools/GradientTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/GradientTool.cpp @@ -203,7 +203,7 @@ GUI::Widget* GradientTool::get_properties_widget() auto& button_container_layout = button_container.set_layout<GUI::HorizontalBoxLayout>(); button_container_layout.add_spacer(); - auto& apply_button = button_container.add<GUI::DialogButton>("Apply"); + auto& apply_button = button_container.add<GUI::DialogButton>(String::from_utf8_short_string("Apply"sv)); apply_button.on_click = [this](auto) { rasterize_gradient(); }; diff --git a/Userland/Applications/PixelPaint/Tools/LineTool.cpp b/Userland/Applications/PixelPaint/Tools/LineTool.cpp index 0d08b4bd3e..da7fd8db3c 100644 --- a/Userland/Applications/PixelPaint/Tools/LineTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/LineTool.cpp @@ -150,7 +150,7 @@ GUI::Widget* LineTool::get_properties_widget() mode_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); mode_label.set_fixed_size(80, 20); - auto& aa_enable_checkbox = mode_container.add<GUI::CheckBox>("Anti-alias"); + auto& aa_enable_checkbox = mode_container.add<GUI::CheckBox>(String::from_utf8("Anti-alias"sv).release_value_but_fixme_should_propagate_errors()); aa_enable_checkbox.on_checked = [&](bool checked) { m_antialias_enabled = checked; }; diff --git a/Userland/Applications/PixelPaint/Tools/MoveTool.cpp b/Userland/Applications/PixelPaint/Tools/MoveTool.cpp index acbe1d8618..0816e3939d 100644 --- a/Userland/Applications/PixelPaint/Tools/MoveTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/MoveTool.cpp @@ -304,9 +304,9 @@ GUI::Widget* MoveTool::get_properties_widget() auto& mode_radio_container = selection_mode_container.add<GUI::Widget>(); mode_radio_container.set_layout<GUI::VerticalBoxLayout>(); - m_selection_mode_foreground = mode_radio_container.add<GUI::RadioButton>("Foreground"); + m_selection_mode_foreground = mode_radio_container.add<GUI::RadioButton>(String::from_utf8("Foreground"sv).release_value_but_fixme_should_propagate_errors()); - m_selection_mode_active = mode_radio_container.add<GUI::RadioButton>("Active Layer"); + m_selection_mode_active = mode_radio_container.add<GUI::RadioButton>(String::from_utf8("Active Layer"sv).release_value_but_fixme_should_propagate_errors()); m_selection_mode_foreground->on_checked = [&](bool) { m_layer_selection_mode = LayerSelectionMode::ForegroundLayer; diff --git a/Userland/Applications/PixelPaint/Tools/PickerTool.cpp b/Userland/Applications/PixelPaint/Tools/PickerTool.cpp index 6c986efbf2..e78bc6852e 100644 --- a/Userland/Applications/PixelPaint/Tools/PickerTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/PickerTool.cpp @@ -46,7 +46,7 @@ GUI::Widget* PickerTool::get_properties_widget() m_properties_widget = GUI::Widget::construct(); m_properties_widget->set_layout<GUI::VerticalBoxLayout>(); - auto& sample_checkbox = m_properties_widget->add<GUI::CheckBox>("Sample all layers"); + auto& sample_checkbox = m_properties_widget->add<GUI::CheckBox>(String::from_utf8("Sample all layers"sv).release_value_but_fixme_should_propagate_errors()); sample_checkbox.set_checked(m_sample_all_layers); sample_checkbox.on_checked = [&](bool value) { m_sample_all_layers = value; diff --git a/Userland/Applications/PixelPaint/Tools/RectangleTool.cpp b/Userland/Applications/PixelPaint/Tools/RectangleTool.cpp index f49f169ea5..7c08ff7273 100644 --- a/Userland/Applications/PixelPaint/Tools/RectangleTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/RectangleTool.cpp @@ -187,12 +187,12 @@ GUI::Widget* RectangleTool::get_properties_widget() auto& mode_radio_container = mode_container.add<GUI::Widget>(); mode_radio_container.set_layout<GUI::VerticalBoxLayout>(); - auto& outline_mode_radio = mode_radio_container.add<GUI::RadioButton>("Outline"); - auto& fill_mode_radio = mode_radio_container.add<GUI::RadioButton>("Fill"); - auto& gradient_mode_radio = mode_radio_container.add<GUI::RadioButton>("Gradient"); + auto& outline_mode_radio = mode_radio_container.add<GUI::RadioButton>(String::from_utf8_short_string("Outline"sv)); + auto& fill_mode_radio = mode_radio_container.add<GUI::RadioButton>(String::from_utf8_short_string("Fill"sv)); + auto& gradient_mode_radio = mode_radio_container.add<GUI::RadioButton>(String::from_utf8("Gradient"sv).release_value_but_fixme_should_propagate_errors()); mode_radio_container.set_fixed_width(70); - auto& rounded_corners_mode_radio = mode_radio_container.add<GUI::RadioButton>("Rounded"); + auto& rounded_corners_mode_radio = mode_radio_container.add<GUI::RadioButton>(String::from_utf8_short_string("Rounded"sv)); outline_mode_radio.on_checked = [&, update_slider](bool) { m_fill_mode = FillMode::Outline; @@ -215,7 +215,7 @@ GUI::Widget* RectangleTool::get_properties_widget() auto& mode_extras_container = mode_container.add<GUI::Widget>(); mode_extras_container.set_layout<GUI::VerticalBoxLayout>(); - auto& aa_enable_checkbox = mode_extras_container.add<GUI::CheckBox>("Anti-alias"); + auto& aa_enable_checkbox = mode_extras_container.add<GUI::CheckBox>(String::from_utf8("Anti-alias"sv).release_value_but_fixme_should_propagate_errors()); aa_enable_checkbox.on_checked = [&](bool checked) { m_antialias_enabled = checked; }; diff --git a/Userland/Applications/PixelPaint/Tools/TextTool.cpp b/Userland/Applications/PixelPaint/Tools/TextTool.cpp index 362553ebbf..f03a0d30f5 100644 --- a/Userland/Applications/PixelPaint/Tools/TextTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/TextTool.cpp @@ -112,7 +112,7 @@ GUI::Widget* TextTool::get_properties_widget() m_font_label = m_properties_widget->add<GUI::Label>(m_selected_font->human_readable_name()); - auto& change_font_button = m_properties_widget->add<GUI::Button>("Change Font..."); + auto& change_font_button = m_properties_widget->add<GUI::Button>(String::from_utf8("Change Font..."sv).release_value_but_fixme_should_propagate_errors()); change_font_button.on_click = [&](auto) { auto picker = GUI::FontPicker::construct(nullptr, m_selected_font, false); if (picker->exec() == GUI::Dialog::ExecResult::OK) { diff --git a/Userland/Applications/Spreadsheet/CellTypeDialog.cpp b/Userland/Applications/Spreadsheet/CellTypeDialog.cpp index 85fbe7f43c..c1ef552e9c 100644 --- a/Userland/Applications/Spreadsheet/CellTypeDialog.cpp +++ b/Userland/Applications/Spreadsheet/CellTypeDialog.cpp @@ -57,7 +57,7 @@ CellTypeDialog::CellTypeDialog(Vector<Position> const& positions, Sheet& sheet, auto& button_layout = buttonbox.set_layout<GUI::HorizontalBoxLayout>(); button_layout.set_spacing(10); button_layout.add_spacer(); - auto& ok_button = buttonbox.add<GUI::Button>("OK"); + auto& ok_button = buttonbox.add<GUI::Button>(String::from_utf8_short_string("OK"sv)); ok_button.set_fixed_width(80); ok_button.on_click = [&](auto) { done(ExecResult::OK); }; } @@ -158,7 +158,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector<Position> const& po }; { - auto& checkbox = right_side.add<GUI::CheckBox>("Override max length"); + auto& checkbox = right_side.add<GUI::CheckBox>(String::from_utf8("Override max length"sv).release_value_but_fixme_should_propagate_errors()); auto& spinbox = right_side.add<GUI::SpinBox>(); checkbox.set_checked(m_length != -1); spinbox.set_min(0); @@ -178,7 +178,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector<Position> const& po }; } { - auto& checkbox = right_side.add<GUI::CheckBox>("Override display format"); + auto& checkbox = right_side.add<GUI::CheckBox>(String::from_utf8("Override display format"sv).release_value_but_fixme_should_propagate_errors()); auto& editor = right_side.add<GUI::TextEditor>(); checkbox.set_checked(!m_format.is_empty()); editor.set_name("format_editor"); diff --git a/Userland/Applications/Terminal/main.cpp b/Userland/Applications/Terminal/main.cpp index 6414a3e23f..a2e5a591b0 100644 --- a/Userland/Applications/Terminal/main.cpp +++ b/Userland/Applications/Terminal/main.cpp @@ -203,8 +203,8 @@ static ErrorOr<NonnullRefPtr<GUI::Window>> create_find_window(VT::TerminalWidget find_forwards->click(); }; - auto match_case = TRY(main_widget->try_add<GUI::CheckBox>("Case sensitive")); - auto wrap_around = TRY(main_widget->try_add<GUI::CheckBox>("Wrap around")); + auto match_case = TRY(main_widget->try_add<GUI::CheckBox>(TRY(String::from_utf8("Case sensitive"sv)))); + auto wrap_around = TRY(main_widget->try_add<GUI::CheckBox>(TRY(String::from_utf8("Wrap around"sv)))); find_backwards->on_click = [&terminal, find_textbox, match_case, wrap_around](auto) { auto needle = find_textbox->text(); diff --git a/Userland/Applications/ThemeEditor/MainWidget.cpp b/Userland/Applications/ThemeEditor/MainWidget.cpp index 65702c6b2a..ef8131d3d4 100644 --- a/Userland/Applications/ThemeEditor/MainWidget.cpp +++ b/Userland/Applications/ThemeEditor/MainWidget.cpp @@ -487,7 +487,7 @@ ErrorOr<void> MainWidget::add_property_tab(PropertyTab const& property_tab) TRY(row_widget->load_from_gml(flag_property_gml)); auto& checkbox = *row_widget->find_descendant_of_type_named<GUI::CheckBox>("checkbox"); - checkbox.set_text_deprecated(to_string(role)); + checkbox.set_text(String::from_deprecated_string(DeprecatedString(to_string(role))).release_value_but_fixme_should_propagate_errors()); checkbox.on_checked = [&, role](bool checked) { set_flag(role, checked); }; diff --git a/Userland/DevTools/HackStudio/FindInFilesWidget.cpp b/Userland/DevTools/HackStudio/FindInFilesWidget.cpp index fe5be0354c..410662e094 100644 --- a/Userland/DevTools/HackStudio/FindInFilesWidget.cpp +++ b/Userland/DevTools/HackStudio/FindInFilesWidget.cpp @@ -122,7 +122,7 @@ FindInFilesWidget::FindInFilesWidget() m_textbox = top_container.add<GUI::TextBox>(); - m_button = top_container.add<GUI::Button>("Find in files"); + m_button = top_container.add<GUI::Button>(String::from_utf8("Find in files"sv).release_value_but_fixme_should_propagate_errors()); m_button->set_fixed_width(100); m_result_view = add<GUI::TableView>(); diff --git a/Userland/DevTools/Inspector/main.cpp b/Userland/DevTools/Inspector/main.cpp index 9cd03cdb57..b16a8d418b 100644 --- a/Userland/DevTools/Inspector/main.cpp +++ b/Userland/DevTools/Inspector/main.cpp @@ -51,7 +51,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-inspector"sv)); if (gui_mode) { choose_pid: - auto process_chooser = TRY(GUI::ProcessChooser::try_create("Inspector"sv, "Inspect"sv, app_icon.bitmap_for_size(16))); + auto process_chooser = TRY(GUI::ProcessChooser::try_create("Inspector"sv, String::from_utf8_short_string("Inspect"sv), app_icon.bitmap_for_size(16))); if (process_chooser->exec() == GUI::Dialog::ExecResult::Cancel) return 0; pid = process_chooser->pid(); diff --git a/Userland/DevTools/Profiler/main.cpp b/Userland/DevTools/Profiler/main.cpp index f1c1b84064..f7580001a6 100644 --- a/Userland/DevTools/Profiler/main.cpp +++ b/Userland/DevTools/Profiler/main.cpp @@ -331,7 +331,7 @@ static bool prompt_to_stop_profiling(pid_t pid, DeprecatedString const& process_ }).release_value_but_fixme_should_propagate_errors(); update_timer->start(); - auto& stop_button = widget->add<GUI::Button>("Stop"); + auto& stop_button = widget->add<GUI::Button>(String::from_utf8_short_string("Stop"sv)); stop_button.set_fixed_size(140, 22); stop_button.on_click = [&](auto) { GUI::Application::the()->quit(); @@ -344,7 +344,7 @@ static bool prompt_to_stop_profiling(pid_t pid, DeprecatedString const& process_ bool generate_profile(pid_t& pid) { if (!pid) { - auto process_chooser = GUI::ProcessChooser::construct("Profiler"sv, "Profile"sv, Gfx::Bitmap::load_from_file("/res/icons/16x16/app-profiler.png"sv).release_value_but_fixme_should_propagate_errors()); + auto process_chooser = GUI::ProcessChooser::construct("Profiler"sv, String::from_utf8_short_string("Profile"sv), Gfx::Bitmap::load_from_file("/res/icons/16x16/app-profiler.png"sv).release_value_but_fixme_should_propagate_errors()); if (process_chooser->exec() == GUI::Dialog::ExecResult::Cancel) return false; pid = process_chooser->pid(); diff --git a/Userland/Games/Hearts/Game.cpp b/Userland/Games/Hearts/Game.cpp index 0e052f63ee..e6e0fe1bca 100644 --- a/Userland/Games/Hearts/Game.cpp +++ b/Userland/Games/Hearts/Game.cpp @@ -78,7 +78,7 @@ Game::Game() m_players[3].name = "Lisa"; m_players[3].taken_cards_target = { width, height / 2 - Card::height / 2 }; - m_passing_button = add<GUI::Button>("Pass Left"); + m_passing_button = add<GUI::Button>(String::from_utf8("Pass Left"sv).release_value_but_fixme_should_propagate_errors()); constexpr int button_width = 120; constexpr int button_height = 30; m_passing_button->set_relative_rect(width / 2 - button_width / 2, height - 3 * outer_border_size - Card::height - button_height, button_width, button_height); @@ -135,7 +135,7 @@ void Game::show_score_card(bool game_over) button_container.set_shrink_to_fit(true); button_container.set_layout<GUI::VerticalBoxLayout>(); - auto& close_button = button_container.add<GUI::Button>("OK"); + auto& close_button = button_container.add<GUI::Button>(String::from_utf8_short_string("OK"sv)); close_button.on_click = [&score_dialog](auto) { score_dialog->done(GUI::Dialog::ExecResult::OK); }; @@ -180,13 +180,13 @@ void Game::setup(DeprecatedString player_name, int hand_number) m_human_can_play = true; switch (passing_direction()) { case PassingDirection::Left: - m_passing_button->set_text_deprecated("Pass Left"); + m_passing_button->set_text(String::from_utf8("Pass Left"sv).release_value_but_fixme_should_propagate_errors()); break; case PassingDirection::Across: - m_passing_button->set_text_deprecated("Pass Across"); + m_passing_button->set_text(String::from_utf8("Pass Across"sv).release_value_but_fixme_should_propagate_errors()); break; case PassingDirection::Right: - m_passing_button->set_text_deprecated("Pass Right"); + m_passing_button->set_text(String::from_utf8("Pass Right"sv).release_value_but_fixme_should_propagate_errors()); break; default: VERIFY_NOT_REACHED(); @@ -871,7 +871,7 @@ void Game::pass_cards() } m_state = State::PassingAccept; - m_passing_button->set_text_deprecated("OK"); + m_passing_button->set_text(String::from_utf8_short_string("OK"sv)); m_passing_button->set_enabled(true); } diff --git a/Userland/Games/Hearts/SettingsDialog.cpp b/Userland/Games/Hearts/SettingsDialog.cpp index f96482f0cd..f528d11e06 100644 --- a/Userland/Games/Hearts/SettingsDialog.cpp +++ b/Userland/Games/Hearts/SettingsDialog.cpp @@ -42,11 +42,11 @@ SettingsDialog::SettingsDialog(GUI::Window* parent, DeprecatedString player_name auto& button_layout = button_box.set_layout<GUI::HorizontalBoxLayout>(); button_layout.set_spacing(10); - button_box.add<GUI::Button>("Cancel").on_click = [this](auto) { + button_box.add<GUI::Button>(String::from_utf8_short_string("Cancel"sv)).on_click = [this](auto) { done(ExecResult::Cancel); }; - button_box.add<GUI::Button>("OK").on_click = [this](auto) { + button_box.add<GUI::Button>(String::from_utf8_short_string("OK"sv)).on_click = [this](auto) { done(ExecResult::OK); }; } diff --git a/Userland/Libraries/LibGUI/Action.cpp b/Userland/Libraries/LibGUI/Action.cpp index 95d56aabba..07fbdb41f7 100644 --- a/Userland/Libraries/LibGUI/Action.cpp +++ b/Userland/Libraries/LibGUI/Action.cpp @@ -289,7 +289,7 @@ void Action::set_text(DeprecatedString text) return; m_text = move(text); for_each_toolbar_button([&](auto& button) { - button.set_text_deprecated(m_text); + button.set_text(String::from_deprecated_string(m_text).release_value_but_fixme_should_propagate_errors()); }); for_each_menu_item([&](auto& menu_item) { menu_item.update_from_action({}); diff --git a/Userland/Libraries/LibGUI/Breadcrumbbar.cpp b/Userland/Libraries/LibGUI/Breadcrumbbar.cpp index bbb274afc3..79b83b3d43 100644 --- a/Userland/Libraries/LibGUI/Breadcrumbbar.cpp +++ b/Userland/Libraries/LibGUI/Breadcrumbbar.cpp @@ -75,7 +75,7 @@ void Breadcrumbbar::append_segment(DeprecatedString text, Gfx::Bitmap const* ico { auto& button = add<BreadcrumbButton>(); button.set_button_style(Gfx::ButtonStyle::Coolbar); - button.set_text_deprecated(text); + button.set_text(String::from_deprecated_string(text).release_value_but_fixme_should_propagate_errors()); button.set_icon(icon); button.set_tooltip(move(tooltip)); button.set_focus_policy(FocusPolicy::TabFocus); diff --git a/Userland/Libraries/LibGUI/ColorPicker.cpp b/Userland/Libraries/LibGUI/ColorPicker.cpp index 68d1dbe01d..0fae2fcb0d 100644 --- a/Userland/Libraries/LibGUI/ColorPicker.cpp +++ b/Userland/Libraries/LibGUI/ColorPicker.cpp @@ -234,14 +234,14 @@ void ColorPicker::build_ui() button_container.layout()->add_spacer(); auto& ok_button = button_container.add<DialogButton>(); - ok_button.set_text_deprecated("OK"); + ok_button.set_text(String::from_utf8_short_string("OK"sv)); ok_button.on_click = [this](auto) { done(ExecResult::OK); }; ok_button.set_default(true); auto& cancel_button = button_container.add<DialogButton>(); - cancel_button.set_text_deprecated("Cancel"); + cancel_button.set_text(String::from_utf8_short_string("Cancel"sv)); cancel_button.on_click = [this](auto) { done(ExecResult::Cancel); }; @@ -416,7 +416,7 @@ void ColorPicker::build_ui_custom(Widget& root_container) make_spinbox(Blue, m_color.blue()); make_spinbox(Alpha, m_color.alpha()); - m_selector_button = vertical_container.add<GUI::Button>("Select on screen"); + m_selector_button = vertical_container.add<GUI::Button>(String::from_utf8("Select on screen"sv).release_value_but_fixme_should_propagate_errors()); m_selector_button->on_click = [this](auto) { auto selector = ColorSelectOverlay::construct(); auto original_color = m_color; diff --git a/Userland/Libraries/LibGUI/FilePicker.cpp b/Userland/Libraries/LibGUI/FilePicker.cpp index ee4203659f..97fb785394 100644 --- a/Userland/Libraries/LibGUI/FilePicker.cpp +++ b/Userland/Libraries/LibGUI/FilePicker.cpp @@ -217,14 +217,14 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St }; auto& ok_button = *widget->find_descendant_of_type_named<GUI::Button>("ok_button"); - ok_button.set_text_deprecated(ok_button_name(m_mode)); + ok_button.set_text(ok_button_name(m_mode)); ok_button.on_click = [this](auto) { on_file_return(); }; ok_button.set_enabled(m_mode == Mode::OpenFolder || !m_filename_textbox->text().is_empty()); auto& cancel_button = *widget->find_descendant_of_type_named<GUI::Button>("cancel_button"); - cancel_button.set_text_deprecated("Cancel"); + cancel_button.set_text(String::from_utf8_short_string("Cancel"sv)); cancel_button.on_click = [this](auto) { done(ExecResult::Cancel); }; diff --git a/Userland/Libraries/LibGUI/FilePicker.h b/Userland/Libraries/LibGUI/FilePicker.h index 8611aac51b..ad0d8277f1 100644 --- a/Userland/Libraries/LibGUI/FilePicker.h +++ b/Userland/Libraries/LibGUI/FilePicker.h @@ -48,17 +48,17 @@ private: FilePicker(Window* parent_window, Mode type = Mode::Open, StringView filename = "Untitled"sv, StringView path = Core::StandardPaths::home_directory(), ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent, Optional<Vector<FileTypeFilter>> allowed_file_types = {}); - static DeprecatedString ok_button_name(Mode mode) + static String ok_button_name(Mode mode) { switch (mode) { case Mode::Open: case Mode::OpenMultiple: case Mode::OpenFolder: - return "Open"; + return String::from_utf8_short_string("Open"sv); case Mode::Save: - return "Save"; + return String::from_utf8_short_string("Save"sv); default: - return "OK"; + return String::from_utf8_short_string("OK"sv); } } diff --git a/Userland/Libraries/LibGUI/IncrementalSearchBanner.cpp b/Userland/Libraries/LibGUI/IncrementalSearchBanner.cpp index cbdc5b3d18..c4580352b7 100644 --- a/Userland/Libraries/LibGUI/IncrementalSearchBanner.cpp +++ b/Userland/Libraries/LibGUI/IncrementalSearchBanner.cpp @@ -37,7 +37,7 @@ IncrementalSearchBanner::IncrementalSearchBanner(TextEditor& editor) }; m_close_button = find_descendant_of_type_named<Button>("incremental_search_banner_close_button"); - m_close_button->set_text_deprecated("\xE2\x9D\x8C"); + m_close_button->set_text(String::from_utf8_short_string("\xE2\x9D\x8C"sv)); m_close_button->on_click = [this](auto) { hide(); }; diff --git a/Userland/Libraries/LibGUI/InputBox.cpp b/Userland/Libraries/LibGUI/InputBox.cpp index b1948c35ef..e9c690099f 100644 --- a/Userland/Libraries/LibGUI/InputBox.cpp +++ b/Userland/Libraries/LibGUI/InputBox.cpp @@ -107,7 +107,7 @@ void InputBox::build() button_container_inner.layout()->add_spacer(); m_ok_button = button_container_inner.add<DialogButton>(); - m_ok_button->set_text_deprecated("OK"); + m_ok_button->set_text(String::from_utf8_short_string("OK"sv)); m_ok_button->on_click = [this](auto) { dbgln("GUI::InputBox: OK button clicked"); done(ExecResult::OK); @@ -115,7 +115,7 @@ void InputBox::build() m_ok_button->set_default(true); m_cancel_button = button_container_inner.add<DialogButton>(); - m_cancel_button->set_text_deprecated("Cancel"); + m_cancel_button->set_text(String::from_utf8_short_string("Cancel"sv)); m_cancel_button->on_click = [this](auto) { dbgln("GUI::InputBox: Cancel button clicked"); done(ExecResult::Cancel); diff --git a/Userland/Libraries/LibGUI/MessageBox.cpp b/Userland/Libraries/LibGUI/MessageBox.cpp index 1017d540da..53b83eca27 100644 --- a/Userland/Libraries/LibGUI/MessageBox.cpp +++ b/Userland/Libraries/LibGUI/MessageBox.cpp @@ -49,9 +49,12 @@ Dialog::ExecResult MessageBox::ask_about_unsaved_changes(Window* parent_window, if (parent_window) box->set_icon(parent_window->icon()); - box->m_yes_button->set_text_deprecated(path.is_empty() ? "Save As..." : "Save"); - box->m_no_button->set_text_deprecated("Discard"); - box->m_cancel_button->set_text_deprecated("Cancel"); + if (path.is_empty()) + box->m_yes_button->set_text(String::from_utf8("Save As..."sv).release_value_but_fixme_should_propagate_errors()); + else + box->m_yes_button->set_text(String::from_utf8_short_string("Save"sv)); + box->m_no_button->set_text(String::from_utf8_short_string("Discard"sv)); + box->m_cancel_button->set_text(String::from_utf8_short_string("Cancel"sv)); return box->exec(); } @@ -151,11 +154,11 @@ void MessageBox::build() constexpr int button_width = 80; int button_count = 0; - auto add_button = [&](DeprecatedString label, ExecResult result) -> GUI::Button& { + auto add_button = [&](String label, ExecResult result) -> GUI::Button& { auto& button = button_container.add<Button>(); button.set_fixed_width(button_width); - button.set_text_deprecated(label); - button.on_click = [this, label, result](auto) { + button.set_text(move(label)); + button.on_click = [this, result](auto) { done(result); }; ++button_count; @@ -164,13 +167,13 @@ void MessageBox::build() button_container.layout()->add_spacer(); if (should_include_ok_button()) - m_ok_button = add_button("OK", ExecResult::OK); + m_ok_button = add_button(String::from_utf8_short_string("OK"sv), ExecResult::OK); if (should_include_yes_button()) - m_yes_button = add_button("Yes", ExecResult::Yes); + m_yes_button = add_button(String::from_utf8_short_string("Yes"sv), ExecResult::Yes); if (should_include_no_button()) - m_no_button = add_button("No", ExecResult::No); + m_no_button = add_button(String::from_utf8_short_string("No"sv), ExecResult::No); if (should_include_cancel_button()) - m_cancel_button = add_button("Cancel", ExecResult::Cancel); + m_cancel_button = add_button(String::from_utf8_short_string("Cancel"sv), ExecResult::Cancel); button_container.layout()->add_spacer(); int width = (button_count * button_width) + ((button_count - 1) * button_container.layout()->spacing()) + 32; diff --git a/Userland/Libraries/LibGUI/ProcessChooser.cpp b/Userland/Libraries/LibGUI/ProcessChooser.cpp index 82922fb9d9..9368ec3cc2 100644 --- a/Userland/Libraries/LibGUI/ProcessChooser.cpp +++ b/Userland/Libraries/LibGUI/ProcessChooser.cpp @@ -15,10 +15,10 @@ namespace GUI { -ProcessChooser::ProcessChooser(StringView window_title, StringView button_label, Gfx::Bitmap const* window_icon, GUI::Window* parent_window) +ProcessChooser::ProcessChooser(StringView window_title, String button_label, Gfx::Bitmap const* window_icon, GUI::Window* parent_window) : Dialog(parent_window) , m_window_title(window_title) - , m_button_label(button_label) + , m_button_label(move(button_label)) , m_window_icon(window_icon) { set_title(m_window_title); @@ -62,7 +62,7 @@ ProcessChooser::ProcessChooser(StringView window_title, StringView button_label, auto index = m_table_view->selection().first(); set_pid_from_index_and_close(index); }; - 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.set_fixed_width(80); cancel_button.on_click = [this](auto) { done(ExecResult::Cancel); diff --git a/Userland/Libraries/LibGUI/ProcessChooser.h b/Userland/Libraries/LibGUI/ProcessChooser.h index d684103b03..5c7e79eef3 100644 --- a/Userland/Libraries/LibGUI/ProcessChooser.h +++ b/Userland/Libraries/LibGUI/ProcessChooser.h @@ -7,6 +7,7 @@ #pragma once +#include <AK/String.h> #include <LibCore/Timer.h> #include <LibGUI/Dialog.h> #include <LibGUI/RunningProcessesModel.h> @@ -22,14 +23,14 @@ public: pid_t pid() const { return m_pid; } private: - ProcessChooser(StringView window_title = "Process Chooser"sv, StringView button_label = "Select"sv, Gfx::Bitmap const* window_icon = nullptr, GUI::Window* parent_window = nullptr); + ProcessChooser(StringView window_title = "Process Chooser"sv, String button_label = String::from_utf8_short_string("Select"sv), Gfx::Bitmap const* window_icon = nullptr, GUI::Window* parent_window = nullptr); void set_pid_from_index_and_close(ModelIndex const&); pid_t m_pid { 0 }; DeprecatedString m_window_title; - DeprecatedString m_button_label; + String m_button_label; RefPtr<Gfx::Bitmap> m_window_icon; RefPtr<TableView> m_table_view; RefPtr<RunningProcessesModel> m_process_model; diff --git a/Userland/Libraries/LibGUI/SettingsWindow.cpp b/Userland/Libraries/LibGUI/SettingsWindow.cpp index 55d827f24c..c121fe6462 100644 --- a/Userland/Libraries/LibGUI/SettingsWindow.cpp +++ b/Userland/Libraries/LibGUI/SettingsWindow.cpp @@ -46,7 +46,7 @@ ErrorOr<NonnullRefPtr<SettingsWindow>> SettingsWindow::create(DeprecatedString t button_container->layout()->set_spacing(6); if (show_defaults_button == ShowDefaultsButton::Yes) { - window->m_reset_button = TRY(button_container->try_add<GUI::DialogButton>("Defaults")); + window->m_reset_button = TRY(button_container->try_add<GUI::DialogButton>(TRY(String::from_utf8("Defaults"sv)))); window->m_reset_button->on_click = [window = window->make_weak_ptr<SettingsWindow>()](auto) { window->reset_default_values(); }; @@ -54,19 +54,19 @@ ErrorOr<NonnullRefPtr<SettingsWindow>> SettingsWindow::create(DeprecatedString t TRY(button_container->layout()->try_add_spacer()); - window->m_ok_button = TRY(button_container->try_add<GUI::DialogButton>("OK")); + window->m_ok_button = TRY(button_container->try_add<GUI::DialogButton>(String::from_utf8_short_string("OK"sv))); window->m_ok_button->on_click = [window = window->make_weak_ptr<SettingsWindow>()](auto) { window->apply_settings(); GUI::Application::the()->quit(); }; - window->m_cancel_button = TRY(button_container->try_add<GUI::DialogButton>("Cancel")); + window->m_cancel_button = TRY(button_container->try_add<GUI::DialogButton>(String::from_utf8_short_string("Cancel"sv))); window->m_cancel_button->on_click = [window = window->make_weak_ptr<SettingsWindow>()](auto) { window->cancel_settings(); GUI::Application::the()->quit(); }; - window->m_apply_button = TRY(button_container->try_add<GUI::DialogButton>("Apply")); + window->m_apply_button = TRY(button_container->try_add<GUI::DialogButton>(String::from_utf8_short_string("Apply"sv))); window->m_apply_button->set_enabled(false); window->m_apply_button->on_click = [window = window->make_weak_ptr<SettingsWindow>()](auto) { window->apply_settings(); diff --git a/Userland/Libraries/LibGUI/Toolbar.cpp b/Userland/Libraries/LibGUI/Toolbar.cpp index 360632c756..b69ca90e57 100644 --- a/Userland/Libraries/LibGUI/Toolbar.cpp +++ b/Userland/Libraries/LibGUI/Toolbar.cpp @@ -56,18 +56,18 @@ private: if (action.icon()) set_icon(action.icon()); else - set_text_deprecated(action.text()); + set_text(String::from_deprecated_string(action.text()).release_value_but_fixme_should_propagate_errors()); set_button_style(Gfx::ButtonStyle::Coolbar); } - virtual void set_text_deprecated(DeprecatedString text) override + virtual void set_text(String text) override { auto const* action = this->action(); VERIFY(action); set_tooltip(tooltip(*action)); if (!action->icon()) - Button::set_text_deprecated(move(text)); + Button::set_text(move(text)); } DeprecatedString tooltip(Action const& action) const diff --git a/Userland/Libraries/LibGUI/Wizards/WizardDialog.cpp b/Userland/Libraries/LibGUI/Wizards/WizardDialog.cpp index bd27698c3b..060518ad26 100644 --- a/Userland/Libraries/LibGUI/Wizards/WizardDialog.cpp +++ b/Userland/Libraries/LibGUI/Wizards/WizardDialog.cpp @@ -46,12 +46,12 @@ WizardDialog::WizardDialog(Window* parent_window) nav_container_widget.layout()->set_spacing(0); nav_container_widget.layout()->add_spacer(); - m_back_button = nav_container_widget.add<DialogButton>("< Back"); + m_back_button = nav_container_widget.add<DialogButton>(String::from_utf8_short_string("< Back"sv)); m_back_button->on_click = [&](auto) { pop_page(); }; - m_next_button = nav_container_widget.add<DialogButton>("Next >"); + m_next_button = nav_container_widget.add<DialogButton>(String::from_utf8_short_string("Next >"sv)); m_next_button->on_click = [&](auto) { VERIFY(has_pages()); @@ -68,7 +68,7 @@ WizardDialog::WizardDialog(Window* parent_window) auto& button_spacer = nav_container_widget.add<Widget>(); button_spacer.set_fixed_width(10); - m_cancel_button = nav_container_widget.add<DialogButton>("Cancel"); + m_cancel_button = nav_container_widget.add<DialogButton>(String::from_utf8_short_string("Cancel"sv)); m_cancel_button->on_click = [&](auto) { handle_cancel(); }; @@ -122,9 +122,12 @@ void WizardDialog::update_navigation() m_back_button->set_enabled(m_page_stack.size() > 1); if (has_pages()) { m_next_button->set_enabled(current_page().is_final_page() || current_page().can_go_next()); - m_next_button->set_text_deprecated(current_page().is_final_page() ? "Finish" : "Next >"); + if (current_page().is_final_page()) + m_next_button->set_text(String::from_utf8_short_string("Finish"sv)); + else + m_next_button->set_text(String::from_utf8_short_string("Next >"sv)); } else { - m_next_button->set_text_deprecated("Next >"); + m_next_button->set_text(String::from_utf8_short_string("Next >"sv)); m_next_button->set_enabled(false); } } diff --git a/Userland/Services/Taskbar/ShutdownDialog.cpp b/Userland/Services/Taskbar/ShutdownDialog.cpp index 9dd87d51ca..ae4d93aa7f 100644 --- a/Userland/Services/Taskbar/ShutdownDialog.cpp +++ b/Userland/Services/Taskbar/ShutdownDialog.cpp @@ -78,7 +78,7 @@ ShutdownDialog::ShutdownDialog() auto action = options[i]; auto& radio = right_container.add<GUI::RadioButton>(); radio.set_enabled(action.enabled); - radio.set_text_deprecated(action.title); + radio.set_text(String::from_deprecated_string(action.title).release_value_but_fixme_should_propagate_errors()); radio.on_checked = [this, i](auto) { m_selected_option = i; @@ -97,13 +97,13 @@ ShutdownDialog::ShutdownDialog() button_container.set_layout<GUI::HorizontalBoxLayout>(); button_container.layout()->set_spacing(5); button_container.layout()->add_spacer(); - 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.set_fixed_size(80, 23); ok_button.on_click = [this](auto) { done(ExecResult::OK); }; 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.set_fixed_size(80, 23); cancel_button.on_click = [this](auto) { done(ExecResult::Cancel); diff --git a/Userland/Services/Taskbar/TaskbarButton.cpp b/Userland/Services/Taskbar/TaskbarButton.cpp index a2e01ba172..5b8d748438 100644 --- a/Userland/Services/Taskbar/TaskbarButton.cpp +++ b/Userland/Services/Taskbar/TaskbarButton.cpp @@ -93,20 +93,20 @@ void TaskbarButton::paint_event(GUI::PaintEvent& event) Gfx::StylePainter::paint_button(painter, rect(), palette(), button_style(), is_being_pressed(), is_hovered(), is_checked(), is_enabled()); - if (text_deprecated().is_empty()) + if (text().is_empty()) return; auto content_rect = rect().shrunken(8, 2); auto icon_location = content_rect.center().translated(-(icon.width() / 2), -(icon.height() / 2)); - if (!text_deprecated().is_empty()) + if (!text().is_empty()) icon_location.set_x(content_rect.x()); - if (!text_deprecated().is_empty()) { + if (!text().is_empty()) { content_rect.translate_by(icon.width() + 4, 0); content_rect.set_width(content_rect.width() - icon.width() - 4); } - Gfx::IntRect text_rect { 0, 0, static_cast<int>(ceilf(font.width(text_deprecated()))), font.glyph_height() }; + Gfx::IntRect text_rect { 0, 0, static_cast<int>(ceilf(font.width(text()))), font.glyph_height() }; if (text_rect.width() > content_rect.width()) text_rect.set_width(content_rect.width()); text_rect.align_within(content_rect, text_alignment()); @@ -123,7 +123,7 @@ void TaskbarButton::paint_event(GUI::PaintEvent& event) adjusted_rect.set_width(adjusted_rect.width() + 1); adjusted_rect.set_height(adjusted_rect.height() + 1); } - paint_custom_progressbar(painter, adjusted_rect, text_rect, palette(), 0, 100, window.progress().value(), text_deprecated(), font, text_alignment()); + paint_custom_progressbar(painter, adjusted_rect, text_rect, palette(), 0, 100, window.progress().value(), text(), font, text_alignment()); } if (is_enabled()) { diff --git a/Userland/Services/Taskbar/TaskbarWindow.cpp b/Userland/Services/Taskbar/TaskbarWindow.cpp index 648fe65d97..bb4cb91773 100644 --- a/Userland/Services/Taskbar/TaskbarWindow.cpp +++ b/Userland/Services/Taskbar/TaskbarWindow.cpp @@ -114,7 +114,7 @@ void TaskbarWindow::add_system_menu(NonnullRefPtr<GUI::Menu> system_menu) { m_system_menu = move(system_menu); - m_start_button = GUI::Button::construct("Serenity"); + m_start_button = GUI::Button::construct(String::from_utf8("Serenity"sv).release_value_but_fixme_should_propagate_errors()); set_start_button_font(Gfx::FontDatabase::default_font().bold_variant()); m_start_button->set_icon_spacing(0); auto app_icon = GUI::Icon::default_icon("ladyball"sv); @@ -202,7 +202,7 @@ void TaskbarWindow::update_window_button(::Window& window, bool show_as_active) auto* button = window.button(); if (!button) return; - button->set_text_deprecated(window.title()); + button->set_text(String::from_deprecated_string(window.title()).release_value_but_fixme_should_propagate_errors()); button->set_tooltip(window.title()); button->set_checked(show_as_active); button->set_visible(is_window_on_current_workspace(window)); |