diff options
author | Andreas Kling <kling@serenityos.org> | 2020-12-26 13:00:24 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-26 13:03:38 +0100 |
commit | 5452c8a5661a01d9227b0ecece0c6ebf5834a6f3 (patch) | |
tree | c583edcc38df5f0199c4ad41a182fade391625ae /Libraries | |
parent | 788594c0c2a3d4323113f4be9ed7f2c4c37d8781 (diff) | |
download | serenity-5452c8a5661a01d9227b0ecece0c6ebf5834a6f3.zip |
LibGUI: Rename Link => LinkLabel
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibGUI/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Libraries/LibGUI/LinkLabel.cpp (renamed from Libraries/LibGUI/Link.cpp) | 16 | ||||
-rw-r--r-- | Libraries/LibGUI/LinkLabel.h (renamed from Libraries/LibGUI/Link.h) | 7 |
3 files changed, 13 insertions, 12 deletions
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 index 83fba8f3f2..c0e35bd981 100644 --- a/Libraries/LibGUI/Link.cpp +++ b/Libraries/LibGUI/LinkLabel.cpp @@ -26,7 +26,7 @@ #include <LibCore/Event.h> #include <LibGUI/Event.h> -#include <LibGUI/Link.h> +#include <LibGUI/LinkLabel.h> #include <LibGUI/Painter.h> #include <LibGUI/Window.h> #include <LibGfx/Font.h> @@ -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 index 41bd2d2d16..b35fac1d08 100644 --- a/Libraries/LibGUI/Link.h +++ b/Libraries/LibGUI/LinkLabel.h @@ -30,10 +30,11 @@ #include <LibGUI/Label.h> namespace GUI { -class Link : public Label { - C_OBJECT(Link) +class LinkLabel : public Label { + C_OBJECT(LinkLabel); + public: - Link(const StringView&); + LinkLabel(const StringView&); Function<void()> on_click; private: |