Compare commits

...

86 Commits

Author SHA1 Message Date
David Capello 1e29f1d606
Merge b1da5f814a into ed3c8c510b 2025-09-01 21:37:16 +00:00
David Capello b1da5f814a Add support to use mouse buttons as shortcuts (fix #598) 2025-09-01 18:36:58 -03:00
David Capello ed3c8c510b Merge branch 'main' into beta 2025-08-13 09:27:20 -03:00
David Capello f23e3255bb Fix compilation w/ENABLE_DEVMODE 2025-08-12 16:12:35 -03:00
David Capello 90282dbc40 Fix cast error in HarfBuzz library between function types
This includes the following patch:
60c6b7786d
2025-08-11 15:29:58 -03:00
Martín Capello 1227f9c49c Refactor getLayerIndexFromSprite into LayerGroup 2025-08-11 14:47:56 -03:00
Martín Capello d61ae919ad Fix crash dropping file on timeline (fix #5289) 2025-08-11 14:47:56 -03:00
David Capello 58a5a64cd2 Simplify some code introduced in #5222 to draw different MaskBoundaries
* Added a new Editor::drawMaskBoundaries() and
  Editor::m_selectionToolMaskBoundaries to store the generated
  boundaries for the active SelectionToolLoopImpl.
* Removed app::Doc::setMaskBoundaries() used to restore the active
  mask boundaries.
* Removed Editor::MaskIndex
2025-08-08 18:15:08 -03:00
David Capello b2b2583176 [lua] Update scripting API version to 35 2025-08-07 20:18:10 -03:00
David Capello b535212642 Update laf module 2025-08-07 20:14:43 -03:00
Liebranca 2dbfaf746b Remove m_expandCelCanvas from SelectionToolLoopImpl 2025-08-07 19:54:33 -03:00
Liebranca 23d4543272 Implement tool loop for selection tools 2025-08-07 19:54:33 -03:00
Christian Kaiser 229a3cdf65 [lua] Add onchecked parameter to Commands 2025-08-07 18:57:28 -03:00
Christian Kaiser b3814ec912 Unify ContextBar updates when moving pixels, tooltips (fix #5329) 2025-08-06 20:20:42 -03:00
David Capello e88f3bb413 Show error if curl/unzip tools aren't available (fix #5309) 2025-08-06 14:44:21 -03:00
Christian Kaiser 366751d1f2 Command refresh and refactor, ui availability consistency (fix #3025) 2025-08-05 19:03:21 -03:00
David Capello 7434db6882 Merge branch 'dock' into beta (#518, #3485) 2025-08-05 16:23:53 -03:00
David Capello 5e12a5d3d8 Restore the "Position" section in Timeline configuration
We're going to keep this section for a couple of versions as old users
get used to the new Workspace Layout customization.

The "Position" section will contain the layout icon so we can switch
the Workspace Layout combobox from there too,
2025-08-04 19:41:59 -03:00
David Capello 60112cd929 Close layout combobox after clicking the reset/delete layout button
Without this, the combobox is still visible and clicking the button
again will crash the program.
2025-08-04 19:41:59 -03:00
David Capello a1fb751323 Remove base field from "New Layout" dialog 2025-08-04 19:41:59 -03:00
David Capello 24046600ec Fix loading modified default layouts at the very beginning 2025-08-04 19:41:59 -03:00
David Capello 34aae80eab Fix some strings
From https://github.com/aseprite/aseprite/pull/3485#pullrequestreview-2824195211
2025-08-04 19:41:59 -03:00
David Capello c8ae1017b3 Fix crashes resetting the default layout + remove some hacks
With this patch we've also simplified some hacks handling the
populateComboBox() call, deferring the deletion of widgets/items when
we are inside an event generated by those items.
2025-08-04 19:41:59 -03:00
David Capello 9c5d1feaf5 Fix several layout saving/loading issues
* Better support to load legacy timeline information: we have to
  estimate workspace bounds)
* Auto-save layouts after resizing a splitter/dock
* Fix resetting expansive widgets inside docks after switching tabs
* Load mirrored layout correctly if it was the last selected layout
2025-08-04 19:41:59 -03:00
David Capello aa66d260ad Fix switch/break style 2025-08-04 19:41:59 -03:00
David Capello 86c7fae42c Move LayoutSelector::setActiveLayoutId() impl to .cpp file 2025-08-04 19:41:59 -03:00
David Capello 778e62a411 Minor changes (format, remove unused/unnecessary vars/keywords) 2025-08-04 19:41:59 -03:00
David Capello b08662eeca Change notification flag location inside the layout selector widget
This improves the look of the flag as another icon above the tabs
bottom and at the right of the layout selector icon.
2025-08-04 19:41:59 -03:00
David Capello d6c5ac6786 [theme] New layout selector icon + bg color fixes 2025-08-04 19:41:59 -03:00
David Capello e0226d95d9 Improve layout selector widget location when menu bar is visible/hidden 2025-08-04 19:41:59 -03:00
David Capello 7eb2df6965 Remove unused member variable from ui::Dock 2025-08-04 19:41:59 -03:00
Christian Kaiser c445075a79 Polish layout handling
@dacap's notes: A description of the included changes:

* Improve UX auto-saving layouts when docks are modified, and new 'X'
  icon to delete layouts (or reset the 'Default' layout).
* Remove old timeline position controls (Left/Right/Bottom buttons)
  from the Timeline configuration and from the layout selector
* Add support to drag and drop docks to other sides with real-time
  feedback using a semi-transparent UILayer
* Add a context menu w/right-click to dock the widget at the supported
  sides without drag-and-drop

Some review comments in https://github.com/dacap/aseprite/pull/2
2025-08-04 19:41:59 -03:00
David Capello f556052fc6 Show handles in dockable areas to drag-and-drop them 2025-08-04 19:41:58 -03:00
David Capello c8e9b33ad3 Fix bug where the ToolBar popup wasn't being opened
This was a new issue with combination of
9b90159d1b, probably we should close the
popup when the window is resized (instead of onSizeHint()).
2025-08-04 19:41:58 -03:00
David Capello 37d2be7668 Update saving/loading dock layouts w/tinyxml2 library 2025-08-04 19:41:58 -03:00
David Capello 43140e71ec Save layout changes immediately when docks are resized
This patch includes:

* The layout is updated immediately when docks are resized (before
  this the layout was like a snapshot of the configuration when the
  layout was created or overwritten with the "New Layout" option)
* Saving the active layout used in
  preferences.general.workspace_layout so we can restore it after
  restarting Aseprite
* Change "UI Layout" to "Workspace Layout"
* Some strings moved to en.ini file for i18n
* Fixed a crash on MainWindow::onActiveViewChange() when the
  application was being closed
2025-08-04 19:41:58 -03:00
David Capello eecc14153d Improve borders of context & color bars for both sides (left/right) 2025-08-04 19:41:58 -03:00
David Capello 131aa8b3df Add View > Workspace Layout option to switch the layout w/keys 2025-08-04 19:41:58 -03:00
David Capello ab69421096 Add possibility to overwrite existent layouts 2025-08-04 19:41:58 -03:00
David Capello 0e4e776bc0 Include StatusBar in the set of customizable widgets in the layout 2025-08-04 19:41:58 -03:00
David Capello 78b9f340f7 Save/Load user defined layouts in new user.aseprite-layouts file
And now we store the TiXmlElement for each Layout, instead of
converting from/to text back and forth.
2025-08-04 19:41:58 -03:00
David Capello 92a039a619 Add option to save/restore user-defined layouts on memory
This happens only in memory at the moment (layouts are not saved in
disk yet), and the customization is quite simple (only size of
splitters, timeline position). But in the future we should be able to
dock elements in any place.
2025-08-04 19:41:58 -03:00
David Capello dc040e81e7 Set the initial timeline position in the LayoutSelector correctly 2025-08-04 19:41:58 -03:00
David Capello 465574e2db Show the timeline when we set its position from the LayoutSelector 2025-08-04 19:41:58 -03:00
David Capello 544f711adc Improve the layout selector UI
Changes:
* Now we use the "user data" icon as the button to expand the layouts
  combobox
* Added a tooltip to this icon
* Added buttons to configure the Timeline position in the same
  combobox
* Fixed some bugs in Dock using space for hidden widgets
2025-08-04 19:41:58 -03:00
David Capello ec95323856 Save/restore color bar splitter position correctly 2025-08-04 19:41:58 -03:00
David Capello 9b56d5ba3d Save/restore timeline splitter position correctly 2025-08-04 19:41:58 -03:00
David Capello 2c0920f514 Fix popups & tooltips direction when ToolBar is docked at the left side 2025-08-04 19:41:58 -03:00
David Capello ba39b56096 Fix std::clamp() max bound in TipWindow::pointAt() 2025-08-04 19:41:58 -03:00
David Capello ad4d00ced2 Use std::unique_ptr in ToolBar members 2025-08-04 19:41:58 -03:00
David Capello 6df6037fdc Fix memory leaks in MainWindow
Temporary/created subdocks must be deleted automatically, and children
that are not part of the window hierarchy must be deleted explicitly
now (using some std::unique_ptrs).
2025-08-04 19:41:58 -03:00
David Capello bb65296a1a Add Dock widget, initial & basic version of dockable elements (#518)
Some missing features so far:

1) Restore old layout configuration (color bar split pos, timeline
   pos, etc.) and migrate to new Dock layout
2) Load/saving Dock layout
3) Create & customize current layoout (drag-and-drop widgets, etc.)
2025-08-04 19:41:58 -03:00
Christian Kaiser eaa2bdf0af [lua] Process mnemonics consistently for plugins (fix #5250) 2025-08-04 15:58:29 -03:00
Christian Kaiser 57309e5aa5 Allow gif encoding to be stopped (fix #2619) 2025-08-01 20:46:32 -03:00
Christian Kaiser 4bb9239f50 [lua] Add `resizeable` property to Dialog constructor (fix #5177)
build / build (Debug, macos-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, macos-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, noscripts, cli) (push) Has been cancelled Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Has been cancelled Details
2025-08-01 18:57:50 -03:00
David Capello cef92c1a38 Add .plist files for macOS
build-auto / build-auto (Debug, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, windows-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, windows-latest) (push) Has been cancelled Details
build / build (Debug, macos-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, macos-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, noscripts, cli) (push) Has been cancelled Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Has been cancelled Details
We don't have an Aseprite.app target in cmake files yet, but we might
add it in a near future.
2025-07-28 16:18:19 -03:00
Christian Kaiser 22e72ab5cb [win] Fix includeDesktopDir returning the default path
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run Details
Uses SHGFP_TYPE_CURRENT which returns the Desktop that the user has configured instead of the default, fixes Windows 11's OneDrive Desktop folder.
2025-07-28 10:47:53 -03:00
Christian Kaiser 80fa065bd5 [lua] Add sprite.undoHistory
build / build (Debug, macos-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, macos-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, noscripts, cli) (push) Has been cancelled Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Has been cancelled Details
2025-07-25 13:58:52 -03:00
David Capello de1ccb24dd [win] Don't drop text when IME dialog composition is accepted w/Enter
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run Details
build-auto / build-auto (Debug, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, windows-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, windows-latest) (push) Has been cancelled Details
With #5230, now that we can show the IME dialog on Windows, when we
are selecting a specific word/composition in the IME dialog, if we
press Enter we'll receive that Enter onKeyUp(). It's better if we
process the Enter key onKeyDown() (as the IME enter key is not
received in that case).
2025-07-25 09:19:50 -03:00
David Capello 7d91c4b9d9 [win] Fix dead keys on Windows 2025-07-24 17:45:46 -03:00
Cerallin 6d89a6bc15 fix entry
build-auto / build-auto (Debug, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, windows-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, windows-latest) (push) Has been cancelled Details
build / build (Debug, macos-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, macos-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, noscripts, cli) (push) Has been cancelled Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Has been cancelled Details
2025-07-24 12:50:32 -03:00
Cerallin d4e97b5a96 Add const method Entry::caretPosOnScreen()
This method is for Entry::setTextInput() and IME positioning.
2025-07-24 12:50:32 -03:00
Cerallin 205b18dc0f Make Entry::getCharBoxBounds() a const method 2025-07-24 12:50:32 -03:00
David Capello 2ba051b59b Fix crash deselecting moved pixels when using certain extensions (fix #5280)
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run Details
Although the issue refers to deselecting MovingPixelsState, the same
crash could happen when canceling/finishing WritingTextState or
MovingSelectionState. This fixes the crash for all these states.
2025-07-23 19:01:37 -03:00
Christian Kaiser 3fcb000eb1 Fix slice transformations not updating editors
build / build (Debug, macos-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, macos-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, noscripts, cli) (push) Has been cancelled Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Has been cancelled Details
2025-07-22 02:11:07 -03:00
David Capello af9dc3c817 Fix brush boundaries accumulation switching brush type only (fix #5281)
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run Details
2025-07-21 17:28:11 -03:00
David Capello 250dfdc86a Convert the brush generation counter into an atomic var 2025-07-21 17:27:23 -03:00
David Capello c904c41b39 Don't show stroke/fill option for theme fonts
build / build (Debug, macos-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, macos-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, noscripts, cli) (push) Has been cancelled Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Has been cancelled Details
2025-07-18 18:48:35 -03:00
David Capello 9e941e9a8b [win32] Fix listing hidden files on Windows (related to #5269 / #3079) 2025-07-18 18:37:44 -03:00
Liebranca bbab4d5875 Add 'Show hidden' check to file selector 2025-07-18 18:26:35 -03:00
David Capello 5c4daff128 Add options to stroke/fill text (fix #5271)
build-auto / build-auto (Debug, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, windows-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, windows-latest) (push) Has been cancelled Details
build / build (Debug, macos-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, macos-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, noscripts, cli) (push) Has been cancelled Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Has been cancelled Details
2025-07-14 23:17:25 -03:00
David Capello 11a7b061ff Remove unused var 2025-07-14 20:24:32 -03:00
David Capello 283bedf77e Add pinned/recent folders to export file popup menus
build / build (Debug, macos-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, macos-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, noscripts, cli) (push) Has been cancelled Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Has been cancelled Details
Related to https://community.aseprite.org/t/25920
2025-07-10 18:55:28 -03:00
David Capello 2eeb6f04a7 Fix "buttononly" bool attribute for <filename> widget 2025-07-10 18:13:10 -03:00
David Capello 706d0b8a7a Add possibility to select export file names w/"one click"
It's not with one click, it requires dragging the mouse but it's
better than two clicks.

Related to https://community.aseprite.org/t/25920
2025-07-10 18:12:38 -03:00
David Capello 2f3a7f5dec Update to new laf API: setTranslateDeadKeys -> setTextInput
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run Details
2025-07-10 16:06:03 -03:00
David Capello d5de74b715 Update laf module
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run Details
build-auto / build-auto (Debug, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, windows-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, windows-latest) (push) Has been cancelled Details
2025-07-10 08:52:01 -03:00
David Capello 2d87a7b184 [ui] Fix drawing cursor at the end of the Entry/Combobox field
build / build (Debug, macos-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, macos-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, noscripts, cli) (push) Has been cancelled Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Has been cancelled Details
Regression introduced in 1a6a39700e
2025-07-07 22:21:58 -03:00
Gaspar Capello 2f22804fe8 Fix GIF animations with semi-transparent colors (fix #5226)
Prior to this fix, animations were incorrectly converted to GIF when
the animation contained semi-transparent colors or backgrounds
(specifically, colors with alpha <= 128). Essentially, semi-transparent
pixels didn't repaint the pixel of the processed frame, meaning they
retained the color from the previous frame.
2025-07-07 17:43:19 -03:00
Gaspar Capello bf1b4c6f50 Fix session 'isRunning' detection (fix #5252)
Before this fix, sometimes files available for recovery aren't
displayed due to the coincidence of the pid number of a crashed
session with the current pid number of the current session. This
coincidence caused Aseprite to falsely detect that it was
the current session.
2025-07-07 17:15:36 -03:00
David Capello 250244c777 [ui] Fix possible crash when there is no TextBlob to paint (fix #5255)
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run Details
2025-07-07 12:39:12 -03:00
David Capello b4555fc098 Add "Initial State" string for "Undo History" window to en.ini
build / build (Debug, macos-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, macos-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, noscripts, cli) (push) Has been cancelled Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Has been cancelled Details
2025-07-03 11:18:21 -03:00
Gaspar Capello 8783135bf7 Fix convert_image_to_surface function (fix #5257)
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run Details
Before this fix, 'convert_image_to_surface' would generate saturated
colors when converting semi-transparent colors. This happened because
 Skia Surfaces assumed colors with pre-multiplied alpha.
2025-07-02 20:44:33 -03:00
David Capello 1a6a39700e Fix suffix separation in Entry fields w/TTF fonts (fix #5261) 2025-07-02 20:43:17 -03:00
David Capello ce742bcbc1 Fix typo in GitHub profile URL
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run Details
2025-07-01 21:44:51 -03:00
David Capello 3c350c3e67 Update laf module
build-auto / build-auto (Debug, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, windows-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, windows-latest) (push) Has been cancelled Details
build / build (Debug, macos-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, macos-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, noscripts, cli) (push) Has been cancelled Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Has been cancelled Details
2025-06-25 08:20:50 -03:00
265 changed files with 4691 additions and 1226 deletions

View File

@ -4,7 +4,7 @@ Aseprite is being developed and maintained currently by [Igara Studio](https://i
The active team of developers is: The active team of developers is:
* [David Capello](https://github.com/dacap) * [David Capello](https://github.com/dacap)
* [Gaspar Capello](https://github.com/Gsparoken) * [Gaspar Capello](https://github.com/Gasparoken)
* [Martín Capello](https://github.com/martincapello) * [Martín Capello](https://github.com/martincapello)
* [Christian Kaiser](https://github.com/ckaiser) * [Christian Kaiser](https://github.com/ckaiser)
* [Dante Paola](https://github.com/Liebranca) * [Dante Paola](https://github.com/Liebranca)

View File

@ -428,9 +428,17 @@ if [ ! -d "$skia_library_dir" ] ; then
skia_url=$(bash laf/misc/skia-url.sh $skia_build) skia_url=$(bash laf/misc/skia-url.sh $skia_build)
skia_file=$(basename $skia_url) skia_file=$(basename $skia_url)
if [ ! -f "$skia_dir/$skia_file" ] ; then if [ ! -f "$skia_dir/$skia_file" ] ; then
if ! command -v curl >/dev/null 2>&1 ; then
echo "Error: 'curl' command line tool is not available in PATH"
exit 1
fi
curl --ssl-revoke-best-effort -L -o "$skia_dir/$skia_file" "$skia_url" curl --ssl-revoke-best-effort -L -o "$skia_dir/$skia_file" "$skia_url"
fi fi
if [ ! -d "$skia_library_dir" ] ; then if [ ! -d "$skia_library_dir" ] ; then
if ! command -v unzip >/dev/null 2>&1 ; then
echo "Error: 'unzip' command line tool is not available in PATH"
exit 1
fi
unzip -n -d "$skia_dir" "$skia_dir/$skia_file" unzip -n -d "$skia_dir" "$skia_dir/$skia_file"
fi fi
else else

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -216,7 +216,7 @@
<part id="tab_normal" x="2" y="112" w1="4" w2="5" w3="5" h1="4" h2="6" h3="2" /> <part id="tab_normal" x="2" y="112" w1="4" w2="5" w3="5" h1="4" h2="6" h3="2" />
<part id="tab_active" x="16" y="112" w1="4" w2="7" w3="5" h1="4" h2="6" h3="2" /> <part id="tab_active" x="16" y="112" w1="4" w2="7" w3="5" h1="4" h2="6" h3="2" />
<part id="tab_bottom_active" x="16" y="124" w1="4" w2="7" w3="5" h1="2" h2="1" h3="2" /> <part id="tab_bottom_active" x="16" y="124" w1="4" w2="7" w3="5" h1="2" h2="1" h3="2" />
<part id="tab_bottom_normal" x="2" y="124" w="12" h="5" /> <part id="tab_bottom_normal" x="2" y="124" w1="4" w2="5" w3="3" h1="2" h2="1" h3="2" />
<part id="tab_filler" x="0" y="112" w="2" h="12" /> <part id="tab_filler" x="0" y="112" w="2" h="12" />
<part id="tab_modified_icon_normal" x="32" y="112" w="5" h="5" /> <part id="tab_modified_icon_normal" x="32" y="112" w="5" h="5" />
<part id="tab_modified_icon_active" x="32" y="117" w="5" h="5" /> <part id="tab_modified_icon_active" x="32" y="117" w="5" h="5" />
@ -374,6 +374,7 @@
<part id="icon_close" x="152" y="256" w="7" h="7" /> <part id="icon_close" x="152" y="256" w="7" h="7" />
<part id="icon_search" x="160" y="256" w="8" h="8" /> <part id="icon_search" x="160" y="256" w="8" h="8" />
<part id="icon_user_data" x="168" y="256" w="8" h="8" /> <part id="icon_user_data" x="168" y="256" w="8" h="8" />
<part id="icon_layout" x="176" y="256" w="5" h="6" />
<part id="icon_pos" x="144" y="264" w="8" h="8" /> <part id="icon_pos" x="144" y="264" w="8" h="8" />
<part id="icon_size" x="152" y="264" w="8" h="8" /> <part id="icon_size" x="152" y="264" w="8" h="8" />
<part id="icon_selsize" x="160" y="264" w="8" h="8" /> <part id="icon_selsize" x="160" y="264" w="8" h="8" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -212,7 +212,7 @@
<part id="tab_normal" x="2" y="112" w1="4" w2="5" w3="5" h1="4" h2="6" h3="2" /> <part id="tab_normal" x="2" y="112" w1="4" w2="5" w3="5" h1="4" h2="6" h3="2" />
<part id="tab_active" x="16" y="112" w1="4" w2="7" w3="5" h1="4" h2="6" h3="2" /> <part id="tab_active" x="16" y="112" w1="4" w2="7" w3="5" h1="4" h2="6" h3="2" />
<part id="tab_bottom_active" x="16" y="124" w1="4" w2="7" w3="5" h1="2" h2="1" h3="2" /> <part id="tab_bottom_active" x="16" y="124" w1="4" w2="7" w3="5" h1="2" h2="1" h3="2" />
<part id="tab_bottom_normal" x="2" y="124" w="12" h="5" /> <part id="tab_bottom_normal" x="2" y="124" w1="4" w2="5" w3="3" h1="2" h2="1" h3="2" />
<part id="tab_filler" x="0" y="112" w="2" h="12" /> <part id="tab_filler" x="0" y="112" w="2" h="12" />
<part id="tab_modified_icon_normal" x="32" y="112" w="5" h="5" /> <part id="tab_modified_icon_normal" x="32" y="112" w="5" h="5" />
<part id="tab_modified_icon_active" x="32" y="117" w="5" h="5" /> <part id="tab_modified_icon_active" x="32" y="117" w="5" h="5" />
@ -370,6 +370,7 @@
<part id="icon_close" x="152" y="256" w="7" h="7" /> <part id="icon_close" x="152" y="256" w="7" h="7" />
<part id="icon_search" x="160" y="256" w="8" h="8" /> <part id="icon_search" x="160" y="256" w="8" h="8" />
<part id="icon_user_data" x="168" y="256" w="8" h="8" /> <part id="icon_user_data" x="168" y="256" w="8" h="8" />
<part id="icon_layout" x="176" y="256" w="5" h="6" />
<part id="icon_pos" x="144" y="264" w="8" h="8" /> <part id="icon_pos" x="144" y="264" w="8" h="8" />
<part id="icon_size" x="152" y="264" w="8" h="8" /> <part id="icon_size" x="152" y="264" w="8" h="8" />
<part id="icon_selsize" x="160" y="264" w="8" h="8" /> <part id="icon_selsize" x="160" y="264" w="8" h="8" />

View File

@ -175,6 +175,7 @@
<param name="popup" value="background" /> <param name="popup" value="background" />
</key> </key>
<key command="ShowExtras" shortcut="Ctrl+H" /> <key command="ShowExtras" shortcut="Ctrl+H" />
<key command="ToggleWorkspaceLayout" shortcut="Shift+W" />
<!-- Tabs --> <!-- Tabs -->
<key command="GotoNextTab" shortcut="Ctrl+Tab" /> <key command="GotoNextTab" shortcut="Ctrl+Tab" />
<key command="GotoPreviousTab" shortcut="Ctrl+Shift+Tab" /> <key command="GotoPreviousTab" shortcut="Ctrl+Shift+Tab" />
@ -1002,6 +1003,7 @@
</menu> </menu>
<menu text="@.view" id="view_menu"> <menu text="@.view" id="view_menu">
<item command="DuplicateView" text="@.view_duplicate_view" group="view_new" /> <item command="DuplicateView" text="@.view_duplicate_view" group="view_new" />
<item command="ToggleWorkspaceLayout" text="@.view_workspace_layout" />
<separator /> <separator />
<item command="ShowExtras" text="@.view_show_extras" /> <item command="ShowExtras" text="@.view_show_extras" />
<menu text="@.view_show" group="view_extras"> <menu text="@.view_show" group="view_extras">

View File

@ -167,6 +167,7 @@
<option id="keep_closed_sprite_on_memory_for" type="double" default="15.0" /> <option id="keep_closed_sprite_on_memory_for" type="double" default="15.0" />
<option id="show_full_path" type="bool" default="true" /> <option id="show_full_path" type="bool" default="true" />
<option id="edit_full_path" type="bool" default="false" /> <option id="edit_full_path" type="bool" default="false" />
<option id="workspace_layout" type="std::string" />
<option id="timeline_position" type="TimelinePosition" default="TimelinePosition::BOTTOM" /> <option id="timeline_position" type="TimelinePosition" default="TimelinePosition::BOTTOM" />
<option id="timeline_layer_panel_width" type="int" default="100" /> <option id="timeline_layer_panel_width" type="int" default="100" />
<option id="show_menu_bar" type="bool" default="true" /> <option id="show_menu_bar" type="bool" default="true" />
@ -255,6 +256,7 @@
<option id="one_finger_as_mouse_movement" type="bool" default="true" /> <option id="one_finger_as_mouse_movement" type="bool" default="true" />
<option id="load_wintab_driver" type="bool" default="false" /> <option id="load_wintab_driver" type="bool" default="false" />
<option id="flash_layer" type="bool" default="false" /> <option id="flash_layer" type="bool" default="false" />
<option id="use_selection_tool_loop" type="bool" default="false" />
<option id="nonactive_layers_opacity" type="int" default="255" /> <option id="nonactive_layers_opacity" type="int" default="255" />
<option id="nonactive_layers_opacity_preview" type="int" default="255" /> <option id="nonactive_layers_opacity_preview" type="int" default="255" />
</section> </section>
@ -356,6 +358,7 @@
<section id="file_selector"> <section id="file_selector">
<option id="current_folder" type="std::string" default="&quot;&lt;empty&gt;&quot;" /> <option id="current_folder" type="std::string" default="&quot;&lt;empty&gt;&quot;" />
<option id="zoom" type="double" default="1.0" /> <option id="zoom" type="double" default="1.0" />
<option id="show_hidden" type="bool" default="false" />
</section> </section>
<section id="text_tool"> <section id="text_tool">
<option id="font_face" type="std::string" /> <option id="font_face" type="std::string" />

View File

@ -488,6 +488,7 @@ TilesetDuplicate = Duplicate Tileset
Undo = Undo Undo = Undo
UndoHistory = Undo History UndoHistory = Undo History
UnlinkCel = Unlink Cel UnlinkCel = Unlink Cel
ToggleWorkspaceLayout = Toggle Workspace Layout
Zoom = Zoom Zoom = Zoom
Zoom_In = Zoom In Zoom_In = Zoom In
Zoom_Out = Zoom Out Zoom_Out = Zoom Out
@ -621,6 +622,14 @@ current_layer = Current Layer
first_ref_layer = First Reference Layer first_ref_layer = First Reference Layer
pick = Pick: pick = Pick:
sample = Sample: sample = Sample:
position_label = P:
rotation_label = R:
position_x = X Position
position_y = Y Position
size_width = Width
size_height = Height
rotation_angle = Angle
rotation_skew = Skew
[convolution_matrix] [convolution_matrix]
reload_stock = &Reload Stock reload_stock = &Reload Stock
@ -765,6 +774,7 @@ pinned_folders = Pinned Folders
recent_folders = Recent Folders recent_folders = Recent Folders
all_formats = All formats all_formats = All formats
all_files = All files all_files = All files
show_hidden = Show hidden
[filters] [filters]
selected_cels = Selected selected_cels = Selected
@ -1163,6 +1173,7 @@ select_load_from_file = &Load from MSK file
select_save_to_file = &Save to MSK file select_save_to_file = &Save to MSK file
view = &View view = &View
view_duplicate_view = Duplicate &View view_duplicate_view = Duplicate &View
view_workspace_layout = Workspace &Layout
view_show_extras = &Extras view_show_extras = &Extras
view_show = &Show view_show = &Show
view_show_layer_edges = &Layer Edges view_show_layer_edges = &Layer Edges
@ -1204,6 +1215,14 @@ help_twitter = Twitter
help_enter_license = Enter &License help_enter_license = Enter &License
help_about = &About help_about = &About
[main_window]
layout = Workspace Layout
default_layout = Default
mirrored_default_layout = Mirrored Default
timeline = Timeline
user_layouts = User Layouts
new_layout = New Layout...
[mask_by_color] [mask_by_color]
title = Select Color title = Select Color
label_color = Color: label_color = Color:
@ -1232,6 +1251,20 @@ name = Name:
tileset = Tileset: tileset = Tileset:
default_new_layer_name = New Layer default_new_layer_name = New Layer
[new_layout]
title = New Workspace Layout
name = Name:
deleting_layout = Deleting Layout
deleting_layout_confirmation = Are you sure you want to delete the '{}' layout?
restoring_layout = Restoring Layout
restoring_layout_confirmation = Are you sure you want to restore the '{}' layout?
[dock]
left = Dock Left
right = Dock Right
top = Dock Top
bottom = Dock Bottom
[news_listbox] [news_listbox]
more = More... more = More...
problem_loading = Problems loading news. Please retry. problem_loading = Problems loading news. Please retry.
@ -1561,6 +1594,7 @@ set_cursor_fix = Set cursor position from stylus location
set_cursor_fix_tooltip = Sets the mouse position to the pen location when\nyou have two pointers available (e.g. mouse and pen)\n\nUseful to zoom in/out from the pen position and to get the\ncorrect cursor location when screencasting/live streaming. set_cursor_fix_tooltip = Sets the mouse position to the pen location when\nyou have two pointers available (e.g. mouse and pen)\n\nUseful to zoom in/out from the pen position and to get the\ncorrect cursor location when screencasting/live streaming.
wintab_more_info = (More Information) wintab_more_info = (More Information)
flash_selected_layer = Flash layer when it is selected flash_selected_layer = Flash layer when it is selected
use_selection_tool_loop = New selection tools implementation
non_active_layer_opacity = Opacity for non-active layers: non_active_layer_opacity = Opacity for non-active layers:
cel_content_format = Cel content format: cel_content_format = Cel content format:
cel_format_compressed = Compressed cel_format_compressed = Compressed
@ -1834,11 +1868,20 @@ pixel_scale = Pixel Scale
with_vars = Use CSS3 Variables with_vars = Use CSS3 Variables
generate_html = Generate Sample HTML File generate_html = Generate Sample HTML File
[shape]
fill = Fill
stroke = Stroke
stroke_width = Stroke Width
[text_tool]
font_family = Font Family
font_size = Font Size
bold = Bold
italic = Italic
more_options = More Options
[timeline_conf] [timeline_conf]
position = Position: position = Position:
left = &Left
right = &Right
bottom = &Bottom
frame_header = Frame Header: frame_header = Frame Header:
first_frame = First Frame: first_frame = First Frame:
thumbnails = Thumbnails thumbnails = Thumbnails
@ -1896,6 +1939,7 @@ timeline_show = Show Timeline
[undo_history] [undo_history]
title = Undo History title = Undo History
initial_state = Initial State
[user_data] [user_data]
user_data = User Data: user_data = User Data:

View File

@ -23,6 +23,7 @@
<combobox id="location" expansive="true" /> <combobox id="location" expansive="true" />
<button text="" id="refresh_button" style="refresh_button" <button text="" id="refresh_button" style="refresh_button"
tooltip="@.refresh_button_tooltip" tooltip_dir="bottom" /> tooltip="@.refresh_button_tooltip" tooltip_dir="bottom" />
<check id="show_hidden_check" text="@.show_hidden" />
</box> </box>
<vbox id="file_view_placeholder" expansive="true" /> <vbox id="file_view_placeholder" expansive="true" />
<grid columns="2"> <grid columns="2">

View File

@ -1,30 +0,0 @@
<!-- Aseprite -->
<!-- Copyright (C) 2001-2017 by David Capello -->
<gui>
<window id="main_window" noborders="true" desktop="true">
<vbox noborders="true" expansive="true">
<hbox noborders="true" id="menu_bar_placeholder" />
<hbox noborders="true" id="tabs_placeholder" />
<splitter id="color_bar_splitter"
horizontal="true" expansive="true"
by="pixel"
style="workspace_splitter">
<vbox noborders="true" id="color_bar_placeholder" />
<vbox noborders="true" expansive="true">
<vbox noborders="true" id="context_bar_placeholder" />
<hbox noborders="true" expansive="true">
<splitter id="timeline_splitter"
vertical="true" expansive="true"
by="percetage" position="100"
style="workspace_splitter">
<hbox noborders="true" id="workspace_placeholder" expansive="true" />
<vbox noborders="true" id="timeline_placeholder" expansive="true" />
</splitter>
<vbox noborders="true" id="tool_bar_placeholder" />
</hbox>
</vbox>
</splitter>
<hbox noborders="true" id="status_bar_placeholder" />
</vbox>
</window>
</gui>

View File

@ -0,0 +1,19 @@
<!-- Aseprite -->
<!-- Copyright (C) 2025 by Igara Studio S.A. -->
<gui>
<window id="new_layout" text="@.title">
<vbox>
<hbox>
<label text="@.name" />
<entry maxsize="128" id="name" magnet="true" expansive="true" />
</hbox>
<separator horizontal="true" />
<hbox homogeneous="true" cell_align="right">
<button text="@general.ok" closewindow="true" id="ok" disabled="true" minwidth="60" magnet="true" />
<button text="@general.cancel" closewindow="true" />
</hbox>
</vbox>
</window>
</gui>

View File

@ -624,6 +624,7 @@
text="@.hue_with_sat_value" text="@.hue_with_sat_value"
pref="experimental.hue_with_sat_value_for_color_selector" /> pref="experimental.hue_with_sat_value_for_color_selector" />
<check id="flash_layer" text="@.flash_selected_layer" /> <check id="flash_layer" text="@.flash_selected_layer" />
<check id="use_selection_tool_loop" text="@.use_selection_tool_loop" />
<hbox> <hbox>
<label text="@.non_active_layer_opacity" /> <label text="@.non_active_layer_opacity" />
<slider id="nonactive_layers_opacity" min="0" max="255" width="128" /> <slider id="nonactive_layers_opacity" min="0" max="255" width="128" />

View File

@ -6,13 +6,7 @@
<hbox> <hbox>
<vbox> <vbox>
<separator cell_hspan="2" text="@.position" left="true" horizontal="true" /> <separator cell_hspan="2" text="@.position" left="true" horizontal="true" />
<hbox> <button id="layout" icon="icon_layout" />
<buttonset columns="2" id="position">
<item text="@.left" />
<item text="@.right" />
<item text="@.bottom" hspan="2" />
</buttonset>
</hbox>
</vbox> </vbox>
<vbox> <vbox>
<separator text="@.frame_header" left="true" horizontal="true" /> <separator text="@.frame_header" left="true" horizontal="true" />

2
laf

@ -1 +1 @@
Subproject commit 7873e82be7828d1c22255a4b06d1d3d34586f12f Subproject commit 01571537bc6002a2e039a66497837365c394d7fa

View File

@ -180,8 +180,8 @@ if(ENABLE_ASEPRITE_EXE)
if(WIN32) if(WIN32)
set(main_resources set(main_resources
main/resources_win32.rc main/win/resources_win32.rc
main/settings.manifest) main/win/settings.manifest)
endif() endif()
add_executable(${main_target} add_executable(${main_target}

View File

@ -520,6 +520,7 @@ target_sources(app-lib PRIVATE
commands/tileset_mode.cpp commands/tileset_mode.cpp
commands/toggle_other_layers_opacity.cpp commands/toggle_other_layers_opacity.cpp
commands/toggle_play_option.cpp commands/toggle_play_option.cpp
commands/toggle_workspace_layout.cpp
console.cpp console.cpp
context.cpp context.cpp
context_flags.cpp context_flags.cpp
@ -609,6 +610,7 @@ target_sources(app-lib PRIVATE
ui/context_bar.cpp ui/context_bar.cpp
ui/dithering_selector.cpp ui/dithering_selector.cpp
ui/doc_view.cpp ui/doc_view.cpp
ui/dock.cpp
ui/drop_down_button.cpp ui/drop_down_button.cpp
ui/dynamics_popup.cpp ui/dynamics_popup.cpp
ui/editor/brush_preview.cpp ui/editor/brush_preview.cpp
@ -653,6 +655,9 @@ target_sources(app-lib PRIVATE
ui/input_chain.cpp ui/input_chain.cpp
ui/keyboard_shortcuts.cpp ui/keyboard_shortcuts.cpp
ui/layer_frame_comboboxes.cpp ui/layer_frame_comboboxes.cpp
ui/layout.cpp
ui/layouts.cpp
ui/layout_selector.cpp
ui/main_menu_bar.cpp ui/main_menu_bar.cpp
ui/main_window.cpp ui/main_window.cpp
ui/mini_help_button.cpp ui/mini_help_button.cpp

View File

@ -11,12 +11,12 @@
#include "app/app.h" #include "app/app.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/modules/gui.h"
#include "app/ui/main_window.h" #include "app/ui/main_window.h"
#include "fmt/format.h" #include "fmt/format.h"
#include "ver/info.h" #include "ver/info.h"
#include "about.xml.h" #include "about.xml.h"
#include "app/context.h"
namespace app { namespace app {
@ -27,13 +27,19 @@ public:
AboutCommand(); AboutCommand();
protected: protected:
bool onEnabled(Context* context) override;
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
AboutCommand::AboutCommand() : Command(CommandId::About(), CmdUIOnlyFlag) AboutCommand::AboutCommand() : Command(CommandId::About())
{ {
} }
bool AboutCommand::onEnabled(Context* context)
{
return context->isUIAvailable();
}
void AboutCommand::onExecute(Context* context) void AboutCommand::onExecute(Context* context)
{ {
gen::About window; gen::About window;

View File

@ -63,8 +63,7 @@ protected:
std::string onGetFriendlyName() const override; std::string onGetFriendlyName() const override;
}; };
AddColorCommand::AddColorCommand() AddColorCommand::AddColorCommand() : CommandWithNewParams<AddColorParams>(CommandId::AddColor())
: CommandWithNewParams<AddColorParams>(CommandId::AddColor(), CmdUIOnlyFlag)
{ {
} }

View File

@ -17,8 +17,7 @@
#include "ui/ui.h" #include "ui/ui.h"
#include "advanced_mode.xml.h" #include "advanced_mode.xml.h"
#include "app/context.h"
#include <cstdio>
namespace app { namespace app {
@ -29,13 +28,19 @@ public:
AdvancedModeCommand(); AdvancedModeCommand();
protected: protected:
bool onEnabled(Context* context) override;
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
AdvancedModeCommand::AdvancedModeCommand() : Command(CommandId::AdvancedMode(), CmdUIOnlyFlag) AdvancedModeCommand::AdvancedModeCommand() : Command(CommandId::AdvancedMode())
{ {
} }
bool AdvancedModeCommand::onEnabled(Context* context)
{
return context->isUIAvailable();
}
void AdvancedModeCommand::onExecute(Context* context) void AdvancedModeCommand::onExecute(Context* context)
{ {
// Switch advanced mode. // Switch advanced mode.

View File

@ -15,7 +15,6 @@
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/tx.h" #include "app/tx.h"
#include "doc/layer.h" #include "doc/layer.h"
#include "doc/sprite.h"
namespace app { namespace app {
@ -28,8 +27,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
BackgroundFromLayerCommand::BackgroundFromLayerCommand() BackgroundFromLayerCommand::BackgroundFromLayerCommand() : Command(CommandId::BackgroundFromLayer())
: Command(CommandId::BackgroundFromLayer(), CmdRecordableFlag)
{ {
} }

View File

@ -37,7 +37,7 @@ private:
Type m_type; Type m_type;
}; };
CancelCommand::CancelCommand() : Command(CommandId::Cancel(), CmdUIOnlyFlag), m_type(NoOp) CancelCommand::CancelCommand() : Command(CommandId::Cancel()), m_type(NoOp)
{ {
} }

View File

@ -22,7 +22,6 @@
#include "app/ui/skin/skin_theme.h" #include "app/ui/skin/skin_theme.h"
#include "app/ui_context.h" #include "app/ui_context.h"
#include "doc/image.h" #include "doc/image.h"
#include "doc/mask.h"
#include "doc/sprite.h" #include "doc/sprite.h"
#include "ui/ui.h" #include "ui/ui.h"
@ -282,8 +281,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
CanvasSizeCommand::CanvasSizeCommand() CanvasSizeCommand::CanvasSizeCommand() : CommandWithNewParams(CommandId::CanvasSize())
: CommandWithNewParams(CommandId::CanvasSize(), CmdRecordableFlag)
{ {
} }

View File

@ -20,8 +20,6 @@
#include "app/tx.h" #include "app/tx.h"
#include "app/ui/timeline/timeline.h" #include "app/ui/timeline/timeline.h"
#include "doc/cel.h" #include "doc/cel.h"
#include "doc/cels_range.h"
#include "doc/sprite.h"
#include <string> #include <string>
@ -42,7 +40,7 @@ private:
int m_opacity; int m_opacity;
}; };
CelOpacityCommand::CelOpacityCommand() : Command(CommandId::CelOpacity(), CmdUIOnlyFlag) CelOpacityCommand::CelOpacityCommand() : Command(CommandId::CelOpacity())
{ {
m_opacity = 255; m_opacity = 255;
} }

View File

@ -23,7 +23,6 @@
#include "app/ui/timeline/timeline.h" #include "app/ui/timeline/timeline.h"
#include "app/ui/user_data_view.h" #include "app/ui/user_data_view.h"
#include "app/ui_context.h" #include "app/ui_context.h"
#include "base/mem_utils.h"
#include "base/scoped_value.h" #include "base/scoped_value.h"
#include "doc/cel.h" #include "doc/cel.h"
#include "doc/cels_range.h" #include "doc/cels_range.h"
@ -385,14 +384,14 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
CelPropertiesCommand::CelPropertiesCommand() : Command(CommandId::CelProperties(), CmdUIOnlyFlag) CelPropertiesCommand::CelPropertiesCommand() : Command(CommandId::CelProperties())
{ {
} }
bool CelPropertiesCommand::onEnabled(Context* context) bool CelPropertiesCommand::onEnabled(Context* context)
{ {
return context->checkFlags(ContextFlags::ActiveDocumentIsWritable | return context->isUIAvailable() && context->checkFlags(ContextFlags::ActiveDocumentIsWritable |
ContextFlags::ActiveLayerIsImage); ContextFlags::ActiveLayerIsImage);
} }
void CelPropertiesCommand::onExecute(Context* context) void CelPropertiesCommand::onExecute(Context* context)

View File

@ -21,7 +21,6 @@
#include "app/tools/tool.h" #include "app/tools/tool.h"
#include "app/ui/context_bar.h" #include "app/ui/context_bar.h"
#include "app/ui/main_window.h" #include "app/ui/main_window.h"
#include "base/convert_to.h"
#include "doc/algorithm/flip_image.h" #include "doc/algorithm/flip_image.h"
#include "doc/brush.h" #include "doc/brush.h"
#include "doc/image_ref.h" #include "doc/image_ref.h"
@ -64,7 +63,7 @@ private:
int m_slot; int m_slot;
}; };
ChangeBrushCommand::ChangeBrushCommand() : Command(CommandId::ChangeBrush(), CmdUIOnlyFlag) ChangeBrushCommand::ChangeBrushCommand() : Command(CommandId::ChangeBrush())
{ {
m_change = None; m_change = None;
m_slot = 0; m_slot = 0;

View File

@ -14,6 +14,7 @@
#include "app/app.h" #include "app/app.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/commands/params.h" #include "app/commands/params.h"
#include "app/context.h"
#include "app/i18n/strings.h" #include "app/i18n/strings.h"
#include "app/modules/palettes.h" #include "app/modules/palettes.h"
#include "app/ui/color_bar.h" #include "app/ui/color_bar.h"
@ -39,18 +40,24 @@ public:
ChangeColorCommand(); ChangeColorCommand();
protected: protected:
bool onEnabled(Context* context) override;
bool onNeedsParams() const override { return true; } bool onNeedsParams() const override { return true; }
void onLoadParams(const Params& params) override; void onLoadParams(const Params& params) override;
void onExecute(Context* context) override; void onExecute(Context* context) override;
std::string onGetFriendlyName() const override; std::string onGetFriendlyName() const override;
}; };
ChangeColorCommand::ChangeColorCommand() : Command(CommandId::ChangeColor(), CmdUIOnlyFlag) ChangeColorCommand::ChangeColorCommand() : Command(CommandId::ChangeColor())
{ {
m_background = false; m_background = false;
m_change = None; m_change = None;
} }
bool ChangeColorCommand::onEnabled(Context* context)
{
return context->isUIAvailable();
}
void ChangeColorCommand::onLoadParams(const Params& params) void ChangeColorCommand::onLoadParams(const Params& params)
{ {
std::string target = params.get("target"); std::string target = params.get("target");

View File

@ -21,9 +21,7 @@
#include "app/i18n/strings.h" #include "app/i18n/strings.h"
#include "app/load_matrix.h" #include "app/load_matrix.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/modules/palettes.h"
#include "app/sprite_job.h" #include "app/sprite_job.h"
#include "app/transaction.h"
#include "app/ui/best_fit_criteria_selector.h" #include "app/ui/best_fit_criteria_selector.h"
#include "app/ui/dithering_selector.h" #include "app/ui/dithering_selector.h"
#include "app/ui/editor/editor.h" #include "app/ui/editor/editor.h"
@ -37,12 +35,10 @@
#include "fmt/format.h" #include "fmt/format.h"
#include "render/dithering.h" #include "render/dithering.h"
#include "render/dithering_algorithm.h" #include "render/dithering_algorithm.h"
#include "render/ordered_dither.h"
#include "render/quantization.h" #include "render/quantization.h"
#include "render/render.h" #include "render/render.h"
#include "render/task_delegate.h" #include "render/task_delegate.h"
#include "ui/listitem.h" #include "ui/listitem.h"
#include "ui/paint_event.h"
#include "ui/size_hint_event.h" #include "ui/size_hint_event.h"
#include "color_mode.xml.h" #include "color_mode.xml.h"
@ -507,7 +503,7 @@ private:
}; };
ChangePixelFormatCommand::ChangePixelFormatCommand() ChangePixelFormatCommand::ChangePixelFormatCommand()
: CommandWithNewParams(CommandId::ChangePixelFormat(), CmdUIOnlyFlag) : CommandWithNewParams(CommandId::ChangePixelFormat())
{ {
} }

View File

@ -23,7 +23,7 @@ protected:
void onExecute(Context* ctx) override; void onExecute(Context* ctx) override;
}; };
ClearCommand::ClearCommand() : Command(CommandId::Clear(), CmdUIOnlyFlag) ClearCommand::ClearCommand() : Command(CommandId::Clear())
{ {
} }

View File

@ -19,7 +19,6 @@
#include "app/ui/status_bar.h" #include "app/ui/status_bar.h"
#include "doc/cel.h" #include "doc/cel.h"
#include "doc/layer.h" #include "doc/layer.h"
#include "doc/sprite.h"
namespace app { namespace app {
@ -32,7 +31,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
ClearCelCommand::ClearCelCommand() : Command(CommandId::ClearCel(), CmdRecordableFlag) ClearCelCommand::ClearCelCommand() : Command(CommandId::ClearCel())
{ {
} }
@ -76,7 +75,7 @@ void ClearCelCommand::onExecute(Context* context)
tx.commit(); tx.commit();
} }
if (nonEditableLayers) if (context->isUIAvailable() && nonEditableLayers)
StatusBar::instance()->showTip(1000, Strings::statusbar_tips_locked_layers()); StatusBar::instance()->showTip(1000, Strings::statusbar_tips_locked_layers());
update_screen_for_document(document); update_screen_for_document(document);

View File

@ -23,8 +23,7 @@ protected:
void onExecute(Context* ctx) override; void onExecute(Context* ctx) override;
}; };
ClearRecentFilesCommand::ClearRecentFilesCommand() ClearRecentFilesCommand::ClearRecentFilesCommand() : Command(CommandId::ClearRecentFiles())
: Command(CommandId::ClearRecentFiles(), CmdUIOnlyFlag)
{ {
} }

View File

@ -12,15 +12,9 @@
#include "app/app.h" #include "app/app.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/commands/commands.h" #include "app/commands/commands.h"
#include "app/context_access.h"
#include "app/ui/doc_view.h" #include "app/ui/doc_view.h"
#include "app/ui/status_bar.h"
#include "app/ui/workspace.h" #include "app/ui/workspace.h"
#include "app/ui_context.h" #include "app/ui_context.h"
#include "doc/sprite.h"
#include "ui/ui.h"
#include <memory>
namespace app { namespace app {
@ -28,7 +22,7 @@ using namespace ui;
class CloseFileCommand : public Command { class CloseFileCommand : public Command {
public: public:
CloseFileCommand() : Command(CommandId::CloseFile(), CmdUIOnlyFlag) {} CloseFileCommand() : Command(CommandId::CloseFile()) {}
protected: protected:
bool onEnabled(Context* context) override bool onEnabled(Context* context) override
@ -51,12 +45,15 @@ protected:
class CloseAllFilesCommand : public Command { class CloseAllFilesCommand : public Command {
public: public:
CloseAllFilesCommand() : Command(CommandId::CloseAllFiles(), CmdRecordableFlag) CloseAllFilesCommand() : Command(CommandId::CloseAllFiles()) { m_quitting = false; }
{
m_quitting = false;
}
protected: protected:
bool onEnabled(Context* context) override
{
// Null if we are in --batch mode
return App::instance()->workspace() != nullptr;
}
void onLoadParams(const Params& params) override { m_quitting = params.get_as<bool>("quitting"); } void onLoadParams(const Params& params) override { m_quitting = params.get_as<bool>("quitting"); }
void onExecute(Context* context) override void onExecute(Context* context) override

View File

@ -21,7 +21,6 @@
#include "app/transaction.h" #include "app/transaction.h"
#include "app/ui/color_bar.h" #include "app/ui/color_bar.h"
#include "app/ui/rgbmap_algorithm_selector.h" #include "app/ui/rgbmap_algorithm_selector.h"
#include "app/ui_context.h"
#include "doc/palette.h" #include "doc/palette.h"
#include "doc/sprite.h" #include "doc/sprite.h"
#include "render/quantization.h" #include "render/quantization.h"
@ -71,7 +70,7 @@ protected:
}; };
ColorQuantizationCommand::ColorQuantizationCommand() ColorQuantizationCommand::ColorQuantizationCommand()
: CommandWithNewParams<ColorQuantizationParams>(CommandId::ColorQuantization(), CmdRecordableFlag) : CommandWithNewParams<ColorQuantizationParams>(CommandId::ColorQuantization())
{ {
} }

View File

@ -24,7 +24,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
ContiguousFillCommand::ContiguousFillCommand() : Command(CommandId::ContiguousFill(), CmdUIOnlyFlag) ContiguousFillCommand::ContiguousFillCommand() : Command(CommandId::ContiguousFill())
{ {
} }

View File

@ -23,7 +23,7 @@ protected:
void onExecute(Context* ctx) override; void onExecute(Context* ctx) override;
}; };
CopyCommand::CopyCommand() : Command(CommandId::Copy(), CmdUIOnlyFlag) CopyCommand::CopyCommand() : Command(CommandId::Copy())
{ {
} }

View File

@ -10,9 +10,7 @@
#include "app/app.h" #include "app/app.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/context_access.h"
#include "app/ui/timeline/timeline.h" #include "app/ui/timeline/timeline.h"
#include "ui/base.h"
namespace app { namespace app {
@ -25,13 +23,13 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
CopyCelCommand::CopyCelCommand() : Command(CommandId::CopyCel(), CmdUIOnlyFlag) CopyCelCommand::CopyCelCommand() : Command(CommandId::CopyCel())
{ {
} }
bool CopyCelCommand::onEnabled(Context* context) bool CopyCelCommand::onEnabled(Context* context)
{ {
return App::instance()->timeline()->isMovingCel(); return App::instance()->timeline() && App::instance()->timeline()->isMovingCel();
} }
void CopyCelCommand::onExecute(Context* context) void CopyCelCommand::onExecute(Context* context)

View File

@ -24,7 +24,7 @@ protected:
void onExecute(Context* ctx) override; void onExecute(Context* ctx) override;
}; };
CopyMergedCommand::CopyMergedCommand() : Command(CommandId::CopyMerged(), CmdUIOnlyFlag) CopyMergedCommand::CopyMergedCommand() : Command(CommandId::CopyMerged())
{ {
} }

View File

@ -16,11 +16,7 @@
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/tx.h" #include "app/tx.h"
#include "app/ui/color_bar.h" #include "app/ui/color_bar.h"
#include "app/util/autocrop.h"
#include "doc/image.h"
#include "doc/layer.h"
#include "doc/mask.h" #include "doc/mask.h"
#include "doc/sprite.h"
namespace app { namespace app {
@ -37,7 +33,7 @@ private:
gfx::Rect m_bounds; gfx::Rect m_bounds;
}; };
CropSpriteCommand::CropSpriteCommand() : Command(CommandId::CropSprite(), CmdRecordableFlag) CropSpriteCommand::CropSpriteCommand() : Command(CommandId::CropSprite())
{ {
} }
@ -95,8 +91,7 @@ private:
bool m_byGrid = false; bool m_byGrid = false;
}; };
AutocropSpriteCommand::AutocropSpriteCommand() AutocropSpriteCommand::AutocropSpriteCommand() : Command(CommandId::AutocropSprite())
: Command(CommandId::AutocropSprite(), CmdRecordableFlag)
{ {
} }

View File

@ -23,7 +23,7 @@ protected:
void onExecute(Context* ctx) override; void onExecute(Context* ctx) override;
}; };
CutCommand::CutCommand() : Command(CommandId::Cut(), CmdUIOnlyFlag) CutCommand::CutCommand() : Command(CommandId::Cut())
{ {
} }

View File

@ -14,8 +14,6 @@
#include "app/context_access.h" #include "app/context_access.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/tx.h" #include "app/tx.h"
#include "doc/mask.h"
#include "doc/sprite.h"
namespace app { namespace app {
@ -28,7 +26,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
DeselectMaskCommand::DeselectMaskCommand() : Command(CommandId::DeselectMask(), CmdRecordableFlag) DeselectMaskCommand::DeselectMaskCommand() : Command(CommandId::DeselectMask())
{ {
} }

View File

@ -29,8 +29,7 @@ protected:
void onExecute(Context* context); void onExecute(Context* context);
}; };
DeveloperConsoleCommand::DeveloperConsoleCommand() DeveloperConsoleCommand::DeveloperConsoleCommand() : Command(CommandId::DeveloperConsole())
: Command(CommandId::DeveloperConsole(), CmdUIOnlyFlag)
{ {
} }

View File

@ -12,8 +12,6 @@
#include "app/app.h" #include "app/app.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/commands/commands.h" #include "app/commands/commands.h"
#include "app/context_access.h"
#include "app/tools/tool_box.h"
#include "app/ui/context_bar.h" #include "app/ui/context_bar.h"
#include "app/ui_context.h" #include "app/ui_context.h"
@ -28,12 +26,15 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
DiscardBrushCommand::DiscardBrushCommand() : Command(CommandId::DiscardBrush(), CmdUIOnlyFlag) DiscardBrushCommand::DiscardBrushCommand() : Command(CommandId::DiscardBrush())
{ {
} }
bool DiscardBrushCommand::onEnabled(Context* context) bool DiscardBrushCommand::onEnabled(Context* context)
{ {
if (!context->isUIAvailable())
return false;
ContextBar* ctxBar = App::instance()->contextBar(); ContextBar* ctxBar = App::instance()->contextBar();
return (ctxBar->activeBrush()->type() == kImageBrushType); return (ctxBar->activeBrush()->type() == kImageBrushType);
} }

View File

@ -10,16 +10,11 @@
#include "app/app.h" #include "app/app.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/console.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/doc_api.h" #include "app/doc_api.h"
#include "app/doc_undo.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/tx.h" #include "app/tx.h"
#include "app/ui/editor/editor.h"
#include "doc/layer.h" #include "doc/layer.h"
#include "doc/sprite.h"
#include "ui/ui.h"
namespace app { namespace app {
@ -32,8 +27,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
DuplicateLayerCommand::DuplicateLayerCommand() DuplicateLayerCommand::DuplicateLayerCommand() : Command(CommandId::DuplicateLayer())
: Command(CommandId::DuplicateLayer(), CmdRecordableFlag)
{ {
} }

View File

@ -16,13 +16,10 @@
#include "app/ini_file.h" #include "app/ini_file.h"
#include "app/ui_context.h" #include "app/ui_context.h"
#include "base/fs.h" #include "base/fs.h"
#include "doc/sprite.h"
#include "ui/ui.h" #include "ui/ui.h"
#include "duplicate_sprite.xml.h" #include "duplicate_sprite.xml.h"
#include <cstdio>
namespace app { namespace app {
using namespace ui; using namespace ui;
@ -43,7 +40,7 @@ protected:
}; };
DuplicateSpriteCommand::DuplicateSpriteCommand() DuplicateSpriteCommand::DuplicateSpriteCommand()
: CommandWithNewParams<DuplicateSpriteParams>(CommandId::DuplicateSprite(), CmdRecordableFlag) : CommandWithNewParams<DuplicateSpriteParams>(CommandId::DuplicateSprite())
{ {
} }

View File

@ -13,8 +13,6 @@
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/ui/workspace.h" #include "app/ui/workspace.h"
#include <cstdio>
namespace app { namespace app {
// using namespace ui; // using namespace ui;
@ -28,7 +26,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
DuplicateViewCommand::DuplicateViewCommand() : Command(CommandId::DuplicateView(), CmdUIOnlyFlag) DuplicateViewCommand::DuplicateViewCommand() : Command(CommandId::DuplicateView())
{ {
} }

View File

@ -5,7 +5,6 @@
// the End-User License Agreement for Aseprite. // the End-User License Agreement for Aseprite.
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/context.h"
#ifdef ENABLE_DRM #ifdef ENABLE_DRM
#include "app/ui/enter_license.h" #include "app/ui/enter_license.h"
@ -24,7 +23,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
EnterLicenseCommand::EnterLicenseCommand() : Command(CommandId::EnterLicense(), CmdUIOnlyFlag) EnterLicenseCommand::EnterLicenseCommand() : Command(CommandId::EnterLicense())
{ {
} }

View File

@ -16,7 +16,6 @@
#include "app/doc.h" #include "app/doc.h"
#include "app/job.h" #include "app/job.h"
#include "app/ui/main_window.h" #include "app/ui/main_window.h"
#include "ui/alert.h"
#ifdef ENABLE_SCRIPTING #ifdef ENABLE_SCRIPTING
#include "app/commands/debugger.h" #include "app/commands/debugger.h"
@ -32,7 +31,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
ExitCommand::ExitCommand() : Command(CommandId::Exit(), CmdUIOnlyFlag) ExitCommand::ExitCommand() : Command(CommandId::Exit())
{ {
} }

View File

@ -33,15 +33,12 @@
#include "app/ui/status_bar.h" #include "app/ui/status_bar.h"
#include "app/ui/timeline/timeline.h" #include "app/ui/timeline/timeline.h"
#include "app/util/layer_utils.h" #include "app/util/layer_utils.h"
#include "base/convert_to.h"
#include "base/fs.h" #include "base/fs.h"
#include "base/string.h" #include "base/string.h"
#include "base/thread.h" #include "base/thread.h"
#include "doc/layer.h" #include "doc/layer.h"
#include "doc/layer_tilemap.h"
#include "doc/tag.h" #include "doc/tag.h"
#include "doc/tileset.h" #include "doc/tileset.h"
#include "doc/tilesets.h"
#include "fmt/format.h" #include "fmt/format.h"
#include "ui/message.h" #include "ui/message.h"
#include "ui/system.h" #include "ui/system.h"
@ -1187,8 +1184,7 @@ private:
} // anonymous namespace } // anonymous namespace
ExportSpriteSheetCommand::ExportSpriteSheetCommand(const char* id) ExportSpriteSheetCommand::ExportSpriteSheetCommand(const char* id) : CommandWithNewParams(id)
: CommandWithNewParams(id, CmdRecordableFlag)
{ {
} }

View File

@ -17,7 +17,6 @@
#include "app/context.h" #include "app/context.h"
#include "app/pref/preferences.h" #include "app/pref/preferences.h"
#include "app/site.h" #include "app/site.h"
#include "app/tools/tool.h"
#include "app/tools/tool_box.h" #include "app/tools/tool_box.h"
#include "app/ui/color_bar.h" #include "app/ui/color_bar.h"
#include "app/ui/editor/editor.h" #include "app/ui/editor/editor.h"
@ -28,7 +27,7 @@ namespace app {
using namespace ui; using namespace ui;
EyedropperCommand::EyedropperCommand() : Command(CommandId::Eyedropper(), CmdUIOnlyFlag) EyedropperCommand::EyedropperCommand() : Command(CommandId::Eyedropper())
{ {
m_background = false; m_background = false;
} }

View File

@ -39,7 +39,7 @@ private:
}; };
FillCommand::FillCommand(Type type) FillCommand::FillCommand(Type type)
: Command(type == Stroke ? CommandId::Stroke() : CommandId::Fill(), CmdUIOnlyFlag) : Command(type == Stroke ? CommandId::Stroke() : CommandId::Fill())
, m_type(type) , m_type(type)
{ {
} }

View File

@ -11,7 +11,6 @@
#include "app/app.h" #include "app/app.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/context_access.h"
#include "app/ui/editor/editor.h" #include "app/ui/editor/editor.h"
namespace app { namespace app {
@ -25,7 +24,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
FitScreenCommand::FitScreenCommand() : Command(CommandId::FitScreen(), CmdUIOnlyFlag) FitScreenCommand::FitScreenCommand() : Command(CommandId::FitScreen())
{ {
} }

View File

@ -36,7 +36,7 @@ protected:
bool m_visibleOnly; bool m_visibleOnly;
}; };
FlattenLayersCommand::FlattenLayersCommand() : Command(CommandId::FlattenLayers(), CmdUIOnlyFlag) FlattenLayersCommand::FlattenLayersCommand() : Command(CommandId::FlattenLayers())
{ {
m_visibleOnly = false; m_visibleOnly = false;
} }

View File

@ -20,7 +20,6 @@
#include "app/commands/params.h" #include "app/commands/params.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/doc_api.h" #include "app/doc_api.h"
#include "app/doc_range.h"
#include "app/i18n/strings.h" #include "app/i18n/strings.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/tools/tool_box.h" #include "app/tools/tool_box.h"
@ -38,11 +37,10 @@
#include "doc/layer.h" #include "doc/layer.h"
#include "doc/mask.h" #include "doc/mask.h"
#include "doc/sprite.h" #include "doc/sprite.h"
#include "gfx/size.h"
namespace app { namespace app {
FlipCommand::FlipCommand() : Command(CommandId::Flip(), CmdRecordableFlag) FlipCommand::FlipCommand() : Command(CommandId::Flip())
{ {
m_flipMask = false; m_flipMask = false;
m_flipType = doc::algorithm::FlipHorizontal; m_flipType = doc::algorithm::FlipHorizontal;

View File

@ -44,12 +44,11 @@ private:
// Frame to be shown. It can be ALL_FRAMES, CURRENT_RANGE, or a // Frame to be shown. It can be ALL_FRAMES, CURRENT_RANGE, or a
// number indicating a specific frame (1 is the first frame). // number indicating a specific frame (1 is the first frame).
Target m_target; Target m_target = CURRENT_RANGE;
frame_t m_frame; frame_t m_frame = 1;
}; };
FramePropertiesCommand::FramePropertiesCommand() FramePropertiesCommand::FramePropertiesCommand() : Command(CommandId::FrameProperties())
: Command(CommandId::FrameProperties(), CmdUIOnlyFlag)
{ {
} }
@ -59,7 +58,7 @@ void FramePropertiesCommand::onLoadParams(const Params& params)
if (frame == "all") { if (frame == "all") {
m_target = ALL_FRAMES; m_target = ALL_FRAMES;
} }
else if (frame == "current") { else if (frame == "current" || !params.has_param("frame")) {
m_target = CURRENT_RANGE; m_target = CURRENT_RANGE;
} }
else { else {
@ -70,7 +69,7 @@ void FramePropertiesCommand::onLoadParams(const Params& params)
bool FramePropertiesCommand::onEnabled(Context* context) bool FramePropertiesCommand::onEnabled(Context* context)
{ {
return context->checkFlags(ContextFlags::ActiveDocumentIsWritable); return context->isUIAvailable() && context->checkFlags(ContextFlags::ActiveDocumentIsWritable);
} }
void FramePropertiesCommand::onExecute(Context* context) void FramePropertiesCommand::onExecute(Context* context)

View File

@ -15,7 +15,6 @@
#include "app/cmd/set_tag_range.h" #include "app/cmd/set_tag_range.h"
#include "app/cmd/set_tag_repeat.h" #include "app/cmd/set_tag_repeat.h"
#include "app/cmd/set_user_data.h" #include "app/cmd/set_user_data.h"
#include "app/color.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/commands/params.h" #include "app/commands/params.h"
#include "app/context_access.h" #include "app/context_access.h"
@ -48,7 +47,7 @@ private:
}; };
FrameTagPropertiesCommand::FrameTagPropertiesCommand() FrameTagPropertiesCommand::FrameTagPropertiesCommand()
: Command(CommandId::FrameTagProperties(), CmdUIOnlyFlag) : Command(CommandId::FrameTagProperties())
, m_tagId(NullId) , m_tagId(NullId)
{ {
} }
@ -66,7 +65,7 @@ void FrameTagPropertiesCommand::onLoadParams(const Params& params)
bool FrameTagPropertiesCommand::onEnabled(Context* context) bool FrameTagPropertiesCommand::onEnabled(Context* context)
{ {
return context->checkFlags(ContextFlags::ActiveDocumentIsWritable); return context->isUIAvailable() && context->checkFlags(ContextFlags::ActiveDocumentIsWritable);
} }
void FrameTagPropertiesCommand::onExecute(Context* context) void FrameTagPropertiesCommand::onExecute(Context* context)

View File

@ -27,7 +27,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
FullscreenModeCommand::FullscreenModeCommand() : Command(CommandId::FullscreenMode(), CmdUIOnlyFlag) FullscreenModeCommand::FullscreenModeCommand() : Command(CommandId::FullscreenMode())
{ {
} }

View File

@ -23,10 +23,7 @@
#include "app/ui/main_window.h" #include "app/ui/main_window.h"
#include "app/ui/preview_editor.h" #include "app/ui/preview_editor.h"
#include "app/ui/status_bar.h" #include "app/ui/status_bar.h"
#include "app/util/conversion_to_surface.h"
#include "doc/image.h"
#include "doc/palette.h" #include "doc/palette.h"
#include "doc/primitives.h"
#include "doc/sprite.h" #include "doc/sprite.h"
#include "gfx/matrix.h" #include "gfx/matrix.h"
#include "os/surface.h" #include "os/surface.h"
@ -308,8 +305,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
FullscreenPreviewCommand::FullscreenPreviewCommand() FullscreenPreviewCommand::FullscreenPreviewCommand() : Command(CommandId::FullscreenPreview())
: Command(CommandId::FullscreenPreview(), CmdUIOnlyFlag)
{ {
} }

View File

@ -31,7 +31,7 @@ using namespace doc;
class GotoCommand : public Command { class GotoCommand : public Command {
protected: protected:
GotoCommand(const char* id) : Command(id, CmdRecordableFlag) {} GotoCommand(const char* id) : Command(id) {}
bool onEnabled(Context* context) override { return (Editor::activeEditor() != nullptr); } bool onEnabled(Context* context) override { return (Editor::activeEditor() != nullptr); }

View File

@ -24,11 +24,7 @@ namespace app {
class GotoLayerCommand : public Command { class GotoLayerCommand : public Command {
public: public:
GotoLayerCommand(int offset, const char* id, CommandFlags flags) GotoLayerCommand(int offset, const char* id) : Command(id), m_offset(offset) {}
: Command(id, flags)
, m_offset(offset)
{
}
protected: protected:
bool onEnabled(Context* context) override bool onEnabled(Context* context) override
@ -88,12 +84,12 @@ private:
class GotoPreviousLayerCommand : public GotoLayerCommand { class GotoPreviousLayerCommand : public GotoLayerCommand {
public: public:
GotoPreviousLayerCommand() : GotoLayerCommand(-1, "GotoPreviousLayer", CmdUIOnlyFlag) {} GotoPreviousLayerCommand() : GotoLayerCommand(-1, CommandId::GotoPreviousLayer()) {}
}; };
class GotoNextLayerCommand : public GotoLayerCommand { class GotoNextLayerCommand : public GotoLayerCommand {
public: public:
GotoNextLayerCommand() : GotoLayerCommand(+1, "GotoNextLayer", CmdUIOnlyFlag) {} GotoNextLayerCommand() : GotoLayerCommand(+1, CommandId::GotoNextLayer()) {}
}; };
Command* CommandFactory::createGotoPreviousLayerCommand() Command* CommandFactory::createGotoPreviousLayerCommand()

View File

@ -24,7 +24,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
GotoNextTabCommand::GotoNextTabCommand() : Command(CommandId::GotoNextTab(), CmdUIOnlyFlag) GotoNextTabCommand::GotoNextTabCommand() : Command(CommandId::GotoNextTab())
{ {
} }
@ -50,8 +50,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
GotoPreviousTabCommand::GotoPreviousTabCommand() GotoPreviousTabCommand::GotoPreviousTabCommand() : Command(CommandId::GotoPreviousTab())
: Command(CommandId::GotoPreviousTab(), CmdRecordableFlag)
{ {
} }

View File

@ -15,13 +15,9 @@
#include "app/context.h" #include "app/context.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/doc.h" #include "app/doc.h"
#include "app/find_widget.h"
#include "app/load_widget.h"
#include "app/pref/preferences.h" #include "app/pref/preferences.h"
#include "app/tx.h" #include "app/tx.h"
#include "app/ui/status_bar.h" #include "app/ui/status_bar.h"
#include "app/ui_context.h"
#include "doc/document.h"
#include "doc/mask.h" #include "doc/mask.h"
#include "ui/window.h" #include "ui/window.h"
@ -36,7 +32,7 @@ using namespace gfx;
class SnapToGridCommand : public Command { class SnapToGridCommand : public Command {
public: public:
SnapToGridCommand() : Command(CommandId::SnapToGrid(), CmdUIOnlyFlag) {} SnapToGridCommand() : Command(CommandId::SnapToGrid()) {}
protected: protected:
bool onChecked(Context* ctx) override bool onChecked(Context* ctx) override
@ -51,13 +47,14 @@ protected:
bool newValue = !docPref.grid.snap(); bool newValue = !docPref.grid.snap();
docPref.grid.snap(newValue); docPref.grid.snap(newValue);
StatusBar::instance()->showSnapToGridWarning(newValue); if (ctx->isUIAvailable())
StatusBar::instance()->showSnapToGridWarning(newValue);
} }
}; };
class SelectionAsGridCommand : public Command { class SelectionAsGridCommand : public Command {
public: public:
SelectionAsGridCommand() : Command(CommandId::SelectionAsGrid(), CmdUIOnlyFlag) {} SelectionAsGridCommand() : Command(CommandId::SelectionAsGrid()) {}
protected: protected:
bool onEnabled(Context* ctx) override bool onEnabled(Context* ctx) override
@ -92,13 +89,13 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
GridSettingsCommand::GridSettingsCommand() : Command(CommandId::GridSettings(), CmdUIOnlyFlag) GridSettingsCommand::GridSettingsCommand() : Command(CommandId::GridSettings())
{ {
} }
bool GridSettingsCommand::onEnabled(Context* context) bool GridSettingsCommand::onEnabled(Context* context)
{ {
return true; return context->isUIAvailable();
} }
void GridSettingsCommand::onExecute(Context* context) void GridSettingsCommand::onExecute(Context* context)

View File

@ -10,6 +10,7 @@
#include "app/app.h" #include "app/app.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/context.h"
#include "app/ui/main_window.h" #include "app/ui/main_window.h"
namespace app { namespace app {
@ -26,7 +27,7 @@ protected:
bool onEnabled(Context* context) override; bool onEnabled(Context* context) override;
}; };
HomeCommand::HomeCommand() : Command(CommandId::Home(), CmdUIOnlyFlag) HomeCommand::HomeCommand() : Command(CommandId::Home())
{ {
} }
@ -41,7 +42,7 @@ void HomeCommand::onExecute(Context* context)
bool HomeCommand::onEnabled(Context* context) bool HomeCommand::onEnabled(Context* context)
{ {
return !App::instance()->mainWindow()->isHomeSelected(); return context->isUIAvailable() && !App::instance()->mainWindow()->isHomeSelected();
} }
Command* CommandFactory::createHomeCommand() Command* CommandFactory::createHomeCommand()

View File

@ -20,20 +20,14 @@
#include "app/doc_api.h" #include "app/doc_api.h"
#include "app/i18n/strings.h" #include "app/i18n/strings.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/modules/palettes.h"
#include "app/pref/preferences.h" #include "app/pref/preferences.h"
#include "app/tx.h" #include "app/tx.h"
#include "app/ui/drop_down_button.h"
#include "app/ui/editor/editor.h" #include "app/ui/editor/editor.h"
#include "app/ui/editor/editor_decorator.h"
#include "app/ui/editor/select_box_state.h" #include "app/ui/editor/select_box_state.h"
#include "app/ui/editor/standby_state.h"
#include "app/ui/workspace.h" #include "app/ui/workspace.h"
#include "doc/cel.h" #include "doc/cel.h"
#include "doc/image.h" #include "doc/image.h"
#include "doc/layer.h" #include "doc/layer.h"
#include "doc/palette.h"
#include "doc/primitives.h"
#include "doc/sprite.h" #include "doc/sprite.h"
#include "render/render.h" #include "render/render.h"
#include "ui/ui.h" #include "ui/ui.h"
@ -518,7 +512,7 @@ protected:
}; };
ImportSpriteSheetCommand::ImportSpriteSheetCommand() ImportSpriteSheetCommand::ImportSpriteSheetCommand()
: CommandWithNewParams(CommandId::ImportSpriteSheet(), CmdRecordableFlag) : CommandWithNewParams(CommandId::ImportSpriteSheet())
{ {
} }

View File

@ -31,7 +31,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
InvertMaskCommand::InvertMaskCommand() : Command(CommandId::InvertMask(), CmdRecordableFlag) InvertMaskCommand::InvertMaskCommand() : Command(CommandId::InvertMask())
{ {
} }

View File

@ -26,22 +26,17 @@
#include "app/ui/select_shortcut.h" #include "app/ui/select_shortcut.h"
#include "app/ui/separator_in_view.h" #include "app/ui/separator_in_view.h"
#include "app/ui/skin/skin_theme.h" #include "app/ui/skin/skin_theme.h"
#include "base/fs.h"
#include "base/pi.h" #include "base/pi.h"
#include "base/scoped_value.h" #include "base/scoped_value.h"
#include "base/split_string.h"
#include "base/string.h"
#include "ui/alert.h" #include "ui/alert.h"
#include "ui/fit_bounds.h" #include "ui/fit_bounds.h"
#include "ui/graphics.h" #include "ui/graphics.h"
#include "ui/listitem.h" #include "ui/listitem.h"
#include "ui/message.h" #include "ui/message.h"
#include "ui/paint_event.h" #include "ui/paint_event.h"
#include "ui/resize_event.h"
#include "ui/separator.h" #include "ui/separator.h"
#include "ui/size_hint_event.h" #include "ui/size_hint_event.h"
#include "ui/splitter.h" #include "ui/splitter.h"
#include "ui/system.h"
#include "keyboard_shortcuts.xml.h" #include "keyboard_shortcuts.xml.h"
@ -977,6 +972,7 @@ public:
KeyboardShortcutsCommand(); KeyboardShortcutsCommand();
protected: protected:
bool onEnabled(Context* context) override;
void onLoadParams(const Params& params) override; void onLoadParams(const Params& params) override;
void onExecute(Context* context) override; void onExecute(Context* context) override;
@ -986,11 +982,15 @@ private:
std::string m_search; std::string m_search;
}; };
KeyboardShortcutsCommand::KeyboardShortcutsCommand() KeyboardShortcutsCommand::KeyboardShortcutsCommand() : Command(CommandId::KeyboardShortcuts())
: Command(CommandId::KeyboardShortcuts(), CmdUIOnlyFlag)
{ {
} }
bool KeyboardShortcutsCommand::onEnabled(Context* context)
{
return context->isUIAvailable();
}
void KeyboardShortcutsCommand::onLoadParams(const Params& params) void KeyboardShortcutsCommand::onLoadParams(const Params& params)
{ {
m_search = params.get("search"); m_search = params.get("search");

View File

@ -34,10 +34,7 @@ private:
std::string m_path; std::string m_path;
}; };
LaunchCommand::LaunchCommand() LaunchCommand::LaunchCommand() : Command(CommandId::Launch()), m_type(Url), m_path("")
: Command(CommandId::Launch(), CmdUIOnlyFlag)
, m_type(Url)
, m_path("")
{ {
} }

View File

@ -14,8 +14,6 @@
#include "app/context_access.h" #include "app/context_access.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/tx.h" #include "app/tx.h"
#include "doc/layer.h"
#include "doc/sprite.h"
namespace app { namespace app {
@ -28,8 +26,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
LayerFromBackgroundCommand::LayerFromBackgroundCommand() LayerFromBackgroundCommand::LayerFromBackgroundCommand() : Command(CommandId::LayerFromBackground())
: Command(CommandId::LayerFromBackground(), CmdRecordableFlag)
{ {
} }

View File

@ -9,11 +9,9 @@
#include "config.h" #include "config.h"
#endif #endif
#include "app/app.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "doc/image.h"
#include "doc/layer.h" #include "doc/layer.h"
namespace app { namespace app {
@ -30,7 +28,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
LayerLockCommand::LayerLockCommand() : Command(CommandId::LayerLock(), CmdRecordableFlag) LayerLockCommand::LayerLockCommand() : Command(CommandId::LayerLock())
{ {
} }

View File

@ -9,7 +9,6 @@
#include "config.h" #include "config.h"
#endif #endif
#include "app/app.h"
#include "app/cmd/set_layer_opacity.h" #include "app/cmd/set_layer_opacity.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/commands/params.h" #include "app/commands/params.h"
@ -40,7 +39,7 @@ private:
int m_opacity; int m_opacity;
}; };
LayerOpacityCommand::LayerOpacityCommand() : Command(CommandId::LayerOpacity(), CmdUIOnlyFlag) LayerOpacityCommand::LayerOpacityCommand() : Command(CommandId::LayerOpacity())
{ {
m_opacity = 255; m_opacity = 255;
} }

View File

@ -34,7 +34,6 @@
#include "app/ui_context.h" #include "app/ui_context.h"
#include "base/convert_to.h" #include "base/convert_to.h"
#include "base/scoped_value.h" #include "base/scoped_value.h"
#include "doc/image.h"
#include "doc/layer.h" #include "doc/layer.h"
#include "doc/layer_tilemap.h" #include "doc/layer_tilemap.h"
#include "doc/sprite.h" #include "doc/sprite.h"
@ -500,14 +499,14 @@ private:
bool m_remapAfterConfigure = false; bool m_remapAfterConfigure = false;
}; };
LayerPropertiesCommand::LayerPropertiesCommand() LayerPropertiesCommand::LayerPropertiesCommand() : Command(CommandId::LayerProperties())
: Command(CommandId::LayerProperties(), CmdRecordableFlag)
{ {
} }
bool LayerPropertiesCommand::onEnabled(Context* context) bool LayerPropertiesCommand::onEnabled(Context* context)
{ {
return context->checkFlags(ContextFlags::ActiveDocumentIsWritable | ContextFlags::HasActiveLayer); return context->isUIAvailable() &&
context->checkFlags(ContextFlags::ActiveDocumentIsWritable | ContextFlags::HasActiveLayer);
} }
void LayerPropertiesCommand::onExecute(Context* context) void LayerPropertiesCommand::onExecute(Context* context)

View File

@ -12,7 +12,6 @@
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "doc/image.h"
#include "doc/layer.h" #include "doc/layer.h"
namespace app { namespace app {
@ -29,8 +28,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
LayerVisibilityCommand::LayerVisibilityCommand() LayerVisibilityCommand::LayerVisibilityCommand() : Command(CommandId::LayerVisibility())
: Command(CommandId::LayerVisibility(), CmdRecordableFlag)
{ {
} }

View File

@ -18,7 +18,6 @@
#include "app/ui/status_bar.h" #include "app/ui/status_bar.h"
#include "doc/cel.h" #include "doc/cel.h"
#include "doc/layer.h" #include "doc/layer.h"
#include "doc/sprite.h"
namespace app { namespace app {
@ -31,7 +30,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
LinkCelsCommand::LinkCelsCommand() : Command(CommandId::LinkCels(), CmdRecordableFlag) LinkCelsCommand::LinkCelsCommand() : Command(CommandId::LinkCels())
{ {
} }
@ -88,7 +87,7 @@ void LinkCelsCommand::onExecute(Context* context)
tx.commit(); tx.commit();
} }
if (nonEditableLayers) if (context->isUIAvailable() && nonEditableLayers)
StatusBar::instance()->showTip(1000, Strings::statusbar_tips_locked_layers()); StatusBar::instance()->showTip(1000, Strings::statusbar_tips_locked_layers());
update_screen_for_document(document); update_screen_for_document(document);

View File

@ -26,6 +26,7 @@ namespace app {
class LoadMaskCommand : public Command { class LoadMaskCommand : public Command {
std::string m_filename; std::string m_filename;
bool m_ui = true;
public: public:
LoadMaskCommand(); LoadMaskCommand();
@ -36,13 +37,16 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
LoadMaskCommand::LoadMaskCommand() : Command(CommandId::LoadMask(), CmdRecordableFlag) LoadMaskCommand::LoadMaskCommand() : Command(CommandId::LoadMask())
{ {
m_filename = "";
} }
void LoadMaskCommand::onLoadParams(const Params& params) void LoadMaskCommand::onLoadParams(const Params& params)
{ {
if (params.has_param("ui"))
m_ui = params.get_as<bool>("ui");
else
m_ui = true;
m_filename = params.get("filename"); m_filename = params.get("filename");
} }
@ -55,7 +59,7 @@ void LoadMaskCommand::onExecute(Context* context)
{ {
const ContextReader reader(context); const ContextReader reader(context);
if (context->isUIAvailable()) { if (context->isUIAvailable() && m_ui) {
base::paths exts = { "msk" }; base::paths exts = { "msk" };
base::paths selectedFilename; base::paths selectedFilename;
if (!app::show_file_selector(Strings::load_selection_title(), if (!app::show_file_selector(Strings::load_selection_title(),
@ -70,7 +74,8 @@ void LoadMaskCommand::onExecute(Context* context)
std::unique_ptr<Mask> mask(load_msk_file(m_filename.c_str())); std::unique_ptr<Mask> mask(load_msk_file(m_filename.c_str()));
if (!mask) { if (!mask) {
ui::Alert::show(Strings::alerts_error_loading_file(m_filename)); if (context->isUIAvailable())
ui::Alert::show(Strings::alerts_error_loading_file(m_filename));
return; return;
} }

View File

@ -37,14 +37,19 @@ protected:
private: private:
std::string m_preset; std::string m_preset;
std::string m_filename; std::string m_filename;
bool m_ui = true;
}; };
LoadPaletteCommand::LoadPaletteCommand() : Command(CommandId::LoadPalette(), CmdRecordableFlag) LoadPaletteCommand::LoadPaletteCommand() : Command(CommandId::LoadPalette())
{ {
} }
void LoadPaletteCommand::onLoadParams(const Params& params) void LoadPaletteCommand::onLoadParams(const Params& params)
{ {
if (params.has_param("ui"))
m_ui = params.get_as<bool>("ui");
else
m_ui = true;
m_preset = params.get("preset"); m_preset = params.get("preset");
m_filename = params.get("filename"); m_filename = params.get("filename");
} }
@ -58,20 +63,20 @@ void LoadPaletteCommand::onExecute(Context* context)
if (!base::is_file(filename)) if (!base::is_file(filename))
filename = get_preset_palette_filename(m_preset, ".gpl"); filename = get_preset_palette_filename(m_preset, ".gpl");
} }
else if (!m_filename.empty()) { else if (context->isUIAvailable() && m_ui) {
filename = m_filename; const base::paths exts = get_readable_palette_extensions();
}
else if (context->isUIAvailable()) {
base::paths exts = get_readable_palette_extensions();
base::paths filenames; base::paths filenames;
if (app::show_file_selector(Strings::load_palette_title(), if (app::show_file_selector(Strings::load_palette_title(),
"", m_filename,
exts, exts,
FileSelectorType::Open, FileSelectorType::Open,
filenames)) { filenames)) {
filename = filenames.front(); filename = filenames.front();
} }
} }
else if (!m_filename.empty()) {
filename = m_filename;
}
// Do nothing // Do nothing
if (filename.empty()) if (filename.empty())

View File

@ -29,7 +29,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
MaskAllCommand::MaskAllCommand() : Command(CommandId::MaskAll(), CmdRecordableFlag) MaskAllCommand::MaskAllCommand() : Command(CommandId::MaskAll())
{ {
} }

View File

@ -15,7 +15,6 @@
#include "app/color_utils.h" #include "app/color_utils.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/commands/new_params.h" #include "app/commands/new_params.h"
#include "app/console.h"
#include "app/context.h" #include "app/context.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/doc.h" #include "app/doc.h"
@ -26,9 +25,6 @@
#include "app/ui/color_bar.h" #include "app/ui/color_bar.h"
#include "app/ui/color_button.h" #include "app/ui/color_button.h"
#include "app/ui/selection_mode_field.h" #include "app/ui/selection_mode_field.h"
#include "base/chrono.h"
#include "base/convert_to.h"
#include "base/scoped_value.h"
#include "doc/image.h" #include "doc/image.h"
#include "doc/mask.h" #include "doc/mask.h"
#include "doc/sprite.h" #include "doc/sprite.h"
@ -203,8 +199,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
MaskByColorCommand::MaskByColorCommand() MaskByColorCommand::MaskByColorCommand() : CommandWithNewParams(CommandId::MaskByColor())
: CommandWithNewParams(CommandId::MaskByColor(), CmdUIOnlyFlag)
{ {
} }

View File

@ -25,7 +25,6 @@
#include "doc/image.h" #include "doc/image.h"
#include "doc/layer.h" #include "doc/layer.h"
#include "doc/mask.h" #include "doc/mask.h"
#include "doc/sprite.h"
namespace app { namespace app {
@ -38,7 +37,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
MaskContentCommand::MaskContentCommand() : Command(CommandId::MaskContent(), CmdRecordableFlag) MaskContentCommand::MaskContentCommand() : Command(CommandId::MaskContent())
{ {
} }
@ -87,9 +86,11 @@ void MaskContentCommand::onExecute(Context* context)
} }
// Select marquee tool // Select marquee tool
if (tools::Tool* tool = App::instance()->toolBox()->getToolById( if (context->isUIAvailable()) {
tools::WellKnownTools::RectangularMarquee)) { if (tools::Tool* tool = App::instance()->toolBox()->getToolById(
ToolBar::instance()->selectTool(tool); tools::WellKnownTools::RectangularMarquee)) {
ToolBar::instance()->selectTool(tool);
}
} }
update_screen_for_document(document); update_screen_for_document(document);

View File

@ -13,16 +13,12 @@
#include "app/cmd/flatten_layers.h" #include "app/cmd/flatten_layers.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/doc.h"
#include "app/doc_api.h"
#include "app/doc_range.h" #include "app/doc_range.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/pref/preferences.h" #include "app/pref/preferences.h"
#include "app/tx.h" #include "app/tx.h"
#include "doc/blend_internals.h"
#include "doc/layer.h" #include "doc/layer.h"
#include "doc/sprite.h" #include "doc/sprite.h"
#include "ui/ui.h"
namespace app { namespace app {
@ -35,8 +31,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
MergeDownLayerCommand::MergeDownLayerCommand() MergeDownLayerCommand::MergeDownLayerCommand() : Command(CommandId::MergeDownLayer())
: Command(CommandId::MergeDownLayer(), CmdRecordableFlag)
{ {
} }

View File

@ -18,16 +18,12 @@
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/pref/preferences.h" #include "app/pref/preferences.h"
#include "app/tx.h" #include "app/tx.h"
#include "base/convert_to.h"
#include "doc/algorithm/modify_selection.h" #include "doc/algorithm/modify_selection.h"
#include "doc/brush_type.h" #include "doc/brush_type.h"
#include "doc/mask.h" #include "doc/mask.h"
#include "filters/neighboring_pixels.h"
#include "modify_selection.xml.h" #include "modify_selection.xml.h"
#include <limits>
namespace app { namespace app {
using namespace doc; using namespace doc;
@ -52,13 +48,15 @@ private:
Modifier m_modifier; Modifier m_modifier;
int m_quantity; int m_quantity;
doc::BrushType m_brushType; doc::BrushType m_brushType;
bool m_ui;
}; };
ModifySelectionCommand::ModifySelectionCommand() ModifySelectionCommand::ModifySelectionCommand()
: Command(CommandId::ModifySelection(), CmdRecordableFlag) : Command(CommandId::ModifySelection())
, m_modifier(Modifier::Expand) , m_modifier(Modifier::Expand)
, m_quantity(0) , m_quantity(0)
, m_brushType(doc::kCircleBrushType) , m_brushType(doc::kCircleBrushType)
, m_ui(true)
{ {
} }
@ -80,6 +78,11 @@ void ModifySelectionCommand::onLoadParams(const Params& params)
m_brushType = doc::kCircleBrushType; m_brushType = doc::kCircleBrushType;
else if (brush == "square") else if (brush == "square")
m_brushType = doc::kSquareBrushType; m_brushType = doc::kSquareBrushType;
if (params.has_param("ui"))
m_ui = params.get_as<bool>("ui");
else
m_ui = true;
} }
bool ModifySelectionCommand::onEnabled(Context* context) bool ModifySelectionCommand::onEnabled(Context* context)
@ -92,7 +95,7 @@ void ModifySelectionCommand::onExecute(Context* context)
int quantity = m_quantity; int quantity = m_quantity;
doc::BrushType brush = m_brushType; doc::BrushType brush = m_brushType;
if (quantity == 0) { if (quantity == 0 && m_ui && context->isUIAvailable()) {
Preferences& pref = Preferences::instance(); Preferences& pref = Preferences::instance();
ModifySelectionWindow window; ModifySelectionWindow window;

View File

@ -12,7 +12,6 @@
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/ui/timeline/timeline.h" #include "app/ui/timeline/timeline.h"
#include "ui/base.h"
namespace app { namespace app {
@ -25,13 +24,13 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
MoveCelCommand::MoveCelCommand() : Command(CommandId::MoveCel(), CmdUIOnlyFlag) MoveCelCommand::MoveCelCommand() : Command(CommandId::MoveCel())
{ {
} }
bool MoveCelCommand::onEnabled(Context* context) bool MoveCelCommand::onEnabled(Context* context)
{ {
return App::instance()->timeline()->isMovingCel(); return context->isUIAvailable() && App::instance()->timeline()->isMovingCel();
} }
void MoveCelCommand::onExecute(Context* context) void MoveCelCommand::onExecute(Context* context)

View File

@ -18,19 +18,15 @@
#include "app/doc_api.h" #include "app/doc_api.h"
#include "app/i18n/strings.h" #include "app/i18n/strings.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/pref/preferences.h"
#include "app/tx.h" #include "app/tx.h"
#include "app/ui/doc_view.h" #include "app/ui/doc_view.h"
#include "app/ui/editor/editor.h" #include "app/ui/editor/editor.h"
#include "app/ui_context.h" #include "app/ui_context.h"
#include "base/convert_to.h"
#include "doc/mask.h" #include "doc/mask.h"
#include "doc/sprite.h"
#include "ui/view.h"
namespace app { namespace app {
MoveMaskCommand::MoveMaskCommand() : Command(CommandId::MoveMask(), CmdRecordableFlag) MoveMaskCommand::MoveMaskCommand() : Command(CommandId::MoveMask())
{ {
} }

View File

@ -52,13 +52,13 @@ private:
void selectPencilTool(); void selectPencilTool();
}; };
NewBrushCommand::NewBrushCommand() : Command(CommandId::NewBrush(), CmdUIOnlyFlag) NewBrushCommand::NewBrushCommand() : Command(CommandId::NewBrush())
{ {
} }
bool NewBrushCommand::onEnabled(Context* context) bool NewBrushCommand::onEnabled(Context* context)
{ {
return context->checkFlags(ContextFlags::ActiveDocumentIsWritable); return context->isUIAvailable() && context->checkFlags(ContextFlags::ActiveDocumentIsWritable);
} }
void NewBrushCommand::onExecute(Context* context) void NewBrushCommand::onExecute(Context* context)

View File

@ -64,7 +64,7 @@ protected:
// static // static
int NewFileCommand::g_spriteCounter = 0; int NewFileCommand::g_spriteCounter = 0;
NewFileCommand::NewFileCommand() : CommandWithNewParams(CommandId::NewFile(), CmdRecordableFlag) NewFileCommand::NewFileCommand() : CommandWithNewParams(CommandId::NewFile())
{ {
} }

View File

@ -10,28 +10,18 @@
#endif #endif
#include "app/app.h" #include "app/app.h"
#include "app/color.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/commands/params.h" #include "app/commands/params.h"
#include "app/console.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/doc_api.h" #include "app/doc_api.h"
#include "app/i18n/strings.h" #include "app/i18n/strings.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/tx.h" #include "app/tx.h"
#include "app/ui/doc_view.h"
#include "app/ui/editor/editor.h"
#include "app/ui/main_window.h" #include "app/ui/main_window.h"
#include "app/ui/status_bar.h" #include "app/ui/status_bar.h"
#include "app/ui/timeline/timeline.h" #include "app/ui/timeline/timeline.h"
#include "app/ui_context.h"
#include "doc/cel.h"
#include "doc/image.h"
#include "doc/layer.h" #include "doc/layer.h"
#include "doc/sprite.h" #include "doc/sprite.h"
#include "ui/ui.h"
#include <stdexcept>
namespace app { namespace app {
@ -57,7 +47,7 @@ private:
Content m_content; Content m_content;
}; };
NewFrameCommand::NewFrameCommand() : Command(CommandId::NewFrame(), CmdRecordableFlag) NewFrameCommand::NewFrameCommand() : Command(CommandId::NewFrame())
{ {
} }

View File

@ -9,7 +9,6 @@
#include "config.h" #include "config.h"
#endif #endif
#include "app/app.h"
#include "app/cmd/add_tag.h" #include "app/cmd/add_tag.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/context.h" #include "app/context.h"
@ -18,8 +17,6 @@
#include "app/ui/tag_window.h" #include "app/ui/tag_window.h"
#include "doc/tag.h" #include "doc/tag.h"
#include <stdexcept>
namespace app { namespace app {
using namespace doc; using namespace doc;
@ -33,14 +30,14 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
NewFrameTagCommand::NewFrameTagCommand() : Command(CommandId::NewFrameTag(), CmdRecordableFlag) NewFrameTagCommand::NewFrameTagCommand() : Command(CommandId::NewFrameTag())
{ {
} }
bool NewFrameTagCommand::onEnabled(Context* context) bool NewFrameTagCommand::onEnabled(Context* context)
{ {
return context->checkFlags(ContextFlags::ActiveDocumentIsWritable | return context->isUIAvailable() && context->checkFlags(ContextFlags::ActiveDocumentIsWritable |
ContextFlags::HasActiveSprite); ContextFlags::HasActiveSprite);
} }
void NewFrameTagCommand::onExecute(Context* context) void NewFrameTagCommand::onExecute(Context* context)

View File

@ -21,9 +21,7 @@
#include "app/console.h" #include "app/console.h"
#include "app/context_access.h" #include "app/context_access.h"
#include "app/doc_api.h" #include "app/doc_api.h"
#include "app/find_widget.h"
#include "app/i18n/strings.h" #include "app/i18n/strings.h"
#include "app/load_widget.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/pref/preferences.h" #include "app/pref/preferences.h"
#include "app/restore_visible_layers.h" #include "app/restore_visible_layers.h"
@ -48,7 +46,6 @@
#include "new_layer.xml.h" #include "new_layer.xml.h"
#include <algorithm> #include <algorithm>
#include <cstdlib>
#include <cstring> #include <cstring>
#include <string> #include <string>
@ -99,7 +96,7 @@ private:
Place m_place; Place m_place;
}; };
NewLayerCommand::NewLayerCommand() : CommandWithNewParams(CommandId::NewLayer(), CmdRecordableFlag) NewLayerCommand::NewLayerCommand() : CommandWithNewParams(CommandId::NewLayer())
{ {
} }

View File

@ -23,8 +23,6 @@
#include "doc/sprite.h" #include "doc/sprite.h"
#include "fmt/format.h" #include "fmt/format.h"
#include <cstdio>
namespace app { namespace app {
using namespace doc; using namespace doc;
@ -39,7 +37,7 @@ protected:
}; };
NewSpriteFromSelectionCommand::NewSpriteFromSelectionCommand() NewSpriteFromSelectionCommand::NewSpriteFromSelectionCommand()
: Command(CommandId::NewSpriteFromSelection(), CmdUIOnlyFlag) : Command(CommandId::NewSpriteFromSelection())
{ {
} }

View File

@ -8,7 +8,6 @@
#include "config.h" #include "config.h"
#endif #endif
#include "app/app.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/context.h" #include "app/context.h"
#include "app/doc.h" #include "app/doc.h"
@ -20,7 +19,7 @@ using namespace gfx;
class ShowOnionSkinCommand : public Command { class ShowOnionSkinCommand : public Command {
public: public:
ShowOnionSkinCommand() : Command(CommandId::ShowOnionSkin(), CmdUIOnlyFlag) {} ShowOnionSkinCommand() : Command(CommandId::ShowOnionSkin()) {}
protected: protected:
bool onChecked(Context* context) override bool onChecked(Context* context) override

View File

@ -22,6 +22,7 @@ public:
OpenBrowserCommand(); OpenBrowserCommand();
protected: protected:
bool onEnabled(Context* context) override;
void onLoadParams(const Params& params) override; void onLoadParams(const Params& params) override;
void onExecute(Context* context) override; void onExecute(Context* context) override;
std::string onGetFriendlyName() const override; std::string onGetFriendlyName() const override;
@ -31,10 +32,15 @@ private:
std::string m_filename; std::string m_filename;
}; };
OpenBrowserCommand::OpenBrowserCommand() : Command(CommandId::OpenBrowser(), CmdUIOnlyFlag) OpenBrowserCommand::OpenBrowserCommand() : Command(CommandId::OpenBrowser())
{ {
} }
bool OpenBrowserCommand::onEnabled(Context* context)
{
return context->isUIAvailable();
}
void OpenBrowserCommand::onLoadParams(const Params& params) void OpenBrowserCommand::onLoadParams(const Params& params)
{ {
m_filename = params.get("filename"); m_filename = params.get("filename");

View File

@ -19,14 +19,12 @@
#include "app/file/file.h" #include "app/file/file.h"
#include "app/file_selector.h" #include "app/file_selector.h"
#include "app/i18n/strings.h" #include "app/i18n/strings.h"
#include "app/modules/gui.h"
#include "app/pref/preferences.h" #include "app/pref/preferences.h"
#include "app/recent_files.h" #include "app/recent_files.h"
#include "app/ui/status_bar.h" #include "app/ui/status_bar.h"
#include "app/ui_context.h" #include "app/ui_context.h"
#include "app/util/open_file_job.h" #include "app/util/open_file_job.h"
#include "base/fs.h" #include "base/fs.h"
#include "base/thread.h"
#include "doc/sprite.h" #include "doc/sprite.h"
#include "ui/ui.h" #include "ui/ui.h"
@ -35,7 +33,7 @@
namespace app { namespace app {
OpenFileCommand::OpenFileCommand() OpenFileCommand::OpenFileCommand()
: Command(CommandId::OpenFile(), CmdRecordableFlag) : Command(CommandId::OpenFile())
, m_ui(true) , m_ui(true)
, m_repeatCheckbox(false) , m_repeatCheckbox(false)
, m_oneFrame(false) , m_oneFrame(false)

View File

@ -32,7 +32,7 @@ protected:
// std::string onGetFriendlyName() const override; // std::string onGetFriendlyName() const override;
}; };
OpenGroupCommand::OpenGroupCommand() : Command(CommandId::OpenGroup(), CmdRecordableFlag) OpenGroupCommand::OpenGroupCommand() : Command(CommandId::OpenGroup())
{ {
} }

View File

@ -25,7 +25,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
OpenInFolderCommand::OpenInFolderCommand() : Command(CommandId::OpenInFolder(), CmdUIOnlyFlag) OpenInFolderCommand::OpenInFolderCommand() : Command(CommandId::OpenInFolder())
{ {
} }

View File

@ -33,8 +33,7 @@ protected:
void onExecute(Context* context); void onExecute(Context* context);
}; };
OpenScriptFolderCommand::OpenScriptFolderCommand() OpenScriptFolderCommand::OpenScriptFolderCommand() : Command(CommandId::OpenScriptFolder())
: Command(CommandId::OpenScriptFolder(), CmdUIOnlyFlag)
{ {
} }

View File

@ -25,7 +25,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
OpenWithAppCommand::OpenWithAppCommand() : Command(CommandId::OpenWithApp(), CmdUIOnlyFlag) OpenWithAppCommand::OpenWithAppCommand() : Command(CommandId::OpenWithApp())
{ {
} }

View File

@ -37,7 +37,6 @@
#include "app/ui/sampling_selector.h" #include "app/ui/sampling_selector.h"
#include "app/ui/separator_in_view.h" #include "app/ui/separator_in_view.h"
#include "app/ui/skin/skin_theme.h" #include "app/ui/skin/skin_theme.h"
#include "app/util/render_text.h"
#include "base/convert_to.h" #include "base/convert_to.h"
#include "base/fs.h" #include "base/fs.h"
#include "base/string.h" #include "base/string.h"
@ -655,6 +654,7 @@ public:
} }
#endif #endif
useSelectionToolLoop()->setSelected(m_pref.experimental.useSelectionToolLoop());
flashLayer()->setSelected(m_pref.experimental.flashLayer()); flashLayer()->setSelected(m_pref.experimental.flashLayer());
nonactiveLayersOpacity()->setValue(m_pref.experimental.nonactiveLayersOpacity()); nonactiveLayersOpacity()->setValue(m_pref.experimental.nonactiveLayersOpacity());
@ -886,6 +886,7 @@ public:
m_pref.asepriteFormat.celFormat(gen::CelContentFormat(celFormat()->getSelectedItemIndex())); m_pref.asepriteFormat.celFormat(gen::CelContentFormat(celFormat()->getSelectedItemIndex()));
// Experimental features // Experimental features
m_pref.experimental.useSelectionToolLoop(useSelectionToolLoop()->isSelected());
m_pref.experimental.flashLayer(flashLayer()->isSelected()); m_pref.experimental.flashLayer(flashLayer()->isSelected());
m_pref.experimental.nonactiveLayersOpacity(nonactiveLayersOpacity()->getValue()); m_pref.experimental.nonactiveLayersOpacity(nonactiveLayersOpacity()->getValue());
m_pref.quantization.rgbmapAlgorithm(m_rgbmapAlgorithmSelector.algorithm()); m_pref.quantization.rgbmapAlgorithm(m_rgbmapAlgorithmSelector.algorithm());
@ -2177,7 +2178,7 @@ private:
std::string m_installExtensionFilename; std::string m_installExtensionFilename;
}; };
OptionsCommand::OptionsCommand() : Command(CommandId::Options(), CmdUIOnlyFlag) OptionsCommand::OptionsCommand() : Command(CommandId::Options())
{ {
Preferences& preferences = Preferences::instance(); Preferences& preferences = Preferences::instance();

View File

@ -11,6 +11,7 @@
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/commands/params.h" #include "app/commands/params.h"
#include "app/context.h"
#include "app/i18n/strings.h" #include "app/i18n/strings.h"
#include "app/ui/color_bar.h" #include "app/ui/color_bar.h"
#include "base/replace_string.h" #include "base/replace_string.h"
@ -23,6 +24,7 @@ public:
PaletteEditorCommand(); PaletteEditorCommand();
protected: protected:
bool onEnabled(Context* context) override;
void onLoadParams(const Params& params) override; void onLoadParams(const Params& params) override;
bool onChecked(Context* context) override; bool onChecked(Context* context) override;
void onExecute(Context* context) override; void onExecute(Context* context) override;
@ -34,14 +36,18 @@ private:
bool m_background; bool m_background;
}; };
PaletteEditorCommand::PaletteEditorCommand() PaletteEditorCommand::PaletteEditorCommand() : Command(CommandId::PaletteEditor())
: Command(CommandId::PaletteEditor(), CmdRecordableFlag)
{ {
m_edit = true; m_edit = true;
m_popup = false; m_popup = false;
m_background = false; m_background = false;
} }
bool PaletteEditorCommand::onEnabled(Context* context)
{
return context->isUIAvailable();
}
void PaletteEditorCommand::onLoadParams(const Params& params) void PaletteEditorCommand::onLoadParams(const Params& params)
{ {
m_edit = (params.empty() || params.get("edit") == "switch" || m_edit = (params.empty() || params.get("edit") == "switch" ||

View File

@ -15,7 +15,6 @@
#include "app/context_access.h" #include "app/context_access.h"
#include "app/tx.h" #include "app/tx.h"
#include "doc/palette.h" #include "doc/palette.h"
#include "doc/sprite.h"
#include "palette_size.xml.h" #include "palette_size.xml.h"
@ -33,17 +32,21 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
private: private:
int m_size; int m_size = 0;
bool m_ui = true;
}; };
PaletteSizeCommand::PaletteSizeCommand() : Command(CommandId::PaletteSize(), CmdRecordableFlag) PaletteSizeCommand::PaletteSizeCommand() : Command(CommandId::PaletteSize())
{ {
m_size = 0;
} }
void PaletteSizeCommand::onLoadParams(const Params& params) void PaletteSizeCommand::onLoadParams(const Params& params)
{ {
m_size = params.get_as<int>("size"); m_size = params.get_as<int>("size");
if (params.has_param("ui"))
m_ui = params.get_as<bool>("ui");
else
m_ui = true;
} }
bool PaletteSizeCommand::onEnabled(Context* context) bool PaletteSizeCommand::onEnabled(Context* context)
@ -59,7 +62,7 @@ void PaletteSizeCommand::onExecute(Context* context)
Palette palette(*reader.palette()); Palette palette(*reader.palette());
int ncolors = (m_size != 0 ? m_size : palette.size()); int ncolors = (m_size != 0 ? m_size : palette.size());
if (m_size == 0 && context->isUIAvailable()) { if (m_size == 0 && m_ui && context->isUIAvailable()) {
app::gen::PaletteSize window; app::gen::PaletteSize window;
window.colors()->setTextf("%d", ncolors); window.colors()->setTextf("%d", ncolors);
window.openWindowInForeground(); window.openWindowInForeground();

View File

@ -31,7 +31,7 @@ private:
std::unique_ptr<gfx::Point> m_position; std::unique_ptr<gfx::Point> m_position;
}; };
PasteCommand::PasteCommand() : Command(CommandId::Paste(), CmdUIOnlyFlag) PasteCommand::PasteCommand() : Command(CommandId::Paste())
{ {
} }

View File

@ -1,5 +1,5 @@
// Aseprite // Aseprite
// Copyright (C) 2019-2024 Igara Studio S.A. // Copyright (C) 2019-2025 Igara Studio S.A.
// Copyright (C) 2001-2018 David Capello // Copyright (C) 2001-2018 David Capello
// //
// This program is distributed under the terms of // This program is distributed under the terms of
@ -10,21 +10,27 @@
#endif #endif
#include "app/app.h" #include "app/app.h"
#include "app/cmd/copy_region.h"
#include "app/cmd/patch_cel.h"
#include "app/color_utils.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/commands/commands.h"
#include "app/commands/new_params.h"
#include "app/console.h" #include "app/console.h"
#include "app/context.h" #include "app/context.h"
#include "app/context_access.h"
#include "app/pref/preferences.h" #include "app/pref/preferences.h"
#include "app/ui/drop_down_button.h" #include "app/site.h"
#include "app/tx.h"
#include "app/ui/editor/editor.h" #include "app/ui/editor/editor.h"
#include "app/ui/timeline/timeline.h" #include "app/ui/timeline/timeline.h"
#include "app/util/render_text.h" #include "app/util/render_text.h"
#include "base/fs.h"
#include "base/string.h"
#include "doc/image.h" #include "doc/image.h"
#include "doc/image_ref.h" #include "doc/image_ref.h"
#include "render/dithering.h" #include "render/dithering.h"
#include "render/ordered_dither.h"
#include "render/quantization.h" #include "render/quantization.h"
#include "render/rasterize.h"
#include "render/render.h"
#include "ui/manager.h" #include "ui/manager.h"
#include "paste_text.xml.h" #include "paste_text.xml.h"
@ -33,7 +39,17 @@ namespace app {
static std::string last_text_used; static std::string last_text_used;
class PasteTextCommand : public Command { struct PasteTextParams : public NewParams {
Param<bool> ui{ this, true, "ui" };
Param<app::Color> color{ this, app::Color::fromMask(), "color" };
Param<std::string> text{ this, "", "text" };
Param<std::string> fontName{ this, "Aseprite", "fontName" };
Param<double> fontSize{ this, 6, "fontSize" };
Param<int> x{ this, 0, "x" };
Param<int> y{ this, 0, "y" };
};
class PasteTextCommand : public CommandWithNewParams<PasteTextParams> {
public: public:
PasteTextCommand(); PasteTextCommand();
@ -42,7 +58,7 @@ protected:
void onExecute(Context* ctx) override; void onExecute(Context* ctx) override;
}; };
PasteTextCommand::PasteTextCommand() : Command(CommandId::PasteText(), CmdUIOnlyFlag) PasteTextCommand::PasteTextCommand() : CommandWithNewParams(CommandId::PasteText())
{ {
} }
@ -65,55 +81,104 @@ public:
void PasteTextCommand::onExecute(Context* ctx) void PasteTextCommand::onExecute(Context* ctx)
{ {
auto editor = Editor::activeEditor(); const bool ui = params().ui() && ctx->isUIAvailable();
if (editor == nullptr)
return;
Preferences& pref = Preferences::instance();
FontInfo fontInfo = FontInfo::getFromPreferences(); FontInfo fontInfo = FontInfo::getFromPreferences();
PasteTextWindow window(fontInfo, pref.colorBar.fgColor()); Preferences& pref = Preferences::instance();
window.userText()->setText(last_text_used); std::string text;
app::Color color;
ui::Paint paint;
window.openWindowInForeground(); if (ui) {
if (window.closer() != window.ok()) PasteTextWindow window(fontInfo, pref.colorBar.fgColor());
return;
last_text_used = window.userText()->text(); window.userText()->setText(params().text().empty() ? last_text_used : params().text());
fontInfo = window.fontInfo(); window.openWindowInForeground();
fontInfo.updatePreferences(); if (window.closer() != window.ok())
return;
text = window.userText()->text();
last_text_used = text;
color = window.fontColor()->getColor();
paint = window.fontFace()->paint();
fontInfo = window.fontInfo();
fontInfo.updatePreferences();
}
else {
text = params().text();
color = params().color.isSet() ? params().color() : pref.colorBar.fgColor();
FontInfo info(FontInfo::Type::Unknown, params().fontName(), params().fontSize());
fontInfo = info;
}
try { try {
std::string text = window.userText()->text(); paint.color(color_utils::color_for_ui(color));
app::Color color = window.fontColor()->getColor();
doc::ImageRef image = render_text( doc::ImageRef image = render_text(fontInfo, text, paint);
fontInfo, if (!image)
text, return;
gfx::rgba(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()));
if (image) {
Sprite* sprite = editor->sprite();
if (image->pixelFormat() != sprite->pixelFormat()) {
RgbMap* rgbmap = sprite->rgbMap(editor->frame());
image.reset(render::convert_pixel_format(image.get(),
NULL,
sprite->pixelFormat(),
render::Dithering(),
rgbmap,
sprite->palette(editor->frame()),
false,
sprite->transparentColor()));
}
// TODO we don't support pasting text in multiple cels at the auto site = ctx->activeSite();
// moment, so we clear the range here (same as in Sprite* sprite = site.sprite();
// clipboard::paste()) if (image->pixelFormat() != sprite->pixelFormat()) {
if (auto timeline = App::instance()->timeline()) RgbMap* rgbmap = sprite->rgbMap(site.frame());
timeline->clearAndInvalidateRange(); image.reset(render::convert_pixel_format(image.get(),
NULL,
editor->pasteImage(image.get()); sprite->pixelFormat(),
render::Dithering(),
rgbmap,
sprite->palette(site.frame()),
false,
sprite->transparentColor()));
} }
// TODO we don't support pasting text in multiple cels at the
// moment, so we clear the range here (same as in
// clipboard::paste())
if (auto timeline = App::instance()->timeline())
timeline->clearAndInvalidateRange();
auto point = sprite->bounds().center() - gfx::Point(image->size().w / 2, image->size().h / 2);
if (params().x.isSet())
point.x = params().x();
if (params().y.isSet())
point.y = params().y();
if (ui) {
// TODO: Do we want to make this selectable result available when not using UI?
Editor::activeEditor()->pasteImage(image.get(), nullptr, &point);
return;
}
ContextWriter writer(ctx);
Tx tx(writer, "Paste Text");
ImageRef finalImage = image;
if (writer.cel()->image()) {
gfx::Rect celRect(point, image->size());
ASSERT(!celRect.isEmpty() && celRect.x >= 0 && celRect.y >= 0);
finalImage.reset(
doc::crop_image(writer.cel()->image(), celRect, writer.cel()->image()->maskColor()));
render::Render render;
render.setNewBlend(pref.experimental.newBlend());
render.setBgOptions(render::BgOptions::MakeTransparent());
render.renderImage(finalImage.get(),
image.get(),
writer.palette(),
0,
0,
255,
doc::BlendMode::NORMAL);
}
tx(new cmd::CopyRegion(writer.cel()->image(),
finalImage.get(),
gfx::Region(finalImage->bounds()),
point));
tx.commit();
} }
catch (const std::exception& ex) { catch (const std::exception& ex) {
Console::showException(ex); Console::showException(ex);

View File

@ -10,8 +10,6 @@
#include "app/app.h" #include "app/app.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/commands/params.h"
#include "app/context.h"
#include "app/pref/preferences.h" #include "app/pref/preferences.h"
#include "app/tools/freehand_algorithm.h" #include "app/tools/freehand_algorithm.h"
#include "app/tools/tool.h" #include "app/tools/tool.h"
@ -28,8 +26,7 @@ protected:
void onExecute(Context* context) override; void onExecute(Context* context) override;
}; };
PixelPerfectModeCommand::PixelPerfectModeCommand() PixelPerfectModeCommand::PixelPerfectModeCommand() : Command(CommandId::PixelPerfectMode())
: Command(CommandId::PixelPerfectMode(), CmdUIOnlyFlag)
{ {
} }

Some files were not shown because too many files have changed in this diff Show More