serenity
serenity copied to clipboard
LibGUI: Allow GlyphMapWidget to highlight modified glyphs
This makes modifications in FontEditor more visible, both so you know what you've changed, and for taking a handy "here's what's changed" screenshot for a font PR. :^)
The background color for new glyphs is green, modified glyphs is blue, and deleted glyphs is red. The changes persist until you load a new font file, so you can continue saving your work as you go and still be able to take a convenient screenshot at the end.
FontEditor does not currently mark glyphs as unmodified if you undo a change you made though.
More love to FontEditor. ❤️
Thanks everyone! I wasn't initially sure if this was a desired feature. I've improved it a bit:
- Tweaked the colours because I wasn't happy with them.
- Added darker versions of the colours when the theme is dark. (A proper solution might be to add color-roles for them, but it felt excessive for one application. If we end up with other apps wanting "created/modified/deleted" colours then we can move it into the theme then.)
- Added undo support.
- Add a menu option to show or hide the highlights.
New screenshots are in the first post. :^)
EDIT: The option to turn the highlights on/off has the explanation of the colours. I did try adding a (*)
to the statusbar when a modified glyph is selected, but the statusbar is pretty noisy already.
This is a really nice feature! MainWidget::paste_glyphs()
doesn't trigger an update for individual glyphs, but set them modified and it should be able to color-code pasted selections too. Something like m_glyph_map_widget->set_glyph_modified(selection.start() + i, true);
at the end of the range bound glyph count loop.
This is a really nice feature!
MainWidget::paste_glyphs()
doesn't trigger an update for individual glyphs, but set them modified and it should be able to color-code pasted selections too. Something likem_glyph_map_widget->set_glyph_modified(selection.start() + i, true);
at the end of the range bound glyph count loop.
Thank you, @thankyouverycool, very cool. I didn't know which email to use to co-author you so I just used the one GitHub displays. Let me know if you'd prefer something else. :^)
Fixed a merge conflict.