Commit Graph

89 Commits

Author SHA1 Message Date
David Capello b2e4f78b69 clang-format all files 2024-12-16 10:10:34 -03:00
David Capello 39d1fb56d4 Remove ui::Event& args from ui::Button::Click signal
This is to simplify code and to match ui::MenuItem::Click and
ui::Button::Click signals (so then we can write some generic code
using Button::Click or MenuItem::Click).
2023-01-12 11:00:16 -03:00
David Capello d4cefb8ba6 Fix crash double clicking a Dialog:canvas()
There were missing some setRecipient() when some messages are
converted to other kind of message (e.g. DoubleClick -> MouseDown)
2022-12-15 19:29:28 -03:00
David Capello caf475b2dc Merge branch 'main' into beta 2022-06-15 13:44:34 -03:00
David Capello b7d5d4a2c9 Editable resize factor in File > Export (fix #3007)
Related to #3008
2022-06-15 12:25:43 -03:00
David Capello 8f44b521b6 Merge branch 'main' into beta 2022-06-10 10:31:13 -03:00
David Capello 71d885d2a0 Replace base::clamp -> std::clamp as now we use C++17 2022-06-09 19:05:48 -03:00
David Capello 77771b703b Merge branch 'main' into beta 2022-05-30 20:41:35 -03:00
David Capello 251323a4d5 Add new MouseMessage() ctor to copy full information of the original message
This is mainly to keep the pressure information when a MouseMessage is
copied, and any future property which could be added in MouseMessage.
2022-05-30 18:44:12 -03:00
David Capello 684d06ede8 Merge branch 'main' into beta 2022-05-23 18:04:55 -03:00
David Capello 1366a6948c Fix performance issues adding/deleting widgets (related to #3281) 2022-05-20 11:03:12 -03:00
David Capello ecbd13caf3 Use transparent windows for tooltips & popups like toolbar (fix #2764) 2021-07-30 16:14:38 -03:00
David Capello f5b452ae94 Fix crash clicking the bottom of the combobox
Bug report: https://community.aseprite.org/t/9254
2021-05-28 15:44:27 -03:00
David Capello d75bf49852 Fix crash in certain scenarios with comboboxes
We have to remove the combobox filter to avoid crashes in case that we
receive a kMouseDownMessage when the native window is already
destroyed.
2021-05-26 08:26:39 -03:00
David Capello 208178c9af Fix redrawing invalid regions when opening dithering matrices combobox for Gradient tool
It was more visible in this case, but probably it's a general problem
for all auto-remap windows in the code. We should remove this flag in
a near future.
2021-05-22 11:58:59 -03:00
David Capello 383adf2e0c Fix clicking a combobox to close the popup in multiple windows 2021-05-22 11:40:19 -03:00
David Capello 597a2cc831 Redir first kMouseMoveMessage with correct mouse position from combobox -> listbox 2021-04-20 19:42:41 -03:00
David Capello 0d7fea3111 Fix several problems w/multiple screens
* Limit dialogs to the current screen workarea correctly
* Fixed several issues on macOS
2021-04-20 17:55:49 -03:00
David Capello 0c932779fb Fix several issues with ui::ComboBox
* With multiple windows now a ComboBox popup has its own window (and
  the size of the popup is not limited to the parent display anymore)
* Clicking in the parent ui::Window that is below the ComboBox listbox
  in non-multiple windows mode doesn't start the resizing/moving loop
  of the window (the click now is sent to the listbox correctly)
* Limit the position to the workarea (in multiple-windows) and to the
  display (in non-multiple windows)
2021-04-20 12:13:19 -03:00
David Capello bcd69495ce Fix several issues locating windows with multiple UI windows
We've refactored the code to support locating windows (and popups
windows + hot regions) correctly in both modes: with one ui::Display
and with multiple ui::Displays.

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

* Replaced ui::display_w/h() functions with ui::Display::size()
  and ui::get_desktop_size()
* The ui::Manager contains the main ui::Display, and in the future an
  ui::Window will have its own ui::Display
2021-02-18 12:34:42 -03:00
David Capello 8b1b624320 Replace NULL to nullptr in ui library 2020-04-08 17:48:06 -03:00
David Capello 09ea577a08 Match ui::MouseButton values to os::Event::MouseButton 2020-03-27 15:40:43 -03:00
David Capello 34ec123ecc Remove MIN/MAX/MID macros from ui library 2019-12-20 15:08:34 -03:00
David Capello 536a4c5d3a Simplify Export Sprite Sheet with preview + changes to the UI
These changes include an option to split layers and tags
by rows (fix #1118)
2019-10-18 17:00:35 -03:00
David Capello e8716cbb6e Improve context bar for slice tool (combobox of slices + action buttons) 2019-05-07 10:28:37 -03:00
David Capello 105d389fdc Remove list of recipients from ui::Message 2018-12-13 10:11:56 -03:00
David Capello aea8e9cd83 Fix combobox size hint when using some user themes
From: https://community.aseprite.org/t/2276
2018-11-26 16:46:02 -03:00
David Capello 5cb2d984f0 Rename she -> os 2018-08-09 12:58:43 -03:00
David Capello 432eedcb97 Support changing theme and UI scaling w/o restart (fix #471) 2017-08-15 10:39:06 -03:00
David Capello 14ba0ab411 Add addition/subtract/divide blending modes
Changes:
* Added SeparatorInView() to add separators inside a ListBox or ComboBox.
* Added BlendModeItem() to represent each item in the blending modes
  ComboBox.
* Now a ComboBox can contain any kind of widgets as children (not just
  ListItem). This is required to add separators in the blending modes
  ComboBox.

Feature request:
https://community.aseprite.org/t/additive-blending-feature/121
2017-07-24 15:25:13 -03:00
David Capello 523b6a0a51 Show a DitheringSelector item in the combobox when it's closed
In this way we can show listbox/custom items in the combobox when we
select an item instead of showing text-only (the ui::Entry).
2017-05-23 13:41:11 -03:00
David Capello bcdf598392 Add widget to choose dithering algorithm + matrix 2017-05-22 15:44:08 -03:00
David Capello f08757d9d2 Remove ui::Widget::textLength() member function 2017-02-21 10:48:25 -03:00
David Capello bb4faca1d1 New Style class in "ui" layer to paint widgets (only button at this moment)
This new ui::Style should finally replace the old app::skin::SkinStyle
class. At this moment both implementations are working to avoid an
huge refactor in just one commit.

- Added new ui::Style property in ui::Widget.
- Removed old code to set the button "bevel" (removed
  app::setup_bevels() functions).
- Removed setup_look() function and Left/RightButtonLooks.
- Removed check_button_new() function.
- Removed ui::Theme::paintButton/ComboBoxButton() functions.
2017-02-13 18:34:23 -03:00
David Capello a58cbfbc1c Enable eraser support for Wacom tablets on Skia/Win back-end
Related to #610
2016-04-20 22:33:10 -03:00
David Capello 65dd457847 Reduce size hint for ui::ComboBox 2015-12-22 17:14:26 -03:00
David Capello 1aaeacc460 Refactor several "getNoun()" getters to "noun()"
This is a work-in-progress to create a consistent API and finally
separate the whole Aseprite base/gfx/ui libs into a reusable C++ library.

Classes:
app::IFileItem, app::AppMenuItem, app::skin::SkinPart,
gfx::Rect, gfx::Border, she::FileDialog,
ui::IButtonIcon, ui::Graphics, ui::Overlay, ui::Widget,
ui::ScrollableViewDelegate, and UI events
2015-12-04 14:39:04 -03:00
David Capello cdd955441a Rename PreferredSize -> SizeHint 2015-12-03 21:50:05 -03:00
David Capello bd1a1ffafb Add support to transport key modifiers from she events to UI messages
It’s better if we use the original key modifiers from she::Events (given
by Cocoa or Win32 APIs) instead of asking for the current state of
the modifier when the ui::Message is created (which can be different
from the original value).

This commit adds support to transport the modifiers, but it is not
using the original key modifiers yet.
2015-10-14 16:42:49 -03:00
David Capello 746f41ff5b Rename ui::ListBox::ChangeSelectedItem to ui::ListBox::Change 2015-08-25 13:56:21 -03:00
David Capello 46309fe68d Focus Entry field when a Combobox receives the focus for first time
This is a partial revert of a0c2237839 patch.
2015-08-24 16:45:35 -03:00
David Capello a0c2237839 Fix hanging when switching focus between different editable comboboxes
This bug was fixed before with d1799c037a but
then returned with 549404c216
2015-08-24 11:37:35 -03:00
David Capello 847fc58a01 Fix UI problem navigating FileSelector using autocomplete and keyboard
With this fix, when the list of possible completions for a filename
is regenerated, we deselect the previously selected item. So the new
list appears without any item selected by default.
2015-08-12 15:17:53 -03:00
David Capello a2538628c7 Convert ui::Widget::border_width/child_spacing to private fields 2015-06-23 19:20:49 -03:00
David Capello 21ca87862c Add layer blending modes (fix #318)
- Added doc::BlendMode enum and doc::BlendFunc type
- Renamed LayerImage::getBlendMode() -> blendMode()
- BLEND_MODE_COPY is BlendMode::SRC now
- BLEND_MODE_NORMAL is BlendMode::NORMAL now
- Added app::cmd::SetLayerBlendMode
2015-06-13 21:29:16 -03:00
David Capello 4e911b7eea Esc key close the combobox popup 2015-05-06 16:27:45 -03:00
David Capello a30f374bd5 Don't popup an empty listbox if the combobox is editable and has open-on-click style 2015-05-06 13:07:54 -03:00
David Capello 139e0cb8f5 Fix issues autocompleting the file name field in FileSelector
Now the file name field is an editable ComboBox, so we don't
autocomplete/modify the text inside the entry box.

With this commit we modified the editable ComboBox behavior too:
* When the ListBox is shown, the focus remain in the Entry field (now
  the ListBox cannot have the focus when the ComboBox is editable).
* When Up/down keys are received by the Entry, they are given to the
  ListBox to change the selected item. But the focus returns to the
  Entry anyway.
2015-05-04 14:58:24 -03:00