1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:57:43 +00:00

LibGUI: Tweak GUI::Label API a bit and add did_change_text() virtual

This commit is contained in:
Andreas Kling 2020-12-26 13:10:50 +01:00
parent 9fe310c470
commit 4e084793df
2 changed files with 10 additions and 7 deletions

View file

@ -32,12 +32,13 @@
namespace GUI {
class Label : public Frame {
C_OBJECT(Label)
C_OBJECT(Label);
public:
virtual ~Label() override;
String text() const { return m_text; }
void set_text(const StringView&);
void set_text(String);
void set_icon(const Gfx::Bitmap*);
const Gfx::Bitmap* icon() const { return m_icon.ptr(); }
@ -53,9 +54,10 @@ public:
void set_autosize(bool);
protected:
explicit Label(const StringView& text = {});
explicit Label(String text = {});
virtual void paint_event(PaintEvent&) override;
virtual void did_change_text() { }
private:
void size_to_fit();