Now ui::Theme is not an abstract class anymore and can be used for
simple tests/benchmarks. Some member functions are empty, but can be
implemented later if needed.
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.
Before this fix, an incomplete custom theme or an outdated official
theme could cause a crash during Aseprite startup.
This fix does not alert the artist the problem of the theme.
Simply avoid the crash.
Regression in dd0c29620974e56d9e62653804b996740a89e88a (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 should improve the mouse movement, where a new mouse cursor was
created on each mouse movement with black & white pixels. It's a
regression introduced in ef4f691459d13b45459c56383ab3673ca6fbec0a
(which was originally introduced to improve the mouse movement
perception in a 100Hz monitor).
This might be a possible fix for:
https://github.com/aseprite/aseprite/issues/2713
We've added some code to handle backward compatibility with themes. In
this way we can still load old themes in the latest version but should
look as in previous versions (this will not be done with previous
properties or parts migrated to styles, so we start from now on).
This new ui::Style should finally replace the old app::skin::SkinStyle
class. At this moment both implementations are working to avoid an
huge refactor in just one commit.
- Added new ui::Style property in ui::Widget.
- Removed old code to set the button "bevel" (removed
app::setup_bevels() functions).
- Removed setup_look() function and Left/RightButtonLooks.
- Removed check_button_new() function.
- Removed ui::Theme::paintButton/ComboBoxButton() functions.
There are some widgets (e.g. fg/bg color buttons in the ColorBar, and
ContextBar's check-boxes) that use a "mini font". We could setup the mini
font in onInitTheme(), but the whole program is not ready to do something
like that (there are too much child_spacing/borders values that are set
outside onInitTheme).
A better way is to ask to the theme itself (Theme::getWidgetFont())
about what font to use for each specific widget. And the Widget::m_font
field can act as a cache of this requested font. So now the "mini font"
is specified in a SkinProperty's flag.
This is an huge refactor to avoid handling Allegro FONT directly. Some
changes:
* Add she::System::defaultDisplay/Font, createRgbaSurface, loadSurface,
and loadRgbaSurface.
* Rename she::CreateSystem/Instance to she::create_system/instance.
* Remove ui/font.cpp and move ui/fontbmp.cpp to she library.
* ui::IButtonIcon uses she::Surface instead of BITMAP.
* Rename she::LockedSurface::drawAlphaSurface -> drawRgbaSurface
* Rename ui::SetDisplay -> set_display
* Rename _ji_font_text_len -> ui::Graphics::measureUIStringLength