Commit Graph

19 Commits

Author SHA1 Message Date
David Capello c444b566e1 Fix painting UI theme colors as they are specified in sRGB color space
Fixes a regression found after merging #5414:
https://github.com/aseprite/aseprite/pull/5414#issuecomment-3286339563

We always expected a sRGB color in ui::Graphics API and we can specify
a color in another color space using the ui::Paint version of its
member functions.

Several functions related to color spaces are now using a ui::Display
to receive the specific display where we're going to paint, instead of
using os::System::instance()->defaultWindow()->colorSpace().
2025-09-16 09:42:35 -03:00
David Capello d7b07a5173 Now Paint::color() can receive a color space w/any laf backend 2025-09-12 12:24:53 -03:00
Gaspar Capello 907138d5dd Fix wrong color space in multiple UI elements
This fix solves color space missmatch in the following UI elements:
- Timeline thumbnails
- Palette entries
- Tileset entries
- Color Spectrum and Wheels
- Color Popup Gradients
- Color Button
2025-09-05 14:50:36 -03:00
David Capello 09538f9a1a clang-format all files 2024-12-16 14:52:19 -03:00
David Capello ab599c5863 Simplify Font ptrs management in ui-lib returning FontRefs
We can return "const text::FontRef&" to avoid adding a new reference
to an existing FontRef just to access a Style/Widget font.
2024-11-30 09:38:04 -03:00
David Capello a21f0888ad Merge branch 'main' into beta 2024-09-03 11:26:23 -03:00
David Capello bf0a47545c Remove #if/endif ENABLE_UI conditional directives (fix #4619)
This was originated for #1279 (CLI-only Aseprite) which can be
achieved with LAF_BACKEND=none anyway.

In this way we simplify the development process, and checking for the
availability of the GUI can be done in run-time through App::isGui()
or Context::isUIAvailable().
2024-09-02 23:16:26 -03:00
David Capello 571b4ec9f2 Update to new laf API (os::System::instance()/make()) 2024-03-05 18:50:24 -03:00
Martín Capello 0958573cac Add canvas autoScaling feature (fix #3748) 2023-04-27 11:07:26 -03:00
David Capello af9f7288ee [lua] Add 'ondblclick' event for canvas widget 2023-03-27 14:22:10 -03:00
David Capello 17825921e0 [lua] Add onkeydown/onkeyup events to canvas widget 2023-01-04 14:40:10 -03:00
David Capello 1830e5343f [lua] Add onwheel and ontouchmagnify events to Dialog:canvas() 2022-12-29 15:12:15 -03:00
David Capello a6a7519178 [lua] Add possibility to modify the mouseCursor of a canvas 2022-12-26 15:33:14 -03:00
David Capello 8eacee4c98 [lua] Dialog:canvas() will capture the mouse on mousedown/up by default 2022-12-21 19:09:34 -03:00
David Capello b42a8b7ecf [lua] Add fillText() and measureText() functions to GraphicsContext 2022-12-15 10:01:13 -03:00
David Capello 0aaa9fdddf [lua] Add onmousemove/down/up events to canvas widget
At the moment very basic properties were added to the received event:
x, y, and button.
2022-12-14 22:13:49 -03:00
David Capello 25682a44d8 [lua] Add Dialog:repaint() function 2022-12-14 21:17:51 -03:00
David Capello 2cb526a19b [lua] Add new GraphicsContext type for Canvas onpaint event
We include a simple initial API for the GraphicsContext (like
stroking/filling rectangles and images).
2022-12-14 18:59:44 -03:00
David Capello 6e13e59aff [lua] Add initial version Dialog:canvas() (aseprite/api#87)
Right now it just creates a plain widget, but now we can specify
hexpand/vexpand arguments too so we can create a canvas with a fixed
size or with dynamic size (e.g. to use the whole dialog client area).

The onpaint event is not functional yet.
2022-12-14 17:33:29 -03:00