133 Commits

Author SHA1 Message Date
Martín Capello
2cf880eaf9 Delete duplicated include 2024-10-15 16:24:41 -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
f27fb00acf Merge branch 'main' into beta 2024-06-14 20:26:25 -03:00
David Capello
2c7fc767bf Update GPU flag correctly on all display when it's changed 2024-06-14 20:07:05 -03:00
David Capello
571b4ec9f2 Update to new laf API (os::System::instance()/make()) 2024-03-05 18:50:24 -03:00
David Capello
b7f06c1366 [devmode] Ctrl+Shift+R shortcut is available in devmode (debug can be on or off) 2023-05-01 19:18:23 -03:00
David Capello
9b76f95b15 Fix Left/Right keys to move through frames in FramesSelection context (fix #3821) 2023-04-25 10:38:49 -03:00
David Capello
a9207524ff Minor refactor in code to handle keys
Added CustomizedGuiManager::processKey() member function.
2023-04-25 10:30:39 -03:00
David Capello
e78e1e9a54 Remove current_editor, replace with Editor::activeEditor()
Finally removed src/app/modules/editors.h file.
2022-10-20 12:31:22 -03:00
David Capello
8f44b521b6 Merge branch 'main' into beta 2022-06-10 10:31:13 -03:00
David Capello
71d885d2a0 Replace base::clamp -> std::clamp as now we use C++17 2022-06-09 19:05:48 -03:00
David Capello
ff5afba6ae Merge branch 'main' into beta 2022-05-19 16:55:30 -03:00
David Capello
0a3644dfbb Update laf module with initial GPU support (#960)
Anyway this is incomplete and Aseprite is not yet ready to support GPU
acceleration (as the rendering phase is CPU intensive).
2022-05-13 11:41:44 -03:00
David Capello
76a815cc2c Merge branch 'main' into beta 2021-10-20 11:53:47 -03:00
Martín Capello
c5fccb1499 Add a check to allow exit command execution only when the main window is the currently running 2021-10-20 11:35:54 -03:00
David Capello
8b5d7be104 Add support to move the Preview window with a styles/pen on Windows
Fix part of https://github.com/aseprite/aseprite/issues/2783
2021-08-12 16:25:20 -03:00
David Capello
4a5a3a7bc4 Fix compilation when ENABLE_DEVMODE is defined 2021-07-05 19:41:51 -03:00
David Capello
12aef12ed1 Merge branch 'main' into beta 2021-07-05 18:45:00 -03:00
David Capello
c42c5e1453 Backport new laf API to main branch of aseprite
Some features from the beta branch of aseprite & laf were backported
to the main branch of aseprite.

Related commits:
- New memory handling (db4504e816ffccf0ea63a78737ebb6e22cc0453b)
- New get event with timeout (e6ec13cc31e6e689040bc651f98ee1752834d14c)
- Convert os::NativeCursor to an enum (06a5b4f3aebfafb6363ea33d349975d6e419ca7b)
- Adapt code to the new os::Display -> os::Window refactor (5d31314cdb23f314391e5eaebd7cea84f5179ac7)
- Save/load main window layout correctly and limit to current workarea (d6acb9e20f11fda938959c99285fe4f7d7051794)
- Redraw window immediately on "live resizing" (d0b39ebade7736d47e6b2450bf68b088c0da8e57)
2021-07-05 17:51:29 -03:00
David Capello
b02fc43506 Add info msg when LAF_BACKEND=none is used and GUI cannot be initialized 2021-06-07 15:05:35 -03:00
David Capello
e7f0832ff3 Fix setting color space of all os::Windows 2021-05-21 21:44:30 -03:00
David Capello
d2c6abf5a7 Fix saving/loading correct frame position (mainly on macOS)
We have to save the frame position before we close the native
window.
2021-05-10 11:52:38 -03:00
David Capello
d6acb9e20f Save/load main window layout correctly and limit to current workarea
* Now the restored frame position/maximized flag are saved correctly.
* We've improved the default size to the current workarea of the main
  screen.
* Limit the initial frame position to the current available screens
  (e.g. the saved frame position could be invalid if the user
  unplugged a monitor)
2021-04-29 16:13:45 -03:00
David Capello
1f5b6980d3 Fix File > Open initial position when multiple monitors are used
With this patch we removed the ui::get_desktop_size() function
too (now we can get the workarea of the display's screen).
2021-04-21 17:01:43 -03:00
David Capello
cf21f78d8d Limit loaded windows frame position with active workarea 2021-03-19 20:20:24 -03:00
David Capello
bcd69495ce Fix several issues locating windows with multiple UI windows
We've refactored the code to support locating windows (and popups
windows + hot regions) correctly in both modes: with one ui::Display
and with multiple ui::Displays.

For this we've added a new ui::fit_bounds() function that works in
both modes.
2021-03-19 18:57:56 -03:00
David Capello
8034b0cbcc Add support for multiple native windows (#139, #250, #962, etc.)
Each ui::Window now can have a related native os::Window. This
connection is done through the ui::Display class added recently in
c3d52f0bbe5242923c9e38495e1be1135ca0934f.
2021-03-02 13:50:49 -03:00
David Capello
9dedb41e0f Fix compilation when ENABLE_DEVMODE is defined 2021-02-24 09:26:24 -03:00
David Capello
c3d52f0bbe Add ui::Display to support multiple windows in the future
This ui::Display is related to one native os::Window, so the dirty
region/invalid region is now part of a ui::Display instead of a
ui::Manager.

* Replaced ui::display_w/h() functions with ui::Display::size()
  and ui::get_desktop_size()
* The ui::Manager contains the main ui::Display, and in the future an
  ui::Window will have its own ui::Display
2021-02-18 12:34:42 -03:00
David Capello
5d31314cdb Adapt code to the new os::Display -> os::Window refactor 2021-02-02 15:59:28 -03:00
David Capello
d0b39ebade Redraw window immediately on "live resizing" 2021-01-12 21:39:12 -03:00
David Capello
91628daa9d Merge branch 'master' into beta 2020-12-22 15:48:15 -03:00
David Capello
81d9e8afec Fix bug with Console when the UI Screen Scaling is changed 2020-12-11 15:52:14 -03:00
David Capello
20d763ca4b Merge branch 'master' into beta 2020-07-30 16:48:43 -03:00
David Capello
8c0f81cbba Improve handling of image sequences when dropping files or opening multiple files
Now we can repeat the same action (Agree/Skip the all sequence of
images) for all the dropped files/selected files in the "Open File"
dialog (as in the CLI new behavior).
2020-07-30 16:27:23 -03:00
David Capello
db4504e816 Refactor laf-os memory handling 2020-07-07 19:06:48 -03:00
David Capello
c8999af6d6 [steam] Avoid crash taking screenshots after Steam client is closed 2020-06-11 14:51:28 -03:00
David Capello
86259a64fc Replace MID() macro with base::clamp() function
In the future we will replace base::clamp() with std::clamp().
2020-04-07 19:47:16 -03:00
David Capello
9461c5d02c Don't allow call Exit command (e.g. Cmd+Q on macOS) when there is a foreground window
The same for drop files, we've disabled dropping files when there is a
foreground window (at least temporarily to avoid strange UI states).
2019-10-29 10:31:12 -03:00
David Capello
d32fd97da5 Replace base::SharedPtr with std::shared_ptr
We can remove our smart pointer (base::SharedPtr) as we're already
using C++11 compilers on all platforms.
2019-08-01 19:16:16 -03:00
David Capello
79795b97a9 Fix hang if we press Cmd-S two or more times quickly to launch File > Save
With this we avoid to unintentional execute two or more times a
command when we are already in a command execution.
2019-06-03 23:02:24 -03:00
David Capello
93fe19d353 Use cancelable async tasks to load/delete backup sessions 2019-05-30 23:17:13 -03:00
David Capello
dd8a49a19c Add option to disable changing the display color profile depending on the current monitor 2019-05-08 10:55:56 -03:00
David Capello
2ffb708be8 Move Manager::invalidateDisplayRegion() to Manager::onInvalidateRegion() 2018-12-03 23:59:42 -03:00
David Capello
6bdde193f3 Don't limit the minimum windows size of the Preview window when we restore its bounds
Fixes https://community.aseprite.org/t/960
2018-11-29 11:44:10 -03:00
David Capello
a38a23e2e5 Add support to drag-and-drop .aseprite-extension files into the main window 2018-11-28 10:30:33 -03:00
David Capello
5cb2d984f0 Rename she -> os 2018-08-09 12:58:43 -03:00
David Capello
f2ed45e795 Replace base::UniquePtr -> std::unique_ptr 2018-08-08 17:27:26 -03:00
David Capello
413603a71a Don't use KeyboardShortcuts singleton for temporal changes in Keyboard Shortcuts dialog
Main changes:

- Improve the "Keyboard Shortcuts" dialog because instead of changing
  global shortcuts/menu keys and rollback everything if we select
  "Cancel", here we make a copy of all shortcuts, modify them in the
  dialog UI, and finally "commit" to the global shortcuts if the user
  confirms the dialog.
- Fix "Reset" button in "Keyboard Shortcuts" dialog for mouse wheel
  customization
2018-07-23 15:15:04 -03:00