mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 19:57:45 +03: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
Notes:
sideshowbarker
2024-07-19 12:02:26 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/4381dd26406
@ -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…
Reference in New Issue
Block a user