1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:37:36 +00:00

LibGUI: Add deprecated suffix to {set_,}tooltip in Widget

This commit is contained in:
camc 2023-08-01 19:31:54 +01:00 committed by Sam Atkins
parent 9b1e33af69
commit d978dd4af8
32 changed files with 56 additions and 56 deletions

View file

@ -308,7 +308,7 @@ void Action::set_tooltip(DeprecatedString tooltip)
return;
m_tooltip = move(tooltip);
for_each_toolbar_button([&](auto& button) {
button.set_tooltip(*m_tooltip);
button.set_tooltip_deprecated(*m_tooltip);
});
for_each_menu_item([&](auto& menu_item) {
menu_item.update_from_action({});

View file

@ -76,7 +76,7 @@ void Breadcrumbbar::append_segment(DeprecatedString text, Gfx::Bitmap const* ico
button.set_button_style(Gfx::ButtonStyle::Coolbar);
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_tooltip_deprecated(move(tooltip));
button.set_focus_policy(FocusPolicy::TabFocus);
button.set_checkable(true);
button.set_exclusive(true);

View file

@ -144,7 +144,7 @@ auto EmojiInputDialog::supported_emoji() -> Vector<Emoji>
};
if (!emoji->name.is_empty())
button->set_tooltip(emoji->name);
button->set_tooltip_deprecated(emoji->name);
emojis.empend(move(button), emoji.release_value(), move(text));
}

View file

@ -119,9 +119,9 @@ void LinkLabel::did_change_text()
void LinkLabel::update_tooltip_if_needed()
{
if (width() < font().width(text())) {
set_tooltip(text().to_deprecated_string());
set_tooltip_deprecated(text().to_deprecated_string());
} else {
set_tooltip({});
set_tooltip_deprecated({});
}
}

View file

@ -49,7 +49,7 @@ private:
if (action.group() && action.group()->is_exclusive())
set_exclusive(true);
set_action(action);
set_tooltip(tooltip(action));
set_tooltip_deprecated(tooltip(action));
set_focus_policy(FocusPolicy::NoFocus);
if (action.icon())
set_icon(action.icon());
@ -63,7 +63,7 @@ private:
auto const* action = this->action();
VERIFY(action);
set_tooltip(tooltip(*action));
set_tooltip_deprecated(tooltip(*action));
if (!action->icon())
Button::set_text(move(text));
}

View file

@ -57,7 +57,7 @@ Widget::Widget()
REGISTER_BOOL_PROPERTY("visible", is_visible, set_visible);
REGISTER_BOOL_PROPERTY("focused", is_focused, set_focus);
REGISTER_BOOL_PROPERTY("enabled", is_enabled, set_enabled);
REGISTER_DEPRECATED_STRING_PROPERTY("tooltip", tooltip, set_tooltip);
REGISTER_DEPRECATED_STRING_PROPERTY("tooltip", tooltip_deprecated, set_tooltip_deprecated);
REGISTER_UI_SIZE_PROPERTY("min_size", min_size, set_min_size);
REGISTER_READONLY_UI_SIZE_PROPERTY("effective_min_size", effective_min_size);
@ -1107,7 +1107,7 @@ Gfx::IntRect Widget::relative_non_grabbable_rect() const
return rect;
}
void Widget::set_tooltip(DeprecatedString tooltip)
void Widget::set_tooltip_deprecated(DeprecatedString tooltip)
{
m_tooltip = move(tooltip);
if (Application::the()->tooltip_source_widget() == this)

View file

@ -161,8 +161,8 @@ public:
virtual bool is_visible_for_timer_purposes() const override;
bool has_tooltip() const { return !m_tooltip.is_empty(); }
DeprecatedString tooltip() const { return m_tooltip; }
void set_tooltip(DeprecatedString);
DeprecatedString tooltip_deprecated() const { return m_tooltip; }
void set_tooltip_deprecated(DeprecatedString);
bool is_auto_focusable() const { return m_auto_focusable; }
void set_auto_focusable(bool auto_focusable) { m_auto_focusable = auto_focusable; }