1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:37:35 +00:00

LibGUI: Add on_glyph_double_clicked() callback to GlyphMapWidget

This will be used by CharacterMap.

In implementing this, extracted the logic for finding which glyph is at
a given position within the widget.
This commit is contained in:
Sam Atkins 2022-01-11 20:10:32 +00:00 committed by Andreas Kling
parent 2327ea8970
commit ff500ffcc4
2 changed files with 27 additions and 6 deletions

View file

@ -60,16 +60,19 @@ public:
int columns() const { return m_columns; }
Function<void(int)> on_active_glyph_changed;
Function<void(int)> on_glyph_double_clicked;
private:
GlyphMapWidget();
virtual void paint_event(PaintEvent&) override;
virtual void mousedown_event(MouseEvent&) override;
virtual void doubleclick_event(MouseEvent&) override;
virtual void keydown_event(KeyEvent&) override;
virtual void resize_event(ResizeEvent&) override;
virtual void did_change_font() override;
Gfx::IntRect get_outer_rect(int glyph) const;
Optional<int> glyph_at_position(Gfx::IntPoint) const;
void recalculate_content_size();