mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 11:47:34 +00:00
Userland: Use nondeprecated set_tooltip for static and formatted strings
This commit is contained in:
parent
46a97844c7
commit
ed3e729d4e
18 changed files with 45 additions and 45 deletions
|
@ -87,7 +87,7 @@ private:
|
|||
m_root_container->set_frame_style(Gfx::FrameStyle::Window);
|
||||
|
||||
m_percent_box = m_root_container->add<GUI::CheckBox>("\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<GUI::CheckBox>("\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
|
||||
|
|
|
@ -101,7 +101,7 @@ ErrorOr<int> 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<GUI::ImageWidget>();
|
||||
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();
|
||||
|
|
|
@ -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<float>(recent_tx) / static_cast<float>(m_current_scale));
|
||||
m_tooltip = DeprecatedString::formatted("Network: TX {} / RX {} ({:.1} kbit/s)", tx, rx, static_cast<double>(recent_tx) * 8.0 / 1000.0);
|
||||
m_tooltip = MUST(String::formatted("Network: TX {} / RX {} ({:.1} kbit/s)", tx, rx, static_cast<double>(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<Core::File> m_proc_stat;
|
||||
OwnPtr<Core::File> m_proc_mem;
|
||||
OwnPtr<Core::File> m_proc_net;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue