mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:27:42 +00:00
LibGUI: Minor tweaks to the GUI::LinkLabel
Remove some unnecessary includes and make the constructor private.
This commit is contained in:
parent
5452c8a566
commit
9fe310c470
2 changed files with 7 additions and 7 deletions
|
@ -24,19 +24,17 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <LibCore/Event.h>
|
||||
#include <LibGUI/Event.h>
|
||||
#include <LibGUI/LinkLabel.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Font.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <LibGfx/SystemTheme.h>
|
||||
|
||||
namespace GUI {
|
||||
|
||||
LinkLabel::LinkLabel(const StringView& text)
|
||||
: Label(text)
|
||||
LinkLabel::LinkLabel(String text)
|
||||
: Label(move(text))
|
||||
{
|
||||
set_foreground_role(Gfx::ColorRole::Link);
|
||||
}
|
||||
|
|
|
@ -26,18 +26,19 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibGUI/Event.h>
|
||||
#include <LibGUI/Label.h>
|
||||
|
||||
namespace GUI {
|
||||
|
||||
class LinkLabel : public Label {
|
||||
C_OBJECT(LinkLabel);
|
||||
|
||||
public:
|
||||
LinkLabel(const StringView&);
|
||||
Function<void()> on_click;
|
||||
|
||||
private:
|
||||
explicit LinkLabel(String);
|
||||
|
||||
virtual void mousedown_event(MouseEvent&) override;
|
||||
virtual void paint_event(PaintEvent&) override;
|
||||
virtual void resize_event(ResizeEvent&) override;
|
||||
|
@ -45,6 +46,7 @@ private:
|
|||
virtual void enter_event(Core::Event&) override;
|
||||
virtual void leave_event(Core::Event&) override;
|
||||
|
||||
bool m_hovered = false;
|
||||
bool m_hovered { false };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue