9904 Commits

Author SHA1 Message Date
David Capello
d5d5894df6 Allow re-creating the ui::Manager multiple times 2024-12-07 14:34:45 -03:00
David Capello
60eee6e809 Move Strings initialization to App instance creation
This removes Strings::createInstance() and we can check with ASSERT()
the singleton in the Strings class ctor/dtor.
2024-12-07 14:34:45 -03:00
David Capello
9b82e1aac9 Show warning if the GUI is not available
Only for compiled versions without Skia. Useful to let users know that
they have compile with LAF_BACKEND=skia
2024-12-07 14:34:45 -03:00
David Capello
24ad3e36a8 Add tests to initialize/finish the app::App instance 2024-12-07 14:34:45 -03:00
David Capello
b6f27a2718 Destroy the MainWindow at the end of run()/close() functions
This explicit reset() was included for the editor_benchmark in
19037a2e69ef1aa9303eea5af8a200b403fdeba4 but it should be at the end
of the close() function.

This fixes a failing ASSERT() in ~DocObserverWidget when we destroy
the ContextBar.
2024-12-07 14:31:25 -03:00
David Capello
99dad9f349 Remove unused variable 2024-12-07 13:35:45 -03:00
David Capello
4f0335f887 Fix initialization order warning 2024-12-07 12:30:22 -03:00
David Capello
b1314436c1 Use the new laf-dlgs library 2024-12-06 09:28:11 -03:00
David Capello
0df7ed0ef2 Merge branch 'main' into beta 2024-12-05 23:37:45 -03:00
David Capello
6ff046685a Set the simple style for scrollbar thumbs 2024-12-05 22:45:58 -03:00
David Capello
04a6758ed8 Fix invalid std::clamp(layer, 0, -1) usage in timeline
This can happen in certain benchmarks that don't create a layer. We've
added a return value to getDrawableLayers() to know if the returned
range is valid.
2024-12-05 22:18:43 -03:00
David Capello
19037a2e69 Close/destroy MainWindow in case we didn't call App::run()
This can happen in some benchmarks like editor_benchmark, were the App
is created, but App::run() never called.
2024-12-05 20:31:20 -03:00
David Capello
731e982a53 Update benchmark library
1) In benchmark docs it says that a range-based loop is preferred
instead of KeepRunning() call:

  https://github.com/google/benchmark/blob/main/docs/user_guide.md#a-faster-keeprunning-loop

2) Now we call benchmark::Shutdown() in editor/view benchmarks exit
2024-12-05 20:13:37 -03:00
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
77e0944baa Add more instructions about how to solve an incomplete cloned repo
Related to issues commented in #4562 and #4866
2024-12-05 10:16:55 -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
97dc9c8988 [osx] Fix showing the native window back when the app is hidden (fix #4857) 2024-12-03 22:25:12 -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
Ryan Carsten Schmidt
2b97e44dfd Set ZLIB_FOUND ON rather than unset it
Fixes #4854
2024-12-03 07:27:41 -06:00
David Capello
f710603f99 Update SDK dirs of all CMakeFiles/*/*.cmake files too (#4773) 2024-12-02 00:19:24 -03:00
David Capello
0905e974cd Add option to update the MSVC cl.exe dir for all builds (#4773)
CMakeCache.txt and other files (rules.ninja, other .cmake files) save
the full path to the cl.exe binary, including the specific MSVC
version. We've added an option to update that specific version to
continue using all builds/configurations with the new updated path to
cl.exe.
2024-12-02 00:07:30 -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