Both widgets now make use of their base class's scrolling timer and
now always accept drag selection updates on mousemove_event().
This guarantees much snappier feeling selections when actively moving
the mouse.
Selections are always normalized when saving undo commands.
The restore_selection() function reverses this process so
negatively sized selections (created right-to-left) continue
to resize correctly with the keyboard when restored.
Previously the widget used a very rough estimate for visible glyphs
based on viewport and glyph areas. Now it simply figures rows times
columns with a two row overdraw to accommodate fractional glyphs
on either end of visible content. For KaticaRegular10, this ends up
reducing unnecessary glyph iterations during painting by about 30%.
Fixes a slightly oversized content rect and erroneous glyph outer
rect values. Increases glyph rect padding to guarantee at least 1px
between the focus rect and glyph.
Fixes crashing on invalid code points when creating selections
with the keyboard and applying actions to them.
Also adds Home/End key support for selections. Ctrl+Shift+{Home,End}
now extends the selection to the beginning or end of the active range,
respectively. Shift+{Home,End} extends the selection to the start or
end of the row. Alt+{Home,End} resets the selection and moves the
active glyph to the beginning or end of the active range.
Previously selection reset was ignored on active glyph change if the
old glyph equaled the new one. This was an intentional behavior that
allowed selections to resize by dragging the focused glyph, but has
proved more counterintuitive than useful.
Now the widget behaves like other text selection controls: selections
can be reset by clicking anywhere in them or shift can be held to
grow the selection.
This is a bogus size as the map must always have at least 1 glyph
selected, and it was causing occasional desync between selection
contents and the focused glyph when manipulating selections with
the keyboard.
And TRY early during initialization in FontEditor to leave the app
in a valid state on error. Fixes OOM crashes when cloning the original
font for highlight modifications.
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.
I didn't feel like this one use was enough to add 3 new color roles to
themes, so to make this look decent on dark themes, it detects if the
theme is marked as dark, and uses darker colors for the highlights
which look nice with a light text color.
GlyphMapWidget now reports context menu requests when secondary
clicking the map. This also adds a new Select All action and updates
the Copy Character action to work on multi-glyph selections. Glyph
navigation actions have been moved to a separate Go menu, as is
common in other apps.
Fixes an edge case in which mousing down on the active glyph within
a larger selection would reset the selection but fail to update the
glyph map. Now we can grow or shrink the selection by dragging the
active glyph even after an initial selection is made.
This patch makes background a bit darkened so that it is possible to
distinguish out of range area from glyphs that are just not drawn.
The default background color is also changed to Window so that it looks
good in more themes.
Previously, if it was displaying N glyphs per line, then you changed
font to one that was a drastically different size, it would continue to
display N glyphs per line until you resized the window. Now, we
immediately recalculate how many to show, so that they fill the
available width. :^)