mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +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
Notes:
sideshowbarker
2024-07-19 12:02:26 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/4381dd26406
1 changed files with 5 additions and 3 deletions
|
@ -8,8 +8,6 @@ class GraphicsBitmap;
|
|||
class GLabel : public GFrame {
|
||||
C_OBJECT(GLabel)
|
||||
public:
|
||||
explicit GLabel(GWidget* parent = nullptr);
|
||||
GLabel(const StringView& text, GWidget* parent = nullptr);
|
||||
virtual ~GLabel() override;
|
||||
|
||||
String text() const { return m_text; }
|
||||
|
@ -27,9 +25,13 @@ public:
|
|||
|
||||
void size_to_fit();
|
||||
|
||||
private:
|
||||
protected:
|
||||
explicit GLabel(GWidget* parent = nullptr);
|
||||
GLabel(const StringView& text, GWidget* parent = nullptr);
|
||||
|
||||
virtual void paint_event(GPaintEvent&) override;
|
||||
|
||||
private:
|
||||
String m_text;
|
||||
RefPtr<GraphicsBitmap> m_icon;
|
||||
TextAlignment m_text_alignment { TextAlignment::Center };
|
||||
|
|
Loading…
Reference in a new issue