mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:17:36 +00:00
LibGUI: Add deprecated suffix to {set_,}tooltip in Widget
This commit is contained in:
parent
9b1e33af69
commit
d978dd4af8
32 changed files with 56 additions and 56 deletions
|
@ -250,7 +250,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
auto& match = results_container.add<Assistant::ResultRow>();
|
||||
match.set_icon(result->bitmap());
|
||||
match.set_text(String::from_deprecated_string(result->title()).release_value_but_fixme_should_propagate_errors());
|
||||
match.set_tooltip(result->tooltip());
|
||||
match.set_tooltip_deprecated(result->tooltip());
|
||||
match.on_click = [&result](auto) {
|
||||
result->activate();
|
||||
GUI::Application::the()->quit();
|
||||
|
|
|
@ -117,7 +117,7 @@ BookmarksBarWidget::BookmarksBarWidget(DeprecatedString const& bookmarks_file, b
|
|||
set_visible(false);
|
||||
|
||||
m_additional = GUI::Button::construct();
|
||||
m_additional->set_tooltip("Show hidden bookmarks");
|
||||
m_additional->set_tooltip_deprecated("Show hidden bookmarks");
|
||||
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())
|
||||
|
@ -216,7 +216,7 @@ void BookmarksBarWidget::model_did_update(unsigned)
|
|||
button.set_fixed_size(font().width(title) + 32, 20);
|
||||
button.set_relative_rect(rect);
|
||||
button.set_focus_policy(GUI::FocusPolicy::TabFocus);
|
||||
button.set_tooltip(url);
|
||||
button.set_tooltip_deprecated(url);
|
||||
button.set_allowed_mouse_buttons_for_pressing(GUI::MouseButton::Primary | GUI::MouseButton::Middle);
|
||||
|
||||
button.on_click = [title, url, this](auto) {
|
||||
|
|
|
@ -62,7 +62,7 @@ ConsoleWidget::ConsoleWidget()
|
|||
auto& clear_button = bottom_container.add<GUI::Button>();
|
||||
clear_button.set_fixed_size(22, 22);
|
||||
clear_button.set_icon(g_icon_bag.delete_icon);
|
||||
clear_button.set_tooltip("Clear the console output");
|
||||
clear_button.set_tooltip_deprecated("Clear the console output");
|
||||
clear_button.on_click = [this](auto) {
|
||||
clear_output();
|
||||
};
|
||||
|
|
|
@ -200,7 +200,7 @@ Tab::Tab(BrowserWindow& window)
|
|||
this);
|
||||
|
||||
m_reset_zoom_button = toolbar.add<GUI::Button>();
|
||||
m_reset_zoom_button->set_tooltip("Reset zoom level");
|
||||
m_reset_zoom_button->set_tooltip_deprecated("Reset zoom level");
|
||||
m_reset_zoom_button->on_click = [&](auto) {
|
||||
view().reset_zoom();
|
||||
update_reset_zoom_button();
|
||||
|
@ -726,10 +726,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("Remove Bookmark");
|
||||
m_bookmark_button->set_tooltip_deprecated("Remove Bookmark");
|
||||
} else {
|
||||
m_bookmark_button->set_icon(g_icon_bag.bookmark_contour);
|
||||
m_bookmark_button->set_tooltip("Add Bookmark");
|
||||
m_bookmark_button->set_tooltip_deprecated("Add Bookmark");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -216,7 +216,7 @@ ErrorOr<void> MonitorSettingsWidget::selected_screen_index_or_resolution_changed
|
|||
|
||||
if (screen_dpi.has_value()) {
|
||||
auto dpi_label_value = TRY(String::formatted("{} dpi", screen_dpi.value()));
|
||||
m_dpi_label->set_tooltip(screen_dpi_tooltip.to_deprecated_string());
|
||||
m_dpi_label->set_tooltip_deprecated(screen_dpi_tooltip.to_deprecated_string());
|
||||
m_dpi_label->set_text(move(dpi_label_value));
|
||||
m_dpi_label->set_visible(true);
|
||||
} else {
|
||||
|
|
|
@ -69,7 +69,7 @@ ErrorOr<void> MainWidget::initialize()
|
|||
// FIXME: Implement vertical flipping in GUI::Slider, not here.
|
||||
m_octave_knob = TRY(m_octave_container->try_add<GUI::VerticalSlider>());
|
||||
m_octave_knob->set_preferred_width(GUI::SpecialDimension::Fit);
|
||||
m_octave_knob->set_tooltip("Z: octave down, X: octave up");
|
||||
m_octave_knob->set_tooltip_deprecated("Z: octave down, X: octave up");
|
||||
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);
|
||||
|
|
|
@ -62,7 +62,7 @@ ErrorOr<void> PlayerWidget::initialize()
|
|||
m_add_track_button = TRY(try_add<GUI::Button>());
|
||||
m_add_track_button->set_icon(*m_add_track_icon);
|
||||
m_add_track_button->set_fixed_width(30);
|
||||
m_add_track_button->set_tooltip("Add Track");
|
||||
m_add_track_button->set_tooltip_deprecated("Add Track");
|
||||
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<void> PlayerWidget::initialize()
|
|||
m_next_track_button = TRY(try_add<GUI::Button>());
|
||||
m_next_track_button->set_icon(*m_next_track_icon);
|
||||
m_next_track_button->set_fixed_width(30);
|
||||
m_next_track_button->set_tooltip("Next Track");
|
||||
m_next_track_button->set_tooltip_deprecated("Next Track");
|
||||
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<void> PlayerWidget::initialize()
|
|||
m_play_button = TRY(try_add<GUI::Button>());
|
||||
m_play_button->set_icon(*m_pause_icon);
|
||||
m_play_button->set_fixed_width(30);
|
||||
m_play_button->set_tooltip("Play/Pause playback");
|
||||
m_play_button->set_tooltip_deprecated("Play/Pause playback");
|
||||
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<void> PlayerWidget::initialize()
|
|||
m_back_button = TRY(try_add<GUI::Button>());
|
||||
m_back_button->set_icon(*m_back_icon);
|
||||
m_back_button->set_fixed_width(30);
|
||||
m_back_button->set_tooltip("Previous Note");
|
||||
m_back_button->set_tooltip_deprecated("Previous Note");
|
||||
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<void> PlayerWidget::initialize()
|
|||
m_next_button = TRY(try_add<GUI::Button>());
|
||||
m_next_button->set_icon(*m_next_icon);
|
||||
m_next_button->set_fixed_width(30);
|
||||
m_next_button->set_tooltip("Next Note");
|
||||
m_next_button->set_tooltip_deprecated("Next Note");
|
||||
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));
|
||||
|
|
|
@ -26,7 +26,7 @@ ProcessorParameterSlider::ProcessorParameterSlider(Orientation orientation, DSP:
|
|||
set_value(value_log);
|
||||
set_step((min_log - max_log) / slider_steps);
|
||||
}
|
||||
set_tooltip(m_parameter.name().to_deprecated_string());
|
||||
set_tooltip_deprecated(m_parameter.name().to_deprecated_string());
|
||||
if (m_value_label != nullptr)
|
||||
m_value_label->set_text(String::formatted("{:.2f}", static_cast<double>(m_parameter)).release_value_but_fixme_should_propagate_errors());
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
|
|||
|
||||
m_gaussian_checkbox = TRY(gaussian_container->try_add<GUI::CheckBox>("Approximate Gaussian Blur"_string));
|
||||
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->set_tooltip_deprecated("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) {
|
||||
m_approximate_gauss = checked;
|
||||
update_preview();
|
||||
|
|
|
@ -189,7 +189,7 @@ ErrorOr<GUI::Widget*> GuideTool::get_properties_widget()
|
|||
auto snapping_label = TRY(snapping_container->try_add<GUI::Label>("Snap offset:"_string));
|
||||
snapping_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
snapping_label->set_fixed_size(80, 20);
|
||||
snapping_label->set_tooltip("Press Shift to snap");
|
||||
snapping_label->set_tooltip_deprecated("Press Shift to snap");
|
||||
|
||||
auto snapping_slider = TRY(snapping_container->try_add<GUI::ValueSlider>(Orientation::Horizontal, "px"_string));
|
||||
snapping_slider->set_range(0, 50);
|
||||
|
|
|
@ -282,7 +282,7 @@ void TreeMapWidget::mousemove_event(GUI::MouseEvent& event)
|
|||
{
|
||||
auto* node = path_node(m_viewpoint);
|
||||
if (!node) {
|
||||
set_tooltip({});
|
||||
set_tooltip_deprecated({});
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -293,7 +293,7 @@ void TreeMapWidget::mousemove_event(GUI::MouseEvent& event)
|
|||
}
|
||||
});
|
||||
|
||||
set_tooltip(DeprecatedString::formatted("{}\n{}", hovered_node->name(), human_readable_size(hovered_node->area())));
|
||||
set_tooltip_deprecated(DeprecatedString::formatted("{}\n{}", hovered_node->name(), human_readable_size(hovered_node->area())));
|
||||
}
|
||||
|
||||
void TreeMapWidget::mousedown_event(GUI::MouseEvent& event)
|
||||
|
|
|
@ -153,7 +153,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector<Position> const& po
|
|||
|
||||
m_type = CellType::get_by_name(g_types.at(index.row()));
|
||||
if (auto* editor = right_side.find_descendant_of_type_named<GUI::TextEditor>("format_editor"))
|
||||
editor->set_tooltip(m_type->metadata_hint(MetadataName::Format));
|
||||
editor->set_tooltip_deprecated(m_type->metadata_hint(MetadataName::Format));
|
||||
};
|
||||
|
||||
{
|
||||
|
|
|
@ -80,10 +80,10 @@ void InfinitelyScrollableTableView::mousemove_event(GUI::MouseEvent& event)
|
|||
if (!is_dragging()) {
|
||||
auto tooltip = model->data(index, static_cast<GUI::ModelRole>(SheetModel::Role::Tooltip));
|
||||
if (tooltip.is_string()) {
|
||||
set_tooltip(tooltip.as_string());
|
||||
set_tooltip_deprecated(tooltip.as_string());
|
||||
show_or_hide_tooltip();
|
||||
} else {
|
||||
set_tooltip({});
|
||||
set_tooltip_deprecated({});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, Vector<NonnullR
|
|||
|
||||
auto& help_button = top_bar.add<GUI::Button>();
|
||||
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("Functions Help");
|
||||
help_button.set_tooltip_deprecated("Functions Help");
|
||||
help_button.set_fixed_size(20, 20);
|
||||
help_button.on_click = [&](auto) {
|
||||
if (!current_view()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue