mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
Add a little About app and hook it up to the system menu's "About..." entry.
Added icons and customizable text alignment to GLabel.
This commit is contained in:
parent
d6326d6c2e
commit
d74b131c27
11 changed files with 118 additions and 2 deletions
|
@ -2,6 +2,9 @@
|
|||
|
||||
#include "GWidget.h"
|
||||
#include <AK/AKString.h>
|
||||
#include <SharedGraphics/Painter.h>
|
||||
|
||||
class GraphicsBitmap;
|
||||
|
||||
class GLabel final : public GWidget {
|
||||
public:
|
||||
|
@ -11,11 +14,20 @@ public:
|
|||
String text() const { return m_text; }
|
||||
void set_text(String&&);
|
||||
|
||||
void set_icon(RetainPtr<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; }
|
||||
|
||||
private:
|
||||
virtual void paint_event(GPaintEvent&) override;
|
||||
|
||||
virtual const char* class_name() const override { return "GLabel"; }
|
||||
|
||||
String m_text;
|
||||
RetainPtr<GraphicsBitmap> m_icon;
|
||||
TextAlignment m_text_alignment { TextAlignment::Center };
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue