Commit Graph

67 Commits

Author SHA1 Message Date
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
David Capello
ac8387a408 Move some ui::Combobox member functions to the header file 2015-05-04 10:41:05 -03:00
David Capello
21a57ff793 Add "data recovery period" option 2015-04-09 07:46:55 -03:00
David Capello
ad856b2a55 Use std:: when necessary, and std::numeric_limits instead of INT_MAX 2015-03-04 21:35:11 -03:00
David Capello
b7f69186bb Add Widget::removeAllChildren() member function 2015-03-04 16:38:01 -03:00
David Capello
ca9df1a05e Rename ui::jguiscale() to ui::guiscale()
* Change Theme::guiscale member to Theme::m_guiscale
2014-11-25 22:33:45 -03:00
David Capello
bde2ddbe83 Remove ji_screen and ji_clock global variables
- Replace JI_SCREEN_W/H with ui::display_w/h()
- Remove GfxMode class
- Move drawing code of ColorCurveEditor widget to onPaint()
- Rename ji_clock -> ui::clock()
2014-08-31 14:17:49 -03:00
David Capello
6824570c4b Remove base/override.h (use override keyword directly) 2014-08-14 23:07:47 -03:00
David Capello
dfaf097b88 Rename base/compiler_specific.h to base/override.h 2014-08-09 08:08:20 -03:00
David Capello
dbad153698 Add she::Font class (wrapper of Allegro FONT)
This is an huge refactor to avoid handling Allegro FONT directly. Some
changes:
* Add she::System::defaultDisplay/Font, createRgbaSurface, loadSurface,
  and loadRgbaSurface.
* Rename she::CreateSystem/Instance to she::create_system/instance.
* Remove ui/font.cpp and move ui/fontbmp.cpp to she library.
* ui::IButtonIcon uses she::Surface instead of BITMAP.
* Rename she::LockedSurface::drawAlphaSurface -> drawRgbaSurface
* Rename ui::SetDisplay -> set_display
* Rename _ji_font_text_len -> ui::Graphics::measureUIStringLength
2014-06-22 18:53:14 -03:00
David Capello
ec61c6b972 Add support for horizontal mouse wheel and scroll bar notifications (better support for trackpads)
WM_HSCROLL/WM_VSCROLL messages are used by some trackpads drivers to
notify about horizontal/vertical pan gestures.
2014-04-28 22:02:56 -03:00
David Capello
3c4bbbe30c Replace jwidget_set_min/max_size() with Width::setMin/MaxSize() 2014-04-21 22:15:29 -03:00
David Capello
b33357ed46 Remove base::string (std::string is good enough for utf8 strings) 2014-04-20 19:53:27 -03:00
David Capello
dd2ce20e25 Win32: Add support to convert mouse messages (WM_) to ui::Messages (using she::Events)
On Windows, instead of polling Allegro mouse position/buttons we can use
the mouse messages (WM_*) directly to generate she::Events. Those events
are received by the ui::Manager and converted to ui::Messages.
Maybe this is a possible fix for issue #133 (Wacom tablets don't work
properly).

Changes:
- Don't use jmouse_z() directly (new ui::MouseMessage::wheelDelta() member)
- Add ui::_internal_set_mouse_position() to change the jmouse_x/y(0)
  from the new mouse position received in she::Events. The same for
  ui::_internal_set_mouse_buttons().
- Modify the ui::Manager to generate mouse events in any case: using old
  Allegro 4 polling method, or from she::Events.
2014-04-17 22:23:12 -03:00
David Capello
ed5a2d9570 Replace jwidget_noborders() with Widget::noBorderNoChildSpacing() 2014-04-17 15:44:33 -03:00
David Capello
78ce233756 Fix header of files distributed under the terms of the MIT license 2014-03-29 20:08:05 -03:00
David Capello
6ed35b733c FileSelector: fix combobox behavior as now ComboBox::onChange() event is generated when the combobox is open 2014-03-29 18:42:17 -03:00
David Capello
7253fa59c5 Fix combobox widget: fire Change signal when the combobox is selected with the keyboard 2014-03-29 17:17:06 -03:00
David Capello
04f3c522ba Replace jwidget_get_text_length/height with Widget::getTextWidth/Height
Renamed Widget::getTextSize to Widget::getTextLength as now getTextSize
returns a gfx::Size() (not the strlen() of the text)
2014-03-21 19:45:35 -03:00
David Capello
f107dd3cbc Fix issue 352: Context Bar Eats Hotkey Input
Avoid capturing keyboard focus in context bar widgets.
2014-03-08 20:31:55 -03:00
David Capello
d72a7a4dee Fix compilations errors on gcc 2014-02-24 08:30:43 -03:00
David Capello
3cbf3e122f Now you can press a mouse button in a ComboBoxEntry and drag the mouse to the ComboBoxListBox (issue 339) 2014-02-08 20:09:42 -03:00
David Capello
ad0b28bd63 Change Window() ctor to avoid ambiguity (DesktopWindow, WithoutTitleBar, or WithTitleBar)
In this way we know at the moment of the creation of the window if it
will need the close button.

Issue #280.
https://github.com/aseprite/aseprite/pull/6
2013-11-23 17:47:57 -03:00