mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:17:35 +00:00
Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/.
This commit is contained in:
parent
63814ffebf
commit
04b9dc2d30
328 changed files with 36 additions and 36 deletions
38
Libraries/LibGUI/GLabel.h
Normal file
38
Libraries/LibGUI/GLabel.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGUI/GFrame.h>
|
||||
#include <SharedGraphics/TextAlignment.h>
|
||||
|
||||
class GraphicsBitmap;
|
||||
|
||||
class GLabel : public GFrame {
|
||||
public:
|
||||
explicit GLabel(GWidget* parent = nullptr);
|
||||
GLabel(const StringView& text, GWidget* parent = nullptr);
|
||||
virtual ~GLabel() override;
|
||||
|
||||
String text() const { return m_text; }
|
||||
void set_text(const StringView&);
|
||||
|
||||
void set_icon(RefPtr<GraphicsBitmap>&&);
|
||||
const GraphicsBitmap* icon() const { return m_icon.ptr(); }
|
||||
GraphicsBitmap* icon() { return m_icon.ptr(); }
|
||||
|
||||
TextAlignment text_alignment() const { return m_text_alignment; }
|
||||
void set_text_alignment(TextAlignment text_alignment) { m_text_alignment = text_alignment; }
|
||||
|
||||
bool should_stretch_icon() const { return m_should_stretch_icon; }
|
||||
void set_should_stretch_icon(bool b) { m_should_stretch_icon = b; }
|
||||
|
||||
void size_to_fit();
|
||||
|
||||
virtual const char* class_name() const override { return "GLabel"; }
|
||||
|
||||
private:
|
||||
virtual void paint_event(GPaintEvent&) override;
|
||||
|
||||
String m_text;
|
||||
RefPtr<GraphicsBitmap> m_icon;
|
||||
TextAlignment m_text_alignment { TextAlignment::Center };
|
||||
bool m_should_stretch_icon { false };
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue