mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 11:52:44 +00:00 
			
		
		
		
	FontEditor: Break out classes into separate files.
This commit is contained in:
		
							parent
							
								
									b9738fa8ac
								
							
						
					
					
						commit
						dde224fe44
					
				
					 7 changed files with 257 additions and 243 deletions
				
			
		
							
								
								
									
										31
									
								
								Applications/FontEditor/GlyphEditorWidget.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								Applications/FontEditor/GlyphEditorWidget.h
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,31 @@ | |||
| #include <LibGUI/GWidget.h> | ||||
| #include <AK/Function.h> | ||||
| 
 | ||||
| class GlyphEditorWidget final : public GWidget { | ||||
| public: | ||||
|     GlyphEditorWidget(Font&, GWidget* parent); | ||||
|     virtual ~GlyphEditorWidget() override; | ||||
| 
 | ||||
|     byte glyph() const { return m_glyph; } | ||||
|     void set_glyph(byte); | ||||
| 
 | ||||
|     int preferred_width() const; | ||||
|     int preferred_height() const; | ||||
| 
 | ||||
|     Font& font() { return *m_font; } | ||||
|     const Font& font() const { return *m_font; } | ||||
| 
 | ||||
|     Function<void()> on_glyph_altered; | ||||
| 
 | ||||
| private: | ||||
|     virtual void paint_event(GPaintEvent&) override; | ||||
|     virtual void mousedown_event(GMouseEvent&) override; | ||||
|     virtual void mousemove_event(GMouseEvent&) override; | ||||
|     virtual bool accepts_focus() const override { return true; } | ||||
| 
 | ||||
|     void draw_at_mouse(const GMouseEvent&); | ||||
| 
 | ||||
|     RetainPtr<Font> m_font; | ||||
|     byte m_glyph { 0 }; | ||||
|     int m_scale { 10 }; | ||||
| }; | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling