diff --git a/Applications/FileManager/PropertiesDialog.cpp b/Applications/FileManager/PropertiesDialog.cpp index e48d935736..7f3015bed7 100644 --- a/Applications/FileManager/PropertiesDialog.cpp +++ b/Applications/FileManager/PropertiesDialog.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include @@ -288,7 +288,7 @@ void PropertiesDialog::make_property_value_pairs(const Vector if (!pair.link.has_value()) { label_container.add(pair.value).set_text_alignment(Gfx::TextAlignment::CenterLeft); } else { - auto& link = label_container.add(pair.value); + auto& link = label_container.add(pair.value); link.set_text_alignment(Gfx::TextAlignment::CenterLeft); link.on_click = [pair]() { Desktop::Launcher::open(pair.link.value()); diff --git a/Libraries/LibGUI/CMakeLists.txt b/Libraries/LibGUI/CMakeLists.txt index cf3edf6e9e..9792fbe8a9 100644 --- a/Libraries/LibGUI/CMakeLists.txt +++ b/Libraries/LibGUI/CMakeLists.txt @@ -46,7 +46,7 @@ set(SOURCES Label.cpp Layout.cpp LazyWidget.cpp - Link.cpp + LinkLabel.cpp ListView.cpp Menu.cpp MenuBar.cpp diff --git a/Libraries/LibGUI/Link.cpp b/Libraries/LibGUI/LinkLabel.cpp similarity index 86% rename from Libraries/LibGUI/Link.cpp rename to Libraries/LibGUI/LinkLabel.cpp index 83fba8f3f2..c0e35bd981 100644 --- a/Libraries/LibGUI/Link.cpp +++ b/Libraries/LibGUI/LinkLabel.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include @@ -35,20 +35,20 @@ namespace GUI { -Link::Link(const StringView& text) +LinkLabel::LinkLabel(const StringView& text) : Label(text) { set_foreground_role(Gfx::ColorRole::Link); } -void Link::mousedown_event(MouseEvent&) +void LinkLabel::mousedown_event(MouseEvent&) { if (on_click) { on_click(); } } -void Link::paint_event(PaintEvent& event) +void LinkLabel::paint_event(PaintEvent& event) { Label::paint_event(event); GUI::Painter painter(*this); @@ -58,26 +58,26 @@ void Link::paint_event(PaintEvent& event) Widget::palette().link()); } -void Link::enter_event(Core::Event&) +void LinkLabel::enter_event(Core::Event&) { m_hovered = true; update(); } -void Link::leave_event(Core::Event&) +void LinkLabel::leave_event(Core::Event&) { m_hovered = false; update(); } -void Link::second_paint_event(PaintEvent&) +void LinkLabel::second_paint_event(PaintEvent&) { if (window()->width() < font().width(text())) { set_tooltip(text()); } } -void Link::resize_event(ResizeEvent&) +void LinkLabel::resize_event(ResizeEvent&) { if (window()->width() < font().width(text())) { set_tooltip(text()); diff --git a/Libraries/LibGUI/Link.h b/Libraries/LibGUI/LinkLabel.h similarity index 95% rename from Libraries/LibGUI/Link.h rename to Libraries/LibGUI/LinkLabel.h index 41bd2d2d16..b35fac1d08 100644 --- a/Libraries/LibGUI/Link.h +++ b/Libraries/LibGUI/LinkLabel.h @@ -30,10 +30,11 @@ #include namespace GUI { -class Link : public Label { - C_OBJECT(Link) +class LinkLabel : public Label { + C_OBJECT(LinkLabel); + public: - Link(const StringView&); + LinkLabel(const StringView&); Function on_click; private: