9886 Commits

Author SHA1 Message Date
David Capello
890e27b0a1 Fix UI tests
Fixed a crash accessing a nullptr native window running UI tests from CLI.
Regression from 2e13559bbb211e79f5a031daa7b241a98b75895d
2024-12-05 10:30:25 -03:00
David Capello
2e13559bbb Fix crash displaying the Preview window in multiple windows (fix #4864)
We were using a backLayer with a nullptr surface.
2024-12-04 15:52:39 -03:00
David Capello
c6a1a6868a Add some style for selected items in the simple theme 2024-12-03 15:52:47 -03:00
David Capello
969dd68490 Move default handleWindowResize handler to ui-lib 2024-12-03 15:52:26 -03:00
Christian Kaiser
de7d8684ff Add a helper to View to standardize scrolling behavior 2024-12-03 13:41:05 -03:00
David Capello
9b5920eef3 Better handling of auto-scroll cases with BrushPreview boundaries
When auto-scroll is disabled, we can even paint moving the mouse
outside the editor viewport bounds, we should keep moving the brush
preview cursor anyway.

When we touch the editor viewport bounds, this patch:
1) Avoids flickering the cursor in auto-scroll mode, and
2) keeps the cursor moving when auto-scroll move is disabled
2024-12-01 22:49:35 -03:00
David Capello
db56bb9657 Remove ui::hide/show_mouse_cursor() functions
Unused functions as now we always use native custom cursors (or in
case we require this in the future, we could just use an UILayer to
show the mouse cursor).
2024-12-01 22:47:11 -03:00
David Capello
60bd3378fc New UILayers to composite floating elements (fix #4825)
* Replaced ui::Overlays with ui::UILayer
* Refactored BrushPreview to use its own UILayer (+ new blender shader
  for the negative black & white effect).
* Add a default back UILayer to each ui::Display
* Use ui::move_region() in this "back layer" when GPU is disabled.

Although we should completely remove ui::move_region in a future, for
CPU rendering sometimes it's faster to just move memory instead of
redrawing the widgets.
2024-12-01 22:46:37 -03:00
David Capello
fd5ba19e2f Fix compilation error now that Widget::font() returns a FontRef 2024-11-30 12:57:15 -03:00
David Capello
f10bc52b6c Use TextBlobs to paint tabs 2024-11-30 12:49:12 -03:00
David Capello
6b7aa371ce Add benchmark for ui::View scroll
This patch includes a new ui::Manager::dontWaitEvents() function to
avoid waiting for any user interaction. The old editor_benchmark now
uses this new function too.
2024-11-30 09:38:04 -03:00
David Capello
a71909d0ca Add a simple ui::Theme impl
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.
2024-11-30 09:38:04 -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
7e780bf3bf Move Theme::fontMgr() impl from app-lib to ui-lib 2024-11-30 09:38:04 -03:00
David Capello
3f591aa5df Try to use TextBlobs to paint ui::Style's text layers 2024-11-30 09:34:51 -03:00
David Capello
9e51e04606 [clang-tidy] Disable misc-include-cleaner 2024-11-30 09:34:26 -03:00
David Capello
c586ac5b14 Add ui::Graphics::drawTextBlob() function 2024-11-30 09:11:57 -03:00
David Capello
1e56e7da5a Merge branch 'main' into beta 2024-11-27 15:35:51 -03:00
David Capello
8241e03612 Fix clang-tidy-review action 2024-11-27 15:20:15 -03:00
Martín Capello
58326b1508 Handle null target in DragEvent (fix #4824) 2024-11-26 09:46:47 -03:00
David Capello
bf430fc3b9 Add missing #include to use LOG() when HAVE_CONFIG_H isn't defined 2024-11-25 15:40:47 -03:00
David Capello
ae9e3583a4 Merge branch 'main' into beta v1.3.11-beta2 2024-11-21 19:09:50 -03:00
David Capello
9bc16e9bec Fix FontPopup style after changing theme 2024-11-21 19:02:39 -03:00
David Capello
ad57997482 Fix font preview/thumbnail in dark mode/any theme (fix #3851) 2024-11-21 19:00:57 -03:00
David Capello
ff993f1687 Paint pinned fonts correctly when multiple windows option is off (fix #4815) 2024-11-21 18:11:01 -03:00
David Capello
3b7f78f41c [win] Move CoInit class to laf-base 2024-11-21 17:49:31 -03:00
Martín Capello
45c2a59504 Change window visibility only when owns display
Before this the visibility was changed if the window pointed to a
display without taking into account that it might not own it. Fix #4805
v1.3.10.1
2024-11-21 17:32:37 -03:00
Martín Capello
7038ab501e Call onOpen on parent class to fire Open signal
Fixes this issue:
https://community.aseprite.org/t/dialog-show-bounds-rectangle-is-broken-in-1-3-10/23917/1
2024-11-21 17:32:13 -03:00
David Capello
84f3101681 [win] Use WinTab/tablet pressure only for certain windows (#3358)
Windows that need tablet information are the MainWindow, DynamicsPopup,
and scripts Dialog.
2024-11-21 17:23:50 -03:00
David Capello
dbccf71622 Fix crash clicking canvas w/enabled timeline range + keep selection (fix #4809)
There is a moment inside Timeline::updateUsingEditor() where the
TimelineAdapter is nullptr between detachDocument() and the
updateTimelineAdapter() call, so just using a m_editor->getSite() was
going to ask for the timeline adapter if the selection was kept intact
("Keep selection" option enabled).

With this patch we simplify updateUsingEditor() just avoiding the
getSite() call at all (using the Editor fields directly) and handling
the special case where we already are in the same editor as a fast path.
2024-11-21 14:07:03 -03:00
David Capello
8c55c1db07 Fix crash dragging files on timeline in certain cases (fix #4801)
With the combination of 8b0b1d8d1e2624eaa8433df58b83845902cd7975
(allowing transactions in docs without context) and
be17c4832405be44193a4d24268c38da80369743 (getting the active DocRange
from Doc context), we were getting a crash accessing a nullptr context.
2024-11-21 10:24:39 -03:00
David Capello
b03dffb5cd [lua] Disable 'beforesitechange' event (#4569, #4780, #4785) v1.3.11-beta1 2024-11-19 21:18:21 -03:00
David Capello
41baef2627 Merge branch 'main' into beta 2024-11-19 16:00:11 -03:00
David Capello
a7c8d4cb06 Update laf module v1.3.10 2024-11-19 15:56:32 -03:00
David Capello
59ff0d801a Add missing call to Widget::onVisible()
This is not necessary at the moment but just in case if in the future
we add a signal or Widget::onVisible() starts doing something.
2024-11-19 14:16:07 -03:00
Martín Capello
2e17f27237 Fix windows visibility when using multi-displays
Fix #4789
2024-11-19 14:14:53 -03:00
Martín Capello
f76bbcff67 Avoid clipping hidden windows (fix #4546) 2024-11-19 14:14:53 -03:00
David Capello
9eadd740b8 Disable tool changes when we're previewing a filter
In this way the user cannot use Ctrl key to try to move a cel and get
an error that the sprite is locked so we cannot move the cel. Actually
we shouldn't be able to move the cel when we're using the Editor for
preview purposes (FilterWindow / WindowWithHand).

This issue was reported in #4465, and created for the new
Dialog:show{hand=true} API mainly.
2024-11-19 14:05:13 -03:00
David Capello
21565a9349 [lua] Update scripting API version to 30 2024-11-19 13:15:27 -03:00
David Capello
4d7b28bfb6 Refactor removing duplicated code with new WindowWithHand
FilterWindow and DialogWindow (for scripts) share this code to enable
the Hand tool in the active Editor.
2024-11-19 13:04:57 -03:00
David Capello
699342fe9d Add function to copy non-shared properties between cels
At the moment it's the z-index, but if in the future we add new
non-shared properties, we can move those here.
2024-11-19 13:04:47 -03:00
David Capello
03361fdd07 [lua] Add app.editor.zoom / scroll properties (fix #4722) 2024-11-19 12:47:48 -03:00
Gaspar Capello
e269cffc63 Fix regression crash using Dynamics (fix #4788)
Prior to this fix, Aseprite would crash when using
Dynamics + Dithering by simply clicking on the canvas.
The regression has been introduced in b7aa5d5 'Add Diagonal Symmetry'.
2024-11-19 11:36:20 -03:00
David Capello
7ff124d108 Add HD icons 2024-11-15 19:02:57 -03:00
Christian Kaiser
a43841f8b7 Add 'beforesitechange' event (fix #4569) 2024-11-13 15:17:02 -03:00
David Capello
6b85919534 [lua] Fix syntax/formatting and rename Dialog{move} param to "hand" (#4465) 2024-11-13 13:23:06 -03:00
lampysprites
d32fc4c704 [lua] add option to move canvas to foreground dialog 2024-11-13 13:10:07 -03:00
David Capello
a19a844498 Update comment about DocApi class 2024-11-13 10:07:33 -03:00
David Capello
1ec76afeaf Fix bug copying/moving cels with z-index (fix #4779) 2024-11-12 22:05:06 -03:00
Gaspar Capello
21e8e01951 Fix duplicate Sprite or Layer don't duplicate z-indexes (fix #4665)
Prior this fix, duplicating linked cels with different z-order
created linked cels with the same z-order in all linked set.
2024-11-12 12:08:16 -03:00