Commit Graph

75 Commits

Author SHA1 Message Date
Christian Kaiser f3d36ca4c4 User data with multiple lines of text (new TextEdit widget) (#3130, #3131, #4743, #4968) 2025-10-07 08:06:47 -03:00
David Capello 7e4f9ad078 Merge branch 'main' into beta 2025-09-04 20:41:48 -03:00
David Capello 1fa7fd0831 Minor UI fixes for dialogs with user data
This patch unifies the behavior of all dialogs with user data to
expand the window vertically onToggleUserData().
2025-08-25 16:20:37 -03:00
Christian Kaiser 366751d1f2 Command refresh and refactor, ui availability consistency (fix #3025) 2025-08-05 19:03:21 -03:00
David Capello 09538f9a1a clang-format all files 2024-12-16 14:52:19 -03:00
David Capello be17c48324 Fix Timeline operations with ranges using virtual vs real ranges (#3904)
- Now we have a view::RealRange (with real frames, fr_t) and a
  view::VirtualRange (with virtual frames, columns, col_t). The timeline
  uses a virtual range internally and makes the conversion to a real
  range when it's appropiated (e.g. to execute an old DocRange operation
  using ranges with real frames).

- Added Context::range() to access to the real selected range
  instead of accessing directly to the timeline. In this way commands
  that were using the DocRange can access to the real range using the
  context, instead of the timeline's virtual range.

- Added a new ShowTagTimelineAdapter that can show just one tag in the
  timeline filtering out/hiding all other frames/tags.
2024-11-11 19:37:47 -03:00
David Capello 8722c8ec16 Lock document in Tx() ctor (part of #2430)
This already fixes a lot of possible problems that can happen when a
script is running and modifying some part of a sprite that is being
backed up in a background thread.

We still need some work to being able to lock a sprite two or more
times in the same thread to write it. E.g. an app.transaction() should
lock the sprite for write access, but the script transaction function
could call a command, and that command could use a ContextWriter to
lock the sprite again. At the moment this is not possible because we
need a re-entrant RWLock implementation.
2023-12-27 11:05:15 -03:00
David Capello abba4684a7 Fix error messages about locked sprite when deleting multiple cels (fix #4204)
This is a combination when we modify a layer property and then
modify/delete several cels/frames/layers.
2023-12-06 12:47:52 -03:00
David Capello 5e34ae0ce2 Fix unused variable warnings 2023-09-27 19:57:41 -03:00
Gaspar Capello 0c3d78b4ce Fix unexpected behavior during multiple cel selection + cel property changes (fix aseprite/aseprite#3886)
Prior to this fix, if a field was modified, all fields were overwritten with the values from the Cel Properties dialog.
2023-07-18 10:39:13 -03:00
David Capello 7a26281ce3 Change all selected cel properties when we select frames/layers (fix #3807)
The Cel Properties dialog wasn't working right when we selected a
range of layers or frames.
2023-05-15 15:20:16 -03:00
David Capello b28550faf5 Use new ScopedValue w/o old arg + C++17 class template argument deduction (CTAD) 2023-04-14 13:43:36 -03:00
David Capello 24846eae10 Add z-index property to cels (fix aseprite/Attachment-System#88)
* Now a Cel has a z-index property to change the order of layers per frame
* A new doc::RenderPlan class can calculate the order of cels to be rendered
* z-index is saved as a int16_t in the .aseprite files
* This new field can be set/get from Lua with Cel.zIndex
2023-04-10 19:23:16 -03:00
David Capello 616f74ae2d Minor changes when accessing "properties_grid" widget 2022-10-13 09:40:54 -03:00
David Capello b9206cc872 Fix locked sprite errors moving/copying multiple cels when the Cel (or Layer) Properties dialog is open (fix #3278) 2022-05-19 19:15:32 -03:00
David Capello 52779d4b09 Fix memory leak in UserDataView simplifying its ctor
Each "new gen::UserData" wasn't being freed.
2022-05-19 18:56:21 -03:00
David Capello 9f300bf55d Better handling of Cel Properties for multiple cels 2021-06-11 11:04:52 -03:00
David Capello a4e7ac13c1 Fix crash in Cel properties dialog when range is enabled & active cel is empty 2021-06-11 10:45:49 -03:00
Gaspar Capello 08f63f1b02 Fix cel and layer user data text input do not update when a fast layer change happen. 2020-11-05 18:42:32 -03:00
Gaspar Capello 13addb4336 UI user data window integration 2020-10-13 11:07:10 -03:00
David Capello 4e08d12f28 Merge branch 'master' into beta 2020-08-06 10:46:32 -03:00
David Capello d7a3da9518 Fix crash using opacity slider on CelProperties after deleting a cel
Crash report: https://igarastudio.zendesk.com/agent/tickets/1208
2020-08-04 10:42:28 -03:00
David Capello 8a3f32b47f Replace all base::Bind() with lambda functions 2020-07-03 21:51:46 -03:00
David Capello 271865e13d Remove unused Command::clone() member function 2019-01-07 17:03:38 -03:00
David Capello 70629d6f89 Use Tx instead of Transaction in commands 2018-08-20 16:00:59 -03:00
David Capello 9c79ea2b77 Rename app::Document -> Doc 2018-07-07 11:54:44 -03:00
David Capello d00fc99138 Rename DocumentRange -> DocRange 2018-07-07 10:07:21 -03:00
David Capello ee5842cde3 Rename DocumentApi -> DocApi 2018-07-07 03:07:16 -03:00
David Capello 457a9999b5 Move doc::Context to app::Context (#378)
We've moved everything related to Context/active site/observable
documents from "doc" namespace to "app" namespace.
2018-07-07 02:47:42 -03:00
David Capello 612ad98392 Rename DocumentObserver/Event to DocObserver/Event 2018-07-06 21:06:03 -03:00
David Capello e0a60b6748 Generate the list of command IDs from en.ini file 2017-12-01 15:10:21 -03:00
David Capello ccee49c02b Move command friendly names to the strings file
Related to #124
2017-11-30 23:41:45 -03:00
David Capello d9be0572df Fix change of properties to several layers at the same time 2017-04-05 16:01:18 -03:00
David Capello 60ce295870 Move timeline code to app/ui/timeline/ folder 2017-03-26 13:33:12 -03:00
David Capello c60e0b915c Merge branch 'master' into beta 2016-10-27 13:00:57 -03:00
Keith Whitney cf6cd534ef Allow Esc key to close Cel Properties window
Resolves aseprite/aseprite#964.
2016-10-24 23:31:21 -04:00
David Capello 1404b0ce7d Merge branch 'master' into beta 2016-09-16 16:02:26 -03:00
David Capello 6377b550e3 Replace base::Signal/Observable* with obs::signal/observable
We can use the obs library directly for signal/slots and observable
objects.
2016-09-13 15:02:00 -03:00
David Capello 20b726f73b Merge branch 'master' into beta 2016-08-31 19:53:52 -03:00
David Capello 5ecc356a41 Replace GPL license with the new EULA 2016-08-29 13:08:21 -03:00
David Capello 94b508989e Fix changing opacity of a cel's range
We have to change the range in Timeline before generating a
onActiveSiteChange() so the cel's properties dialog knows the new range
to be used to change the opacity.
2016-08-25 20:21:38 -03:00
David Capello f2f1c1008b Add support to move/copy non-adjacent layers/frames
Changes:
* With this patch we finally removed the LayerIndex class and member
  functions to access layers by index (like Sprite::firstLayer/layerLayer
  /layer/indexToLayer/layerToIndex() etc.). As layer groups can be
  expanded/collapsed, it doesn't make sense to use layer index to
  access layers directly from sprite.
* Now we use a layer_t (int) to access a list of browsable layers each
  time we want to iterate visible layers in the timeline.
* Replaced CelsRange() and Sprite::uniqueCels() param with
  SelectedFrames to iterate non-adjacent cels.
* Updated clipboard operations (copy/paste) in timeline to support
  layer groups.
* Updated Timeline control to support selecting multiple layer/frame
  ranges with Ctrl+ or Alt+click (fix #1157)
* Added more test units for DocumentRange operations (mainly for
  non-adjacent ranges).
2016-08-25 12:31:00 -03:00
David Capello 5f90ef7c9b Add properties in App to access directly to timeline/contextBar/workspace 2016-04-22 13:19:06 -03:00
David Capello bb41bd32b4 Don't change cel user data when cel opacity is the only modified field 2016-02-01 18:09:02 -03:00
David Capello be57d0332f Fix setting opacity or user data of linked cels when the first cel isn't included in the active range 2016-02-01 18:05:40 -03:00
David Capello 2f791b5ad1 Fix several problems with timeline and cel opacity slider
* Enable cel opacity slider when any transparent cel is selected
  (it doesn't matter if there are cels from a background layer selected
   too, the slider must be enabled for the transparent ones)
* Enable editing user data when we have a range of cels selected
  (it doesn't matter if the active cel is nullptr, we've to enable
   editing user data if there is any selected cel in the timeline range)
2016-02-01 10:52:05 -03:00
David Capello db13644e0a Fix problem setting cel color in all cels when a range is selected in Timeline 2015-12-23 14:19:09 -03:00
David Capello 4c58441823 Redraw Timeline when layer/cel user color is changed 2015-12-22 13:18:08 -03:00
David Capello f27836744f Show correct user data after undo/redo and commit change immediately 2015-12-11 13:58:32 -03:00
David Capello 08bef859e3 Add user data field on layers and cels 2015-12-10 18:34:25 -03:00