mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
LibGUI: Make the GLabel constructors protected
You should use GLabel::construct(...) to create new GLabels instead of invoking the constructor directly via "new".
This commit is contained in:
parent
2e76ac3aff
commit
4381dd2640
1 changed files with 5 additions and 3 deletions
|
@ -8,8 +8,6 @@ class GraphicsBitmap;
|
||||||
class GLabel : public GFrame {
|
class GLabel : public GFrame {
|
||||||
C_OBJECT(GLabel)
|
C_OBJECT(GLabel)
|
||||||
public:
|
public:
|
||||||
explicit GLabel(GWidget* parent = nullptr);
|
|
||||||
GLabel(const StringView& text, GWidget* parent = nullptr);
|
|
||||||
virtual ~GLabel() override;
|
virtual ~GLabel() override;
|
||||||
|
|
||||||
String text() const { return m_text; }
|
String text() const { return m_text; }
|
||||||
|
@ -27,9 +25,13 @@ public:
|
||||||
|
|
||||||
void size_to_fit();
|
void size_to_fit();
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
|
explicit GLabel(GWidget* parent = nullptr);
|
||||||
|
GLabel(const StringView& text, GWidget* parent = nullptr);
|
||||||
|
|
||||||
virtual void paint_event(GPaintEvent&) override;
|
virtual void paint_event(GPaintEvent&) override;
|
||||||
|
|
||||||
|
private:
|
||||||
String m_text;
|
String m_text;
|
||||||
RefPtr<GraphicsBitmap> m_icon;
|
RefPtr<GraphicsBitmap> m_icon;
|
||||||
TextAlignment m_text_alignment { TextAlignment::Center };
|
TextAlignment m_text_alignment { TextAlignment::Center };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue