summaryrefslogtreecommitdiff
path: root/Userland/Applications/FontEditor/GlyphEditorWidget.h
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2021-04-06 12:04:21 -0400
committerAndreas Kling <kling@serenityos.org>2021-04-06 22:24:05 +0200
commitbb9cd13a568a49089f781c2268f18cbd4dab32aa (patch)
tree85faadc2335f1fb01b4c929e6a3f2d376f33bc99 /Userland/Applications/FontEditor/GlyphEditorWidget.h
parentd115b29a5b3cba9c3f2ce46e5791479a6fc609b9 (diff)
downloadserenity-bb9cd13a568a49089f781c2268f18cbd4dab32aa.zip
FontEditor: Convert to GML and add new edit commands to GlyphEditor
Adds cut, copy, paste and delete to GlyphEditor. Font preview has moved to a separate resizable ToolWindow. Font metadata can now be hidden. FontEditor and glyph widgets can now be re-initialized instead of resetting window's main widget after loading new fonts.
Diffstat (limited to 'Userland/Applications/FontEditor/GlyphEditorWidget.h')
-rw-r--r--Userland/Applications/FontEditor/GlyphEditorWidget.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/Userland/Applications/FontEditor/GlyphEditorWidget.h b/Userland/Applications/FontEditor/GlyphEditorWidget.h
index a54c551642..045e15df6c 100644
--- a/Userland/Applications/FontEditor/GlyphEditorWidget.h
+++ b/Userland/Applications/FontEditor/GlyphEditorWidget.h
@@ -35,9 +35,17 @@ class GlyphEditorWidget final : public GUI::Frame {
public:
virtual ~GlyphEditorWidget() override;
+ void initialize(Gfx::BitmapFont&);
+
int glyph() const { return m_glyph; }
void set_glyph(int);
+ void cut_glyph();
+ void copy_glyph();
+ void paste_glyph();
+ void delete_glyph();
+ void clear_clipboard_glyph();
+
int preferred_width() const;
int preferred_height() const;
@@ -47,7 +55,7 @@ public:
Function<void(u8)> on_glyph_altered;
private:
- GlyphEditorWidget(Gfx::BitmapFont&);
+ GlyphEditorWidget() {};
virtual void paint_event(GUI::PaintEvent&) override;
virtual void mousedown_event(GUI::MouseEvent&) override;
virtual void mousemove_event(GUI::MouseEvent&) override;
@@ -55,6 +63,8 @@ private:
void draw_at_mouse(const GUI::MouseEvent&);
RefPtr<Gfx::BitmapFont> m_font;
+ RefPtr<Gfx::Font> m_clipboard_font;
+ Gfx::GlyphBitmap m_clipboard_glyph;
int m_glyph { 0 };
int m_scale { 10 };
};