1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 19:07:34 +00:00

LibGUI: Port tooltip in Breadcrumbbar to String

This commit is contained in:
Karol Kosek 2023-08-23 20:16:52 +02:00 committed by Andreas Kling
parent dd92d09268
commit 3944c39b3a
4 changed files with 7 additions and 7 deletions

View file

@ -70,13 +70,13 @@ void Breadcrumbbar::clear_segments()
m_selected_segment = {};
}
void Breadcrumbbar::append_segment(DeprecatedString text, Gfx::Bitmap const* icon, DeprecatedString data, DeprecatedString tooltip)
void Breadcrumbbar::append_segment(DeprecatedString text, Gfx::Bitmap const* icon, DeprecatedString data, String tooltip)
{
auto& button = add<BreadcrumbButton>();
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_deprecated(move(tooltip));
button.set_tooltip(move(tooltip));
button.set_focus_policy(FocusPolicy::TabFocus);
button.set_checkable(true);
button.set_exclusive(true);

View file

@ -19,7 +19,7 @@ public:
virtual ~Breadcrumbbar() override = default;
void clear_segments();
void append_segment(DeprecatedString text, Gfx::Bitmap const* icon = nullptr, DeprecatedString data = {}, DeprecatedString tooltip = {});
void append_segment(DeprecatedString text, Gfx::Bitmap const* icon = nullptr, DeprecatedString data = {}, String tooltip = {});
void remove_end_segments(size_t segment_index);
void relayout();

View file

@ -110,7 +110,7 @@ void PathBreadcrumbbar::set_current_path(DeprecatedString const& new_path)
} else {
m_breadcrumbbar->clear_segments();
m_breadcrumbbar->append_segment("/", GUI::FileIconProvider::icon_for_path("/"sv).bitmap_for_size(16), "/", "/");
m_breadcrumbbar->append_segment("/", GUI::FileIconProvider::icon_for_path("/"sv).bitmap_for_size(16), "/", "/"_string);
StringBuilder builder;
for (auto& part : lexical_path.parts()) {
@ -118,7 +118,7 @@ void PathBreadcrumbbar::set_current_path(DeprecatedString const& new_path)
builder.append('/');
builder.append(part);
m_breadcrumbbar->append_segment(part, GUI::FileIconProvider::icon_for_path(builder.string_view()).bitmap_for_size(16), builder.string_view(), builder.string_view());
m_breadcrumbbar->append_segment(part, GUI::FileIconProvider::icon_for_path(builder.string_view()).bitmap_for_size(16), builder.string_view(), MUST(builder.to_string()));
}
m_breadcrumbbar->set_selected_segment(m_breadcrumbbar->segment_count() - 1);