mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:27:35 +00:00
LibGUI: Allow setting a tooltip on BreadcrumbBar segments
This commit is contained in:
parent
4853576db7
commit
85271a4dd8
2 changed files with 3 additions and 2 deletions
|
@ -92,12 +92,13 @@ void BreadcrumbBar::clear_segments()
|
|||
remove_all_children();
|
||||
}
|
||||
|
||||
void BreadcrumbBar::append_segment(const String& text, const Gfx::Bitmap* icon, const String& data)
|
||||
void BreadcrumbBar::append_segment(String text, const Gfx::Bitmap* icon, String data, String tooltip)
|
||||
{
|
||||
auto& button = add<BreadcrumbButton>();
|
||||
button.set_button_style(Gfx::ButtonStyle::CoolBar);
|
||||
button.set_text(text);
|
||||
button.set_icon(icon);
|
||||
button.set_tooltip(move(tooltip));
|
||||
button.set_focus_policy(FocusPolicy::TabFocus);
|
||||
button.set_checkable(true);
|
||||
button.set_exclusive(true);
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
virtual ~BreadcrumbBar() override;
|
||||
|
||||
void clear_segments();
|
||||
void append_segment(const String& text, const Gfx::Bitmap* icon = nullptr, const String& data = {});
|
||||
void append_segment(String text, const Gfx::Bitmap* icon = nullptr, String data = {}, String tooltip = {});
|
||||
|
||||
size_t segment_count() const { return m_segments.size(); }
|
||||
String segment_data(size_t index) const { return m_segments[index].data; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue