This was a pending refactor, where "user.aseprite-keys" files were
already using the "shortcut" attribute (instead of "accelerator").
This will include a refactor in the Weblate projects/all translations
to change [select_accelerator] section to [select_shortcut]. But that
must be coordinated after this commit is merged.
* There is a new system="" attribute for <font> elements
* New <font><windows ... /><macos ... /><linux /></font> elements to
select platform specific fonts
* Fixed several bugs related to re-using fonts from the cache when
customizing the current theme font from Edit > Preferences > Theme
* Removed Fonts::infoFromFont() adding FontInfo(FontData) constructor
* Each widget can customize its text baseline (onGetTextBaseline()) to
know where to draw text when it's vertically aligned to the middle
(now more correctly "aligned to the baseline").
* Add PAINT_BASELINE to test where the baseline is on each widget.
* "Aseprite" and "Aseprite Mini" fonts now have a special
descent/ascent configuration with a specific baseline position.
Graphics::measureText() wasn't shaping text correctly using the
FontMgr to get more fonts when they were required. And now
SkinTheme::drawText() can use Widget::textSize() (the cached size of
the widget text blob) to calculate the required text size.
Includes:
* New ui::Style::rawMargin/Border/Padding() to detect what values are
undefined, and ui::Style::margin/border/padding() to return normalized
values (replacing kUndefinedSide with 0 when a value is not defined in
the whole hierarchy of styles). With this change we avoid using a
margin/border/padding value of -1 by mistake.
* New guiscaled_div() to calculate an integer division taking care the
guiscale() for a scaled value.
* CALC_FOR_CENTER() renamed to guiscaled_center() and moved to ui/scale.h
There are still a lot of work to be done to fully fix these UI issues
between Screen Scaling=200%/UI Scaling=100% vs Screen Scaling=100%/UI
Scaling=200%
This is the first (not yet production-ready) version of the
interactive Text tool. The text input is done with a transparent
ui::Entry, and on each text modification an ExtraCel is rendered with
this same ui::Entry's TextBlob to be displayed in the canvas with the
active zoom level.
The ui::Entry is being painted along the text in the canvas (just for
testing), but this is something to be fixed. Probably it will not be
the case in the future and a fully customized rendering (onPaint())
process will be required.
This new font selector list installed fonts with its proper name. It
still needs some extra work to select font set styles (regular, bold,
italic, etc.)
As the new text::draw_text() can draw text with "native" (Skia) fonts,
we have to pass the font manager (text::FontMgr) to it, which is in
SkiaTheme. So we've added a new abstract fontMgr() member function to
ui::Theme to get the active font manager.
When we received a MouseEnter/Leave, we were processing those laf-os
events immediately without taking care of all the MouseMove/Down/Up
events in the middle. Now we enqueue all the events as
messages (MouseEnter -> MouseMove/Down/Up -> MouseLeave).
This is important because when we process MouseLeave we are calling
setMouse(nullptr), which resets the mouse widget HAS_MOUSE flag, and
some widgets needs to know if they have the mouse above before the
MouseUp event. With this change we can remove the
Widget::hasMouseOver() function (that was checking the global
ui::get_mouse_position() instead of the HAS_MOUSE flag directly).
Another change was introduced to keep the old behavior now that
hasMouseOver() is not available: the ui::Manager doesn't assign the
HAS_MOUSE flag if the mouse is captured (it only assign the HAS_MOUSE
to the widget with the mouse captured, or to no widget, at least until
the capture is released).
We have to copy all missing <style> into the new theme, so these
styles are re-loaded using colors and parts from the new
theme (instead of using the data of the default theme).
Regression in dd0c296209 (Use
tooltip_text style & color to paint tooltip windows #2554).
Prior this fix, text box does not update its bounds area because it
has not a style assigned.
Fix#3442, fix#3443
This was done to avoid some nullptr references using
SkinTheme::instance() (mainly from
StatusBar::IndicatorsGeneration::add()) when the application is being
closed because an exception was thrown. This might be useful to detect
certain kind of crashes from Sentry.