diff --git a/Userland/Applets/Audio/main.cpp b/Userland/Applets/Audio/main.cpp index 41ba00aa8dc..2e0019e6c37 100644 --- a/Userland/Applets/Audio/main.cpp +++ b/Userland/Applets/Audio/main.cpp @@ -87,7 +87,7 @@ private: m_root_container->set_frame_style(Gfx::FrameStyle::Window); m_percent_box = m_root_container->add("\xE2\x84\xB9"_string); - m_percent_box->set_tooltip_deprecated(show_percent() ? "Hide percent" : "Show percent"); + m_percent_box->set_tooltip(show_percent() ? "Hide percent"_string : "Show percent"_string); m_percent_box->set_checked(show_percent()); m_percent_box->on_checked = [&](bool show_percent) { set_show_percent(show_percent); @@ -111,9 +111,9 @@ private: m_mute_box = m_root_container->add("\xE2\x9D\x8C"_string); m_mute_box->set_checked(m_audio_muted); - m_mute_box->set_tooltip_deprecated(m_audio_muted ? "Unmute" : "Mute"); + m_mute_box->set_tooltip(m_audio_muted ? "Unmute"_string : "Mute"_string); m_mute_box->on_checked = [&](bool is_muted) { - m_mute_box->set_tooltip_deprecated(is_muted ? "Unmute" : "Mute"); + m_mute_box->set_tooltip(is_muted ? "Unmute"_string : "Mute"_string); m_audio_client->set_main_mix_muted(is_muted); GUI::Application::the()->hide_tooltip(); }; @@ -129,7 +129,7 @@ public: { m_show_percent = show_percent; m_percent_box->set_checked(show_percent); - m_percent_box->set_tooltip_deprecated(show_percent ? "Hide percent" : "Show percent"); + m_percent_box->set_tooltip(show_percent ? "Hide percent"_string : "Show percent"_string); if (show_percent) window()->resize(44, 16); else diff --git a/Userland/Applets/ClipboardHistory/main.cpp b/Userland/Applets/ClipboardHistory/main.cpp index 3aa0c9de0d9..09585638061 100644 --- a/Userland/Applets/ClipboardHistory/main.cpp +++ b/Userland/Applets/ClipboardHistory/main.cpp @@ -101,7 +101,7 @@ ErrorOr serenity_main(Main::Arguments arguments) applet_window->set_window_type(GUI::WindowType::Applet); applet_window->set_has_alpha_channel(true); auto icon_widget = applet_window->set_main_widget(); - icon_widget->set_tooltip_deprecated("Clipboard History"); + icon_widget->set_tooltip("Clipboard History"_string); icon_widget->load_from_file("/res/icons/16x16/edit-copy.png"sv); icon_widget->on_click = [&main_window = *main_window] { main_window.show(); diff --git a/Userland/Applets/ResourceGraph/main.cpp b/Userland/Applets/ResourceGraph/main.cpp index c964edc6be0..62e7851040d 100644 --- a/Userland/Applets/ResourceGraph/main.cpp +++ b/Userland/Applets/ResourceGraph/main.cpp @@ -53,10 +53,10 @@ private: m_last_idle = idle; float cpu = total_diff > 0 ? (float)(total_diff - idle_diff) / (float)total_diff : 0; m_history.enqueue(cpu); - m_tooltip = DeprecatedString::formatted("CPU usage: {:.1}%", 100 * cpu); + m_tooltip = MUST(String::formatted("CPU usage: {:.1}%", 100 * cpu)); } else { m_history.enqueue(-1); - m_tooltip = "Unable to determine CPU usage"sv; + m_tooltip = "Unable to determine CPU usage"_string; } break; } @@ -66,10 +66,10 @@ private: double total_memory = allocated + available; double memory = (double)allocated / total_memory; m_history.enqueue(memory); - m_tooltip = DeprecatedString::formatted("Memory: {} MiB of {:.1} MiB in use", allocated / MiB, total_memory / MiB); + m_tooltip = MUST(String::formatted("Memory: {} MiB of {:.1} MiB in use", allocated / MiB, total_memory / MiB)); } else { m_history.enqueue(-1); - m_tooltip = "Unable to determine memory usage"sv; + m_tooltip = "Unable to determine memory usage"_string; } break; } @@ -97,17 +97,17 @@ private: } } m_history.enqueue(static_cast(recent_tx) / static_cast(m_current_scale)); - m_tooltip = DeprecatedString::formatted("Network: TX {} / RX {} ({:.1} kbit/s)", tx, rx, static_cast(recent_tx) * 8.0 / 1000.0); + m_tooltip = MUST(String::formatted("Network: TX {} / RX {} ({:.1} kbit/s)", tx, rx, static_cast(recent_tx) * 8.0 / 1000.0)); } else { m_history.enqueue(-1); - m_tooltip = "Unable to determine network usage"sv; + m_tooltip = "Unable to determine network usage"_string; } break; } default: VERIFY_NOT_REACHED(); } - set_tooltip_deprecated(m_tooltip); + set_tooltip(m_tooltip); update(); } @@ -229,7 +229,7 @@ private: u64 m_last_total { 0 }; static constexpr u64 const scale_unit = 8000; u64 m_current_scale { scale_unit }; - DeprecatedString m_tooltip; + String m_tooltip; OwnPtr m_proc_stat; OwnPtr m_proc_mem; OwnPtr m_proc_net; diff --git a/Userland/Applications/Browser/BookmarksBarWidget.cpp b/Userland/Applications/Browser/BookmarksBarWidget.cpp index 64da8ca8e5d..44d6b0b92a1 100644 --- a/Userland/Applications/Browser/BookmarksBarWidget.cpp +++ b/Userland/Applications/Browser/BookmarksBarWidget.cpp @@ -117,7 +117,7 @@ BookmarksBarWidget::BookmarksBarWidget(DeprecatedString const& bookmarks_file, b set_visible(false); m_additional = GUI::Button::construct(); - m_additional->set_tooltip_deprecated("Show hidden bookmarks"); + m_additional->set_tooltip("Show hidden bookmarks"_string); m_additional->set_menu(m_additional_menu); auto bitmap_or_error = Gfx::Bitmap::load_from_file("/res/icons/16x16/overflow-menu.png"sv); if (!bitmap_or_error.is_error()) diff --git a/Userland/Applications/Browser/ConsoleWidget.cpp b/Userland/Applications/Browser/ConsoleWidget.cpp index 635ed0f8449..192950cbbf5 100644 --- a/Userland/Applications/Browser/ConsoleWidget.cpp +++ b/Userland/Applications/Browser/ConsoleWidget.cpp @@ -56,7 +56,7 @@ ConsoleWidget::ConsoleWidget(WebView::OutOfProcessWebView& content_view) auto& clear_button = bottom_container.add(); clear_button.set_fixed_size(22, 22); clear_button.set_icon(g_icon_bag.delete_icon); - clear_button.set_tooltip_deprecated("Clear the console output"); + clear_button.set_tooltip("Clear the console output"_string); clear_button.on_click = [this](auto) { m_console_client->clear(); }; diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp index 7c70134f0cd..c180d368e09 100644 --- a/Userland/Applications/Browser/Tab.cpp +++ b/Userland/Applications/Browser/Tab.cpp @@ -205,7 +205,7 @@ Tab::Tab(BrowserWindow& window) this); m_reset_zoom_button = toolbar.add(); - m_reset_zoom_button->set_tooltip_deprecated("Reset zoom level"); + m_reset_zoom_button->set_tooltip("Reset zoom level"_string); m_reset_zoom_button->on_click = [&](auto) { view().reset_zoom(); update_reset_zoom_button(); @@ -801,10 +801,10 @@ void Tab::update_bookmark_button(StringView url) { if (BookmarksBarWidget::the().contains_bookmark(url)) { m_bookmark_button->set_icon(g_icon_bag.bookmark_filled); - m_bookmark_button->set_tooltip_deprecated("Remove Bookmark"); + m_bookmark_button->set_tooltip("Remove Bookmark"_string); } else { m_bookmark_button->set_icon(g_icon_bag.bookmark_contour); - m_bookmark_button->set_tooltip_deprecated("Add Bookmark"); + m_bookmark_button->set_tooltip("Add Bookmark"_string); } } diff --git a/Userland/Applications/Piano/MainWidget.cpp b/Userland/Applications/Piano/MainWidget.cpp index b0bb11f9b31..a97b99a62c9 100644 --- a/Userland/Applications/Piano/MainWidget.cpp +++ b/Userland/Applications/Piano/MainWidget.cpp @@ -69,7 +69,7 @@ ErrorOr MainWidget::initialize() // FIXME: Implement vertical flipping in GUI::Slider, not here. m_octave_knob = m_octave_container->add(); m_octave_knob->set_preferred_width(GUI::SpecialDimension::Fit); - m_octave_knob->set_tooltip_deprecated("Z: octave down, X: octave up"); + m_octave_knob->set_tooltip("Z: octave down, X: octave up"_string); m_octave_knob->set_range(octave_min - 1, octave_max - 1); m_octave_knob->set_value((octave_max - 1) - (m_track_manager.keyboard()->virtual_keyboard_octave() - 1)); m_octave_knob->set_step(1); diff --git a/Userland/Applications/Piano/PlayerWidget.cpp b/Userland/Applications/Piano/PlayerWidget.cpp index b726dfe955d..1eff90f3b84 100644 --- a/Userland/Applications/Piano/PlayerWidget.cpp +++ b/Userland/Applications/Piano/PlayerWidget.cpp @@ -62,7 +62,7 @@ ErrorOr PlayerWidget::initialize() m_add_track_button = add(); m_add_track_button->set_icon(*m_add_track_icon); m_add_track_button->set_fixed_width(30); - m_add_track_button->set_tooltip_deprecated("Add Track"); + m_add_track_button->set_tooltip("Add Track"_string); m_add_track_button->set_focus_policy(GUI::FocusPolicy::NoFocus); m_add_track_button->on_click = [this](unsigned) { add_track(); @@ -71,7 +71,7 @@ ErrorOr PlayerWidget::initialize() m_next_track_button = add(); m_next_track_button->set_icon(*m_next_track_icon); m_next_track_button->set_fixed_width(30); - m_next_track_button->set_tooltip_deprecated("Next Track"); + m_next_track_button->set_tooltip("Next Track"_string); m_next_track_button->set_focus_policy(GUI::FocusPolicy::NoFocus); m_next_track_button->on_click = [this](unsigned) { next_track(); @@ -80,7 +80,7 @@ ErrorOr PlayerWidget::initialize() m_play_button = add(); m_play_button->set_icon(*m_pause_icon); m_play_button->set_fixed_width(30); - m_play_button->set_tooltip_deprecated("Play/Pause playback"); + m_play_button->set_tooltip("Play/Pause playback"_string); m_play_button->set_focus_policy(GUI::FocusPolicy::NoFocus); m_play_button->on_click = [this](unsigned) { m_audio_loop.toggle_paused(); @@ -95,7 +95,7 @@ ErrorOr PlayerWidget::initialize() m_back_button = add(); m_back_button->set_icon(*m_back_icon); m_back_button->set_fixed_width(30); - m_back_button->set_tooltip_deprecated("Previous Note"); + m_back_button->set_tooltip("Previous Note"_string); m_back_button->set_focus_policy(GUI::FocusPolicy::NoFocus); m_back_button->on_click = [this](unsigned) { m_track_manager.time_forward(-(sample_rate / (beats_per_minute / 60) / notes_per_beat)); @@ -104,7 +104,7 @@ ErrorOr PlayerWidget::initialize() m_next_button = add(); m_next_button->set_icon(*m_next_icon); m_next_button->set_fixed_width(30); - m_next_button->set_tooltip_deprecated("Next Note"); + m_next_button->set_tooltip("Next Note"_string); m_next_button->set_focus_policy(GUI::FocusPolicy::NoFocus); m_next_button->on_click = [this](unsigned) { m_track_manager.time_forward((sample_rate / (beats_per_minute / 60) / notes_per_beat)); diff --git a/Userland/Applications/PixelPaint/Filters/FastBoxBlur.cpp b/Userland/Applications/PixelPaint/Filters/FastBoxBlur.cpp index d26bd81ce32..12cd188891b 100644 --- a/Userland/Applications/PixelPaint/Filters/FastBoxBlur.cpp +++ b/Userland/Applications/PixelPaint/Filters/FastBoxBlur.cpp @@ -180,7 +180,7 @@ ErrorOr> FastBoxBlur::get_settings_widget() m_gaussian_checkbox = gaussian_container.add("Approximate Gaussian Blur"_string); m_gaussian_checkbox->set_checked(m_approximate_gauss); - m_gaussian_checkbox->set_tooltip_deprecated("A real gaussian blur can be approximated by running the box blur multiple times with different weights."); + m_gaussian_checkbox->set_tooltip("A real gaussian blur can be approximated by running the box blur multiple times with different weights."_string); m_gaussian_checkbox->on_checked = [this](bool checked) { m_approximate_gauss = checked; update_preview(); diff --git a/Userland/Applications/PixelPaint/Tools/GuideTool.cpp b/Userland/Applications/PixelPaint/Tools/GuideTool.cpp index 3c932a471e9..32dc1b04fb9 100644 --- a/Userland/Applications/PixelPaint/Tools/GuideTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/GuideTool.cpp @@ -189,7 +189,7 @@ NonnullRefPtr GuideTool::get_properties_widget() auto& snapping_label = snapping_container.add("Snap offset:"_string); snapping_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); snapping_label.set_fixed_size(80, 20); - snapping_label.set_tooltip_deprecated("Press Shift to snap"); + snapping_label.set_tooltip("Press Shift to snap"_string); auto& snapping_slider = snapping_container.add(Orientation::Horizontal, "px"_string); snapping_slider.set_range(0, 50); diff --git a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp index 8f4602667c5..cf9f632d416 100644 --- a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp +++ b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp @@ -280,7 +280,7 @@ void TreeMapWidget::mousemove_event(GUI::MouseEvent& event) { auto* node = path_node(m_viewpoint); if (!node) { - set_tooltip_deprecated({}); + set_tooltip({}); return; } @@ -291,7 +291,7 @@ void TreeMapWidget::mousemove_event(GUI::MouseEvent& event) } }); - set_tooltip_deprecated(DeprecatedString::formatted("{}\n{}", hovered_node->name(), human_readable_size(hovered_node->area()))); + set_tooltip(MUST(String::formatted("{}\n{}", hovered_node->name(), human_readable_size(hovered_node->area())))); } void TreeMapWidget::mousedown_event(GUI::MouseEvent& event) diff --git a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp index e5309afc31b..a06d904b8bf 100644 --- a/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp +++ b/Userland/Applications/Spreadsheet/SpreadsheetWidget.cpp @@ -46,7 +46,7 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, Vector(); help_button.set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-help.png"sv).release_value_but_fixme_should_propagate_errors()); - help_button.set_tooltip_deprecated("Functions Help"); + help_button.set_tooltip("Functions Help"_string); help_button.set_fixed_size(20, 20); help_button.on_click = [&](auto) { if (!current_view()) { diff --git a/Userland/DevTools/HackStudio/Git/GitWidget.cpp b/Userland/DevTools/HackStudio/Git/GitWidget.cpp index 9a85a8689ab..6d95dd4b39b 100644 --- a/Userland/DevTools/HackStudio/Git/GitWidget.cpp +++ b/Userland/DevTools/HackStudio/Git/GitWidget.cpp @@ -32,7 +32,7 @@ GitWidget::GitWidget() auto& refresh_button = unstaged_header.add(); refresh_button.set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/reload.png"sv).release_value_but_fixme_should_propagate_errors()); refresh_button.set_fixed_size(16, 16); - refresh_button.set_tooltip_deprecated("refresh"); + refresh_button.set_tooltip("refresh"_string); refresh_button.on_click = [this](int) { refresh(); }; auto& unstaged_label = unstaged_header.add(); @@ -62,7 +62,7 @@ GitWidget::GitWidget() auto& commit_button = staged_header.add(); commit_button.set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/commit.png"sv).release_value_but_fixme_should_propagate_errors()); commit_button.set_fixed_size(16, 16); - commit_button.set_tooltip_deprecated("commit"); + commit_button.set_tooltip("commit"_string); commit_button.on_click = [this](int) { commit(); }; auto& staged_label = staged_header.add(); diff --git a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp index c5b129f7d8c..86bab699cbf 100644 --- a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp +++ b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp @@ -144,7 +144,7 @@ auto EmojiInputDialog::supported_emoji() -> Vector }; if (!emoji->name.is_empty()) - button->set_tooltip_deprecated(emoji->name); + button->set_tooltip(MUST(String::from_utf8(emoji->name))); emojis.empend(move(button), emoji.release_value(), move(text)); } diff --git a/Userland/Libraries/LibGUI/Toolbar.cpp b/Userland/Libraries/LibGUI/Toolbar.cpp index fc53c8e87ba..e33a89ba527 100644 --- a/Userland/Libraries/LibGUI/Toolbar.cpp +++ b/Userland/Libraries/LibGUI/Toolbar.cpp @@ -49,7 +49,7 @@ private: if (action.group() && action.group()->is_exclusive()) set_exclusive(true); set_action(action); - set_tooltip_deprecated(tooltip(action)); + set_tooltip(tooltip(action)); set_focus_policy(FocusPolicy::NoFocus); if (action.icon()) set_icon(action.icon()); @@ -63,12 +63,12 @@ private: auto const* action = this->action(); VERIFY(action); - set_tooltip_deprecated(tooltip(*action)); + set_tooltip(tooltip(*action)); if (!action->icon()) Button::set_text(move(text)); } - DeprecatedString tooltip(Action const& action) const + String tooltip(Action const& action) const { StringBuilder builder; builder.append(action.tooltip()); @@ -77,7 +77,7 @@ private: builder.append(action.shortcut().to_deprecated_string()); builder.append(')'); } - return builder.to_deprecated_string(); + return MUST(builder.to_string()); } virtual void enter_event(Core::Event& event) override diff --git a/Userland/Libraries/LibVT/TerminalWidget.cpp b/Userland/Libraries/LibVT/TerminalWidget.cpp index e527f0ca047..69a0ecccaa3 100644 --- a/Userland/Libraries/LibVT/TerminalWidget.cpp +++ b/Userland/Libraries/LibVT/TerminalWidget.cpp @@ -878,18 +878,18 @@ void TerminalWidget::mousemove_event(GUI::MouseEvent& event) auto file_name = LexicalPath::basename(path); if (path == handlers[0]) { - set_tooltip_deprecated(DeprecatedString::formatted("Execute {}", app_name)); + set_tooltip(MUST(String::formatted("Execute {}", app_name))); } else { - set_tooltip_deprecated(DeprecatedString::formatted("Open {} with {}", file_name, app_name)); + set_tooltip(MUST(String::formatted("Open {} with {}", file_name, app_name))); } } else { - set_tooltip_deprecated(DeprecatedString::formatted("Open {} with {}", attribute.href, app_name)); + set_tooltip(MUST(String::formatted("Open {} with {}", attribute.href, app_name))); } } } else { m_hovered_href_id = {}; m_hovered_href = {}; - set_tooltip_deprecated({}); + set_tooltip({}); } show_or_hide_tooltip(); if (!m_hovered_href.is_empty()) @@ -957,7 +957,7 @@ void TerminalWidget::leave_event(Core::Event&) bool should_update = !m_hovered_href.is_empty(); m_hovered_href = {}; m_hovered_href_id = {}; - set_tooltip_deprecated(m_hovered_href); + set_tooltip({}); set_override_cursor(Gfx::StandardCursor::IBeam); if (should_update) update(); diff --git a/Userland/Services/Taskbar/ClockWidget.cpp b/Userland/Services/Taskbar/ClockWidget.cpp index 0e7feeb470c..74a396eda9c 100644 --- a/Userland/Services/Taskbar/ClockWidget.cpp +++ b/Userland/Services/Taskbar/ClockWidget.cpp @@ -30,7 +30,7 @@ ClockWidget::ClockWidget() if (now != last_update_time) { tick_clock(); last_update_time = now; - set_tooltip_deprecated(Core::DateTime::now().to_deprecated_string("%Y-%m-%d"sv)); + set_tooltip(MUST(Core::DateTime::now().to_string("%Y-%m-%d"sv))); } }); m_timer->start(); @@ -107,7 +107,7 @@ ClockWidget::ClockWidget() m_jump_to_button->set_button_style(Gfx::ButtonStyle::Coolbar); m_jump_to_button->set_fixed_size(24, 24); m_jump_to_button->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/calendar-date.png"sv).release_value_but_fixme_should_propagate_errors()); - m_jump_to_button->set_tooltip_deprecated("Jump to today"); + m_jump_to_button->set_tooltip("Jump to today"_string); m_jump_to_button->on_click = [this](auto) { jump_to_current_date(); }; @@ -116,7 +116,7 @@ ClockWidget::ClockWidget() m_calendar_launcher->set_button_style(Gfx::ButtonStyle::Coolbar); m_calendar_launcher->set_fixed_size(24, 24); m_calendar_launcher->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-calendar.png"sv).release_value_but_fixme_should_propagate_errors()); - m_calendar_launcher->set_tooltip_deprecated("Calendar"); + m_calendar_launcher->set_tooltip("Calendar"_string); m_calendar_launcher->on_click = [this](auto) { GUI::Process::spawn_or_show_error(window(), "/bin/Calendar"sv); }; diff --git a/Userland/Services/Taskbar/TaskbarWindow.cpp b/Userland/Services/Taskbar/TaskbarWindow.cpp index 429120641dc..b37ace87fba 100644 --- a/Userland/Services/Taskbar/TaskbarWindow.cpp +++ b/Userland/Services/Taskbar/TaskbarWindow.cpp @@ -89,7 +89,7 @@ ErrorOr TaskbarWindow::populate_taskbar() m_clock_widget = main_widget->add(); m_show_desktop_button = main_widget->add(); - m_show_desktop_button->set_tooltip_deprecated("Show Desktop"); + m_show_desktop_button->set_tooltip("Show Desktop"_string); m_show_desktop_button->set_icon(TRY(GUI::Icon::try_create_default_icon("desktop"sv)).bitmap_for_size(16)); m_show_desktop_button->set_button_style(Gfx::ButtonStyle::Coolbar); m_show_desktop_button->set_fixed_size(24, 24);