summaryrefslogtreecommitdiff
path: root/Userland/Applications/FontEditor/GlyphMapWidget.cpp
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-04-18 21:12:52 +0300
committerAndreas Kling <kling@serenityos.org>2021-04-18 22:10:25 +0200
commit18ae37439a4fdd65d98b94c75c5d64480a827289 (patch)
tree308d043fb13d07776308556f77cfd68f19f33a3a /Userland/Applications/FontEditor/GlyphMapWidget.cpp
parent08d1b16a8d1e43014f8252b74e5b3605cdb310f9 (diff)
downloadserenity-18ae37439a4fdd65d98b94c75c5d64480a827289.zip
FontEditor+LibGfx: Allow user to specify if a specific glyph is present
This replaces the glyph width spinbox in the font editor with a checkbox when editing fixed width fonts that indicates if the currently selected character's glyph is present in the edited font (For variable width fonts a non zero width implies presence) This commit also changes the background color of glyphs in the glyph map based on the presence of each specific glyph in the font.
Diffstat (limited to 'Userland/Applications/FontEditor/GlyphMapWidget.cpp')
-rw-r--r--Userland/Applications/FontEditor/GlyphMapWidget.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Applications/FontEditor/GlyphMapWidget.cpp b/Userland/Applications/FontEditor/GlyphMapWidget.cpp
index c03302f93e..3ed04e3529 100644
--- a/Userland/Applications/FontEditor/GlyphMapWidget.cpp
+++ b/Userland/Applications/FontEditor/GlyphMapWidget.cpp
@@ -107,7 +107,7 @@ void GlyphMapWidget::paint_event(GUI::PaintEvent& event)
painter.add_clip_rect(event.rect());
painter.set_font(font());
- painter.fill_rect(widget_inner_rect(), palette().base());
+ painter.fill_rect(widget_inner_rect(), palette().inactive_window_title());
for (int glyph = 0; glyph < m_glyph_count; ++glyph) {
Gfx::IntRect outer_rect = get_outer_rect(glyph);
@@ -119,7 +119,8 @@ void GlyphMapWidget::paint_event(GUI::PaintEvent& event)
if (glyph == m_selected_glyph) {
painter.fill_rect(outer_rect, is_focused() ? palette().selection() : palette().inactive_selection());
painter.draw_glyph(inner_rect.location(), glyph, is_focused() ? palette().selection_text() : palette().inactive_selection_text());
- } else {
+ } else if (m_font->contains_glyph(glyph)) {
+ painter.fill_rect(outer_rect, palette().base());
painter.draw_glyph(inner_rect.location(), glyph, palette().base_text());
}
}