Commit Graph

648 Commits

Author SHA1 Message Date
David Capello
66e9cee3e6 Fix crash on UI tests
Generating paint messages without a she::System available.
2017-01-06 16:55:21 -03:00
David Capello
4ac63503c0 Minor change in ui/accelerator.cpp 2017-01-06 14:19:06 -03:00
David Capello
eb0f046dc7 Fix general UI delay/flickers redrawing elements
This is an old bug that makes the UI looks as "partially painted." We
have to process all logic messages first, and then generate paint
messages so we paint the latest UI state (instead of a intermediate
UI state).
2017-01-02 15:38:20 -03:00
David Capello
3d43b96517 Merge branch 'master' into beta 2016-12-29 11:24:20 -03:00
David Capello
ea71455f81 Fix ZoomEntry slider range
After f8874f4f7b, we fixed the zoom text
entry but we broke the zoom slider. We weren't able to select zoom
factors with the slider correctly (as the scale from 0 to 6400 was too
big). Now we revert the change and make the maximum text length in entry
bigger so the user can enter zoom levels like 6400 in the text entry and
use the zoom slider.
2016-12-29 10:22:39 -03:00
David Capello
0014673e41 Merge branch 'master' into beta 2016-12-22 10:46:37 -03:00
David Capello
809a90ba3b Fix crash using focus-movement keys in strange UI state
There were some crash reports in these days on the focus movement
code. It looks like we could arrive into an invalid/strange UI state
double-clicking palette buttons and showing menus two consecutive
times. After that, pressing Tab key would crash the focus-movement
logic.
2016-12-20 16:59:07 -03:00
David Capello
f8874f4f7b Fix zoom entry so we can insert numbers with 4 digits 2016-12-16 14:53:26 -03:00
David Capello
dc19c4b589 Merge branch 'master' into beta 2016-12-07 12:14:28 -03:00
David Capello
315584d819 Close toolbar popup when the document is closed 2016-12-07 11:12:19 -03:00
David Capello
fec4e27d8e Fix widget border in drawTextBox() 2016-12-06 21:29:14 -03:00
David Capello
c1e428544e Add minimal .md browser to show README/LICENSES files
Now we can see markdown files inside Aseprite. This is an initial
support (text only, separators, links only on headers and to external
URLs).

- Added a new docs/LICENSES.md file
- Removed old .txt licenses
2016-12-06 16:03:51 -03:00
David Capello
396f5fb78f Merge branch 'master' into beta 2016-12-02 19:13:08 -03:00
David Capello
42b8d04e46 Fix crash clicking on a non-ListItem widget inside a multiselect ListBox 2016-12-02 18:41:09 -03:00
David Capello
a46a087c51 Handle arrow keys/delete/backspace/etc. correctly on IntEntry (fix #1339) 2016-12-02 16:47:05 -03:00
David Capello
812e75f613 Replace "pin" icon with the regular "close" button
I was contacted several times by people that cannot close these pinned
popups window. The best solution is to do the same that a regular
window: show the close button.
2016-12-01 15:15:16 -03:00
David Capello
f57c298ad6 Merge branch 'master' into beta 2016-11-29 12:15:25 -03:00
David Capello
acdd9c3fed Don't add dead chars if the entry field is full 2016-11-29 11:08:29 -03:00
David Capello
60d89b10ed Fix crash introduced in 701170d85e 2016-11-24 19:59:34 -03:00
David Capello
74248cf33c Cmd+mnemonic on macOS now can press a button 2016-11-24 19:26:52 -03:00
David Capello
701170d85e Fix alt+mnemonic on macOS 2016-11-24 19:26:21 -03:00
David Capello
0d169fed75 Improve ui::drawTextBox() performance 2016-11-22 13:33:01 -03:00
David Capello
0ed0ad287c Fix TextBox drawing when we scroll it 2016-11-22 12:47:46 -03:00
David Capello
5828df1383 Add smooth scroll to ui::TextBox 2016-11-22 12:46:42 -03:00
David Capello
d5d71257fe Remove comment from TextBox::onSizeHint() 2016-11-22 12:46:23 -03:00
David Capello
461d311dff Fix several buffer overflows using base::string_printf() 2016-11-22 11:54:15 -03:00
David Capello
096b26fea6 Fix Space keyboard modifier to scroll the Editor 2016-11-22 10:51:03 -03:00
David Capello
a67589aa05 Fix Ctrl+A/C/V/X on RGB/HSV text fields 2016-11-22 10:34:00 -03:00
David Capello
b6076e6732 Fix "magnet enter" when we are in a ui::Entry
Pressing Enter on a ui::Entry will press "OK" buttons.
2016-11-21 12:28:42 -03:00
David Capello
d444f5b78e Minor change in Manager::processFocusMovementMessage 2016-11-21 10:37:54 -03:00
David Capello
3f1f07807b Add support to cycle RGB/HSV text fields with tab key (fix #1019)
Added a new flag in messages to know if they came from a filter or from
the original chain of recipients. To do this, we've added a new way to
process message filters: instead of pre-adding filters to the list of
message recipients, we process filters in the Manager::pumpQueue()
member function itself. (So the list of "recipients" is not modified.)
2016-11-19 00:57:58 -03:00
David Capello
f054aaa2cc Minor changes in ui::Slider 2016-11-19 00:23:54 -03:00
David Capello
d8bc90696e Rename Manager::isFocusMovementKey -> isFocusMovementMessage 2016-11-18 14:26:00 -03:00
David Capello
0703bf159c Add ui::Manager::processFocusMovementMessage() function 2016-11-18 14:22:14 -03:00
David Capello
6746049e60 Fix 1...6 keys to go to a specific frame on Windows
These keys where captured by the zoom command (gui Manager) first.
This regression was introduced in 00099390da
2016-11-18 13:47:02 -03:00
David Capello
02b9a953ef Avoid creating a System instance in she::instance()
This is necessary for tests that don't need a System but call the
instance() function anyway.
2016-11-18 12:13:10 -03:00
David Capello
5dc8f9c8a0 Move keyboard functions to she::System 2016-11-18 11:15:02 -03:00
David Capello
00099390da Fix several keyboard issues deadling with special characters/dead keys
This change adds support to write text with dead keys, and assign
keyboard shortcuts to special key combinations with Unicode characters
on macOS and Windows.

Fix #1083, close #796
2016-11-17 18:07:00 -03:00
David Capello
1b736aef85 Improve UX when opening file sequences
* Now we can select the specific files that are part of the sequence
* New checkbox do the same for all dropped files (fix #1284)
2016-11-15 18:11:47 -03:00
David Capello
7f17400178 Minor changes in ui::Alert to simplify its code 2016-11-15 18:06:27 -03:00
David Capello
64af97131d Support smooth scroll in ListBox 2016-11-15 17:31:56 -03:00
David Capello
2216db2d2c Send mouse events when a new window is displayed (fix #1221)
In this way if a new widget is displayed it will get the mouse-enter and
set-cursor messages correctly.
2016-11-14 17:23:09 -03:00
David Capello
88455ebc4b Fix compilation warnings when REPORT_EVENTS is defined 2016-11-14 17:21:37 -03:00
David Capello
4c2a283bd7 Double-click on a preset palette loads it 2016-11-14 15:55:21 -03:00
David Capello
b95326435c Remove an always-true if statement 2016-11-14 15:53:36 -03:00
David Capello
5c3f75c64b Merge branch 'master' into beta 2016-11-07 18:17:42 -03:00
David Capello
ce6c85996e Update laf library (base/path is gone, use base/fs) 2016-11-01 19:14:05 -03:00
David Capello
54e60f058f Merge branch 'master' into beta 2016-11-01 14:09:02 -03:00
David Capello
c2103df444 Move base module to laf library 2016-11-01 12:47:48 -03:00
David Capello
c60e0b915c Merge branch 'master' into beta 2016-10-27 13:00:57 -03:00
David Capello
c789e4a872 Don't crash if the user-defined theme is gone (fix #1283) 2016-10-27 11:03:27 -03:00
David Capello
3f052cfe2e Return nullptr instead of assert in Widget::font() 2016-10-17 10:49:37 -03:00
David Capello
3e9e49caf9 Allow to save specific layers/frames in Save Copy As (fix #1080) 2016-09-17 01:01:28 -03:00
David Capello
edf1cfd7b0 Add possibility to move the Timeline at the left/right side (fix #1169) 2016-09-15 11:07:36 -03:00
David Capello
5d0d609a3f Fix ui::Alert buttons center alignment
This bug was introduced in 4a6d6951e3
2016-09-14 15:47:27 -03:00
David Capello
6377b550e3 Replace base::Signal/Observable* with obs::signal/observable
We can use the obs library directly for signal/slots and observable
objects.
2016-09-13 15:02:00 -03:00
David Capello
311d27078f Check min/max widgets size in ui::Box layout algorithm 2016-09-09 20:21:33 -03:00
David Capello
4a6d6951e3 Add support to reduce all children when a ui::Grid is too small 2016-09-09 20:20:44 -03:00
David Capello
75894073d4 Make fg/bg color selector dialogs resizable (fix #1250) 2016-09-08 19:48:29 -03:00
David Capello
4119962ee6 Remove Widget::onDisable/onDeselect() member functions
Replaced with an argument in onEnable/onSelect().
2016-09-08 15:53:10 -03:00
David Capello
bebbd71d31 Add simple crosshair using native mouse cursors (fix #1236) 2016-08-31 13:24:03 -03:00
David Capello
f1f6d0745d Fix crash in UI tests 2016-08-30 18:20:28 -03:00
David Capello
f1c9e77e43 Add mouse cursor scale option 2016-08-30 17:27:19 -03:00
David Capello
162cee2870 Use custom native mouse cursor on Skia/OSX port 2016-08-30 16:12:11 -03:00
David Capello
507e0f152b Use custom native cursors on Skia/Win port 2016-08-30 13:50:45 -03:00
David Capello
5ecc356a41 Replace GPL license with the new EULA 2016-08-29 13:08:21 -03:00
David Capello
03be4aa23d Convert "bool" members in ui::Widget to flags 2016-08-29 12:23:23 -03:00
David Capello
f5c43267fc Add support to right-click with Ctrl+left click on OS X (fix #438)
This is only for Tabs and Entry widgets at the moment.
2016-06-29 18:52:09 -03:00
David Capello
a9cea5ab42 Update mouse cursor immediately after we change it to native mouse cursor 2016-06-14 09:36:50 -03:00
David Capello
8b242bdf06 Fix memory leak loading images for a ImageView widget 2016-05-11 12:58:27 -03:00
David Capello
60fd6072e9 ui library now depends on clip 2016-04-29 14:19:00 -03:00
David Capello
924c2ac86a Use clip library to copy/paste text
In this way we can remove all the code related to handle clipboard text
from she and ui libraries.
2016-04-28 23:26:20 -03:00
David Capello
7b4511a5df Unify she::InputDevice and ui::PointerType 2016-04-20 22:49:03 -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
8028cf64db Merge branch 'unicode-text'
# Conflicts:
#	third_party/libpng
#	third_party/zlib
2016-04-04 10:26:57 -03:00
David Capello
0605166cc6 Move clock/tick from "she" to "base" library and switch to uint64_t type 2016-03-29 16:19:23 -03:00
David Capello
69a1161f69 Fix Entry bugs handling the text caret
Added more checks and improve performance in Entry::setCaretPos()
2016-03-14 12:39:45 -03:00
David Capello
29f6db6f35 Widget::textLength() returns the number of (Unicode) characters in the text field 2016-03-14 12:38:11 -03:00
David Capello
0abe01c5f4 Merge she::LockedSurface/NonDisposableSurface with she::Surface 2016-03-09 11:00:17 -03:00
David Capello
285deb603e Define _CRT_SECURE_NO_WARNINGS on sub-libraries that need it 2016-03-03 19:22:52 -03:00
David Capello
8c9d9eb84c Replace NULL with nullptr on files that don't include base/base.h 2016-03-03 19:20:57 -03:00
David Capello
4f6a7a7742 Include base/debug.h on files that use ASSERT or TRACE 2016-03-03 19:17:07 -03:00
David Capello
cb86fb4c8f Rename ui::winKeyName to ui::kWinKeyName 2016-03-02 10:31:39 -03:00
Gabriel Rauter
cb92b781eb Change Windows Modifier Name to Win for Windows and Super for Linux/BSD 2016-03-01 23:52:36 +01:00
Gabriel Rauter
e22332144a Add Windows Key as possible Modifier in Keyboard Shortcuts on Windows and Linux as a step to fix #796 2016-03-01 20:14:32 +01:00
David Capello
78da4a40a1 Avoid warning on Graphics::drawUIString() 2016-02-29 22:21:21 -03:00
David Capello
91b8df9d4d Fix mouse lag on Linux (fix #957)
As now we can generate several mouse events in
one generateMessagesFromSheEvents(), thanks to
1588e834c3, we can process
all mouse events from Allegro 4.
2016-02-29 22:21:07 -03:00
David Capello
5798c896e2 Don't generate a kSetCursorMessage when the mouse is outside the window
Should finally fix #948
2016-02-29 22:18:36 -03:00
David Capello
ca160d0647 Remove unnecessary iterations on splitter children in onSave/LoadLayout 2016-02-26 15:08:58 -03:00
David Capello
9521ed3079 Merge branch 'master' 2016-02-18 14:15:04 -03:00
David Capello
15e10ad9f6 Add touch magnify event to support OS X trackpad gesture 2016-02-18 13:58:45 -03:00
David Capello
802b8a0a10 Fix performance problem when we change color sliders with mouse movement 2016-02-17 18:32:34 -03:00
David Capello
1588e834c3 Fix artifacts when scrolling on widgets with sub-children (fix #963)
This bug was introduced in b0650f6afe
To fix this issue we've to remove kPaintMessages from the message queue
for widgets that were moved. Those pending paint messages aren't valid
anymore because the widget was invalidated again.
2016-02-15 15:54:54 -03:00
David Capello
e843e7a9ba Do not overlap the menubar with a menubox 2016-02-07 14:41:43 -03:00
David Capello
b0650f6afe Generalize View::setViewScroll() to blit valid/scrollable region automatically
With this change we are removing specific code to scroll the Editor widget.
Now if we use Editor::setEditorScroll() to scroll it should work as
View::setViewScroll(). In this way we remove the ugly "blitValidRegion"
parameter from setEditorScroll().

Changes:
* Removed Widget::scrollRegion() because each widget must control
  valid/invalid regions after a ui::move_region() in a very specific way
  (see View::setViewScroll() or Window::moveWindow)
* Invalidate the whole widget on Widget::setBoundsQuietly()
* Fixed problems blitting invalid regions/not yet updated/painted: using
  the new ui::Manager::m_invalidRegion.
* Added View::onSetViewScroll() and View::onScrollRegion()
* Added FileListView to avoid moving the thumbnail region when we scroll
2016-01-05 16:37:52 -03:00
David Capello
1260cf12c5 Minor comment changes in widget.h 2016-01-05 16:28:54 -03:00
David Capello
e64cc958ce Minor change/renames in Widget::flushRedraw() 2016-01-04 17:50:21 -03:00
David Capello
3bad2af2f3 Make Widget::offsetWidgets() function public 2016-01-04 17:49:40 -03:00
David Capello
eba8de0306 Fix slow scroll/selection movement with Alleg4 port (fix #929) 2016-01-04 12:15:23 -03:00
David Capello
910612101a Fix slow performance pressing Alt or Ctrl key on Editor in Alleg4/Win port 2015-12-30 17:30:20 -03:00
David Capello
0f28e216ba Fix Manager::pumpQueue() when DEBUG_PAINT_EVENTS is defined 2015-12-30 12:24:26 -03:00
David Capello
199a3db278 Don't scroll invalid areas in Widget::scrollRegion() 2015-12-28 13:37:01 -03:00
David Capello
5074ef2d68 Handle several UI mouse movement events at once if they are in the she layer queue 2015-12-28 13:02:45 -03:00
David Capello
65dd457847 Reduce size hint for ui::ComboBox 2015-12-22 17:14:26 -03:00
David Capello
70127f19e1 Fix closing the whole user data popup when we're selecting the user data color 2015-12-17 16:34:57 -03:00
David Capello
6ec07d5e10 Fix comment for ui::PopupWindow::setHotRegion() member function 2015-12-17 15:46:13 -03:00
David Capello
1f513a1ed5 Restore selected ButtonSet item when we offer the mouse capture
When a ButtonSet triggers an onClick() when a mouse up message is received
(ButtonSet::m_multipleSelection == true), in case the mouse capture is
offered to other ButtonSet, we've to restore the selected item when we
capture the mouse, because we've never generated the onClick() event
in the first place.
2015-12-16 16:55:49 -03:00
David Capello
cff6d1cc65 Rename LinkLabel::getUrl() -> url() 2015-12-15 17:07:29 -03:00
David Capello
a380c9a877 Add possibility to create an empty LinkLabel 2015-12-15 17:07:13 -03:00
David Capello
e422acff1f Fix PopupWindow size hint when it doesn't have a title 2015-12-15 17:06:54 -03:00
David Capello
d8417df35f Add possibility to create empty ui::ListItems 2015-12-15 17:06:05 -03:00
David Capello
e78e9eeb2c Add PopupWindow::setClick/EnterBehavior() member functions 2015-12-11 12:48:11 -03:00
David Capello
50a01879ac Add possibility to create popup windows and tip windows from XML widgets 2015-12-10 16:51:48 -03:00
David Capello
455153d4b9 Change ui::TipWindow public API
Arrow align and target bounds are given as parameters of the new
TipWindow::pointAt() member function. Now TipWindow() contains a
default ctor.
2015-12-10 16:50:16 -03:00
David Capello
d02efbf315 Fix TipWindow background color 2015-12-10 16:46:01 -03:00
David Capello
3066e1b301 Minor format change in ui/textbox.h 2015-12-10 16:44:48 -03:00
David Capello
d467d71fa5 Rename PopupWindow enums 2015-12-05 15:56:32 -03:00
David Capello
e944ce0052 Move Bind, Connection, Signal, Slot, etc. to base namespace 2015-12-04 15:17:42 -03:00
David Capello
06be4f7fa6 Rename ui::Window::getKiller() -> closer() 2015-12-04 14:54:15 -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
78ba213471 Rename ui::Widget::getChildren() -> children()
Extra changes:
* Removed UI_FOREACH_WIDGET(), replaced with range-based for-loops
2015-12-03 19:46:13 -03:00
David Capello
d5e3f3d3e8 Minor format changes 2015-12-03 19:29:50 -03:00
David Capello
771a7ba467 Add search field in keyboard shortcuts dialog (fix #849)
Changes:
* Added "icon_search" part in the skin
* Added app::SearchEntry widget
* Fixed Separator widget to handle a custom background color, because
  now we use Separators inside a ListBox too
* Added Entry::(on)getEntryTextBounds() to specify a customized area
  to show text (as SearchEntry needs space for search and close icons)
2015-11-30 15:08:18 -03:00
David Capello
4b21d8d5f4 Sort listbox items using compare_filenames() to compare numbers correctly (fix #782) 2015-11-18 16:50:49 -03:00
David Capello
62a16d0525 Improve font selection with keyboard in PasteTextCommand 2015-10-19 15:32:44 -03:00
David Capello
02ef2268fe Remove unnecessary filtering of key events in PopupWindow
In this way Tab key (and other focus movement keys) can be used
in PopupWindows. They aren’t propagated to the main window because
a correct filter was added in 883629b563
2015-10-19 15:31:34 -03:00
David Capello
2a09990b16 Make viewport bigger when we load a new font on FontPopup 2015-10-16 18:51:35 -03:00
David Capello
74c2ce83dc Simplify update_mouse_cursor() code 2015-10-14 19:36:46 -03:00
David Capello
0900019b1e Minor change in Widget::scrollRegion() to avoid an extra Region::offset() 2015-10-14 18:41:56 -03:00
David Capello
fe6d2f3db0 Minor change in move_region.cpp 2015-10-14 18:39:07 -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
9e90061e37 Fix first native cursor hiding on Skia backend 2015-10-14 12:44:37 -03:00
David Capello
2fe612fd00 Add precise trackpad support on Skia/OSX port 2015-10-14 09:27:20 -03:00
David Capello
615e369cc4 Fix closing multiple tabs with middle-click without moving mouse (fix #826) 2015-10-13 12:13:13 -03:00
David Capello
5d9b7475e0 Add missing #include files 2015-10-02 10:54:15 -03:00
David Capello
a06e01ff7e Rename ui::Entry::EntryChange to ui::Entry::Change 2015-09-22 16:22:47 -03:00
David Capello
629bea41a8 Fix scroll in Preview window (fix #811)
Regression bug introduced in 9772f99303
2015-09-18 16:35:29 -03:00
David Capello
9772f99303 Add scroll bars to Timeline widget (fix #732)
Changes:
- Added ui::ScrollableViewDelegate so ui::ScrollBar can be child of
  a non-ui::View widget.
- Added a generic ui::setup_scrollbars() utility to locate
  horizontal/vertical scrollbars depending on the scrollable area and
  the available viewport area.
- Replaced Timeline::m_scroll_x/y ints with m_hbar/m_vbar widgets.
- Added transparent scrollbar look & feel.
- Added a "hover" state to mini-scrollbars used in sprite editors.
2015-09-17 15:19:47 -03:00
David Capello
182a094f2b Add some checks to Menu::closeAll() to avoid accessing null pointers
These are not reproducible situations, but we've received a crash
report that indicates that these pointers can be null if some
unknown scenario.
2015-09-16 10:52:02 -03:00
David Capello
e8abba1b93 Refactor some UI code
- Moved ui::GuiSystem from ui/base.h to ui/system.h as ui::UISystem
- Moved some internals to ui::details namespace
- Fix crash of UI tests when ~Manager is called
- Removed ui::init/exit_system() functions
2015-09-01 10:18:47 -03:00
David Capello
110aa74dae Add required #include "ui/timer.h" in ui/tooltips.h 2015-08-28 14:45:56 -03:00
David Capello
db4817e3ef Add an extra grid test with four columns 2015-08-28 13:11:00 -03:00
David Capello
530edb4ae3 Add Widget() constructor to create default widgets 2015-08-28 13:10:42 -03:00
David Capello
a79c9479b7 Replace dynamic_cast with static_cast in Widget::getRoot() 2015-08-25 14:40:53 -03:00
David Capello
746f41ff5b Rename ui::ListBox::ChangeSelectedItem to ui::ListBox::Change 2015-08-25 13:56:21 -03:00
David Capello
0645a66521 Fix pressing multiple KeyAction modifiers at the same time (fix #778) 2015-08-25 13:29:19 -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
04f07af173 Fix problem leaving dirty areas in the screen when we move a window 2015-08-24 11:56:40 -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
549404c216 Fix tooltips visibility (fix #770)
TooltipManager uses filters to intercept a kMouseEnterMessage, if we
remove this kind of message for the TooltipManager itself (in sendMessage),
we never get that message so we never show the tooltip.

This problem was introduced in d1799c037a
to fix a problem with comboboxes.
2015-08-24 11:33:02 -03:00
David Capello
de3d4c3662 Improve performance flipping the dirty region only 2015-08-24 10:14:25 -03:00
David Capello
9662c0cb90 Add Ctrl+Backspace and Ctrl+Del to ui::Entry field (fix #769) 2015-08-20 23:31:46 -03:00
David Capello
d1799c037a Fix hanging when switching focus between different editable comboboxes 2015-08-20 22:04:28 -03:00
David Capello
835fe40540 Fix problem detecting Timeline widgets when it's hidden 2015-08-20 09:09:49 -03:00
David Capello
4dc6da286e Add zoom slider in StatusBar (issue #420) 2015-08-14 19:46:48 -03:00
David Capello
d323b4affc Remove public variable members from ui::Theme class 2015-08-12 16:48:40 -03:00
David Capello
77d8024026 Fix bug with save/load progress bar: cannot be edited now
The ui::Alert slider to show progress is read-only now.
2015-08-12 16:10:20 -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
6b9c4c53ae Add icons in "New Sprite" dialog
Some changes needed to do this:
* Added support to show icon+text in ButtonSet items
* Added an extra parameter in Graphics::drawUIString() to avoid drawing
  the underscore
* Fixed expansion of ButtonSet items when the grid is resized
* Added support for Alt+mnemonic shortcuts in ButtonSet items
2015-08-12 12:38:07 -03:00
David Capello
53a925e86d Remove SkinParts enum
Now we generate the list of SkinTheme parts from the skin.xml file using
the gen utility.

Several refactors included in SkinTheme class to simplify code.
2015-08-04 19:38:52 -03:00
David Capello
32b12d17da Fix visual artifacts on Windows when the window is resized
Now when the user resizes the OS window (a she::Display), it generates
a kDisplayResize she::Event, and this is processed by the UI layer to
redraw the entire ui::Manager.

With this change we remove the obscure "bool" return value in
she::Display::flip() member function.
2015-07-30 16:15:21 -03:00
David Capello
f2d5242ff3 Redraw the entire ui::Manager after resizing
Regression introduced in dd94925cf7
2015-07-30 10:34:39 -03:00
David Capello
dd94925cf7 Move display flip logic to ui library (ui::Manager class) 2015-07-29 18:12:35 -03:00
David Capello
9ca83e2624 Add support to include any kind of widget inside a Menu 2015-07-29 12:32:01 -03:00
David Capello
de3d408581 Unhighlight menu items when the mouse leaves them 2015-07-29 11:42:57 -03:00
David Capello
a7ea0f7ec5 Add "Snap to Grid" indicator when it's enabled (fix #122) 2015-07-28 13:05:59 -03:00
David Capello
55f90d8b8b Add target_link_libraries() for sublibraries
With this change we remove some internal variables/lists like sys_libs,
libs3rdparty, etc. And we fix dependencies problems between targets.
2015-07-13 12:16:55 -03:00
David Capello
803d9e7a17 Fix minor glitch with Eraser brush preview when Timeline is switched with Tab key 2015-07-06 12:05:24 -03:00
David Capello
48a1af7342 Revert "Make Manager::freeMouse() to select a new visible widget"
This reverts commit 3accd85662.
2015-07-03 13:43:05 -03:00
David Capello
3accd85662 Make Manager::freeMouse() to select a new visible widget
In this way we generate a SetCursor message when a widget is hidden.
2015-06-29 15:46:08 -03:00
David Capello
0b0cb56c1e Replace some UI_FOREACH_WIDGET() with range-based for loops 2015-06-29 15:42:34 -03:00
David Capello
b12e6c3398 Add ui::MenuSeparator widget 2015-06-24 13:14:41 -03:00
David Capello
e4df25f4df Merge ui::Widget::m_align with m_flags field
Here we remove Widget::setFlags() member function, as it's not used.
2015-06-24 12:06:33 -03:00
David Capello
e6d22e7e38 Reimplement Box resize algorithm 2015-06-23 22:46:05 -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
1922a27b38 Make ui::Widget::flags field private 2015-06-23 16:07:41 -03:00
David Capello
7f2cd3b6a9 Rename ui::Widget::min/max_w/h fields to m_min/maxSize and make them private 2015-06-23 15:13:42 -03:00
David Capello
80a62f8ed5 Include config.h in ui/event.cpp 2015-06-23 14:40:54 -03:00
David Capello
325e9245bf Rename ui::Widget::type -> m_type and make it private 2015-06-23 14:37:22 -03:00
David Capello
0517cd1b98 Remove _ji_ prefix in some ui-lib functions 2015-06-23 14:14:06 -03:00
David Capello
f01b816fb5 Remove JI_ prefix from ui/base.h constants 2015-06-23 14:00:00 -03:00
David Capello
5d6bdf5462 Fix crash pressing keys when the program is closing 2015-06-23 09:50:04 -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
8eefdf174e Fix problem mapping "Ctrl++ Pad" key 2015-06-10 16:44:46 -03:00
David Capello
4d055a7170 Rename gfx::Rect::createIntersect -> createIntersection 2015-06-09 16:22:47 -03:00
David Capello
394c431d61 Replace JGrid to Grid in grid_ui_tests 2015-06-09 14:19:54 -03:00
David Capello
e8350fb51a Move event queue to she::System 2015-06-01 14:32:06 -03:00
David Capello
2d61412c68 Fix several compiler problems with clang on Mac OS X 10.10 SDK 2015-05-29 10:10:07 -03:00
David Capello
1124c5caab Don't open a submenu again on mouse move if we clicked its parent to close it
Related to issue #647
2015-05-28 20:09:55 -03:00
David Capello
aea43e11c1 Improve alignment of submenu boxes 2015-05-28 19:35:28 -03:00
David Capello
4e1a429763 Remove bit field specifications from MenuBaseData 2015-05-28 19:23:42 -03:00
David Capello
20a3c36647 Close menu bar item's popup when the item is clicked a 2nd time (fix #647) 2015-05-28 19:22:44 -03:00
David Capello
26b170e67f Merge branch 'skia' 2015-05-26 17:24:59 -03:00
David Capello
da3b3de6c1 Add she::LockedSurface::scrollTo() so we can specialize it in the Skia port 2015-05-22 13:26:09 -03:00
David Capello
9b9ac319dc Rename checkFromAllegroKeyArray() members to isPressed() 2015-05-20 15:02:31 -03:00
David Capello
f6be0c3be6 Replace ISettings with Preferences
Changes:
* Move FreehandAlgorithm/InkType/RotationAlgorithm/SelectionMode to
  app::tools namespace
* Removed ISettings, IToolSettings, IBrushSettings, ISelectionSettings,
  and IColorSwatchesStore (and implementations from UISettingsImpl)
* Added app::tools::PreferenceGlue to do some adjustments that
  UIToolSettingsImpl was doing
* Remove signals from App related to brush size/angle changes, and current
  tool change (there events can be observed directly from Preferences)
* Remove ColorBar::FgColor/BgColor, these options can be observed from
  Preferences::colorBar.fg/bgColor
2015-05-18 16:53:25 -03:00
David Capello
02d163b8d8 Add common keys in ui::Entry for OS X 2015-05-11 12:12:13 -03:00
David Capello
063f1d173c Fix TipWindow() ctor signature 2015-05-11 10:40:37 -03:00
David Capello
cea0970d9d Fix several bugs with tooltip arrows/location
The tooltip arrow is now aligned to the target. And the tooltip is
relocated to the other side if it intersects its target bounds.
2015-05-09 13:20:57 -03:00
David Capello
b74727489d Fix limiting splitter position when it's hidden (with no bounds) 2015-05-07 15:59:29 -03:00
David Capello
7b1b667a8a Fix problem resizing splitters with pixel-based position outside its own bounds (fix #663) 2015-05-07 11:40:39 -03:00
David Capello
cc2a5e8cc5 Pressing two times BrushTypeField was making its popup always visible
There was an ugly combination of events:
1. When ContextBar::BrushTypeField receives an onItemChange is because the
   mouse button is pressed on it (a kMouseDownMessage)
2. It shows the BrushPopup window (which is a PopupWindow
   with kCloseOnClickInOtherWindow click behavior)
3. When other click is made in BrushTypeField, the BrushPopup is closed
   because it is filtering messages (since it's
   kCloseOnClickInOtherWindow). This generates a kCloseMessage in the
   queue.
4. BrushTypeField::onItemChange() is executed again (for the same
   click in point 3), and it checks that the popup is closed (recently
   closed, by this click), so it shows the BrushPopup again.
5. The enqueued kCloseMessage is receved by PopupWindow, and it calls
   stopFilteringMessages().

So in this case we have a visible PopupWindow that is not filtering
messages. To fix this bug we have included a startFilteringMessages()
in kOpenMessage. So when the popup is shown again, it filters messages
and the popup cannot stay visible.
2015-05-06 19:58:41 -03:00
David Capello
f7465771b0 Add Ctrl+A (or Cmd+A) to select the whole text in ui::Entry 2015-05-06 18:11:29 -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
eeb6d6e1b5 Fix problem resetting fonts after F5 for widgets with "mini font" (after theme is reloaded)
There are some widgets (e.g. fg/bg color buttons in the ColorBar, and
ContextBar's check-boxes) that use a "mini font". We could setup the mini
font in onInitTheme(), but the whole program is not ready to do something
like that (there are too much child_spacing/borders values that are set
outside onInitTheme).

A better way is to ask to the theme itself (Theme::getWidgetFont())
about what font to use for each specific widget. And the Widget::m_font
field can act as a cache of this requested font. So now the "mini font"
is specified in a SkinProperty's flag.
2015-05-05 19:14:33 -03:00
David Capello
91c2872908 Fix bug showing "&&" in About dialog 2015-05-05 13:41:27 -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
ca3fade50d Don't call focusFirstChild() if the Window doesn't want the focus 2015-05-04 12:50:04 -03:00
David Capello
883629b563 Fix bug triggering global keyboard shortcuts when a combobox popup is open
When a combobox popup is open, it creates a new non-foreground top window
(which is sibling of the window where the combobox widget is). When the
popup receives a key press, and it doesn't use it, the key is passed to
its parent (a ui::Manager), and then the latter has to process it.

Before this commit, CustomizedGuiManager::onProcessMessage() was
filtering shortcuts for foreground window, but it was working only
when the key was pressed in the foreground window itself (not when a
combination of foreground and background windows were open). Now the
filter is done in Manager::onProcessMessage() (which returns true,
i.e. key was used, for every pressed key when a foreground window
is found in its children hierarchy).
2015-05-04 11:25:42 -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
c219e4dc07 Minor format change in ui/widget.cpp 2015-05-04 10:40:23 -03:00
David Capello
1b25c4e9e9 Add slots in the ContextBar to select brushes with Alt+1, Alt+2, etc.
Now the ContextBar contains a set of brushes. The ChangeBrushCommand
supports a new "slot" parameter and "change" = "custom" to select a
specific custom brush from the ContextBar. Alt+1, Alt+2, etc. are mapped
to this ChangeBrushCommand (see changes in gui.xml).

Also, as the ButtonSet that represent different brushes in the ContextBar
uses icons generated from the brush, we don't need the skin parts that
represent each brush type (we can generate those icons from some standard
brushes). Those skin parts were removed.
2015-04-29 12:32:44 -03:00
David Capello
955383f91a Add xor-ed bounding box in SelectBoxState when QUICKBOX style is enabled
This is useful when we want to select a brush in a black image (the
DARKOUTSIDE style is not useful in this case).
2015-04-27 12:03:18 -03:00
David Capello
da342f29f3 Several changes related to UI scale
* UI scale is an experimental option (it needs app restart)
* We can change the Screen Scale without restarting the app now
* Hide reloading of skin data in SkinTheme::onRegenerate()
* Now setFontOfAllWidgets() is called from Theme::regenerate()
* Remove reload_default_font()
* Simplify gui_setup_screen()
2015-04-17 12:24:33 -03:00
David Capello
b534f955ec Merge branch 'anticrash' 2015-04-09 13:51:39 -03:00
David Capello
21a57ff793 Add "data recovery period" option 2015-04-09 07:46:55 -03:00
David Capello
c571eafdd0 Replace StatusBar progress bars with a slider/progress bar in ui::Alert 2015-04-07 12:18:21 -03:00
David Capello
7a3c0a1eed Minor fixes in style for ButtonSet and StatusBar controls (mini Entry/Slider) 2015-04-07 11:29:36 -03:00
David Capello
22c3c4f20e Remove implicit SharedPtr conversion to T* 2015-04-02 20:42:43 -03:00
David Capello
0ebe764893 Don't change cursor for ui::Splitter if the mouse is captured by other widget 2015-04-02 16:18:01 -03:00
David Capello
3d63e0e1b4 Move SharedPtr to base namespace 2015-04-01 12:35:18 -03:00
David Capello
9e27930f95 Add int type to ui::WidgetType enum 2015-03-27 17:31:45 -03:00
David Capello
70b0495fdb Fix bug showing marching ants from a hidden app::Editor
Widget::isVisible() must return false if the widget isn't
inside a ui::Manager
2015-03-26 10:49:12 -03:00
David Capello
bab5d0c7e5 Minor change in ui::OverlayManager 2015-03-24 11:40:53 -03:00
David Capello
9302c5d1bb Move logic to import sprite sheet inside ImportSpriteSheetCommand::onExecute 2015-03-19 16:20:33 -03:00
David Capello
0350ac4bbe Initial work on Skia backend (WIP) 2015-03-16 15:05:13 -03:00
David Capello
d3f152d1a5 Fix Graphics::doUIStringAlgorithm() for word wrap with rc.w == 0 (without limit) 2015-03-11 18:06:33 -03:00
David Capello
b23194dfae Fix several warnings in MSVC, clang, and gcc 2015-03-05 15:19:00 -03:00
David Capello
7da6f3e857 Minor changes to some #include header files 2015-03-05 12:40:47 -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
37781c99ea Show blog posts in NewsListBox 2015-03-02 19:54:24 -03:00
David Capello
8f8291a39b Hide colorbar and toolbar when we're in Home tab 2015-03-02 14:43:44 -03:00
David Capello
6862e02805 Add list of recent files and folders in Home tab
* Add LinkLabel::onClick()
* Use Widget instead of ListItem in ListBox API
* Add TextRule::padding() and use it to calculate the preferred size
  for a skin::Style's rules
2015-03-02 11:18:33 -03:00
David Capello
bf27db12e6 Make the "new update" link more noticeable (using a special style) 2015-02-27 20:45:15 -03:00
David Capello
8eb8122bc0 Add widgets to HomeView (icon, new file, open file, and list boxes)
* Add widgets/home_view.xml
* Add possibility to specify style="..." and border="..." in XML widgets
* Add SkinStyleProperty
* Remove Label::get/setTextColor() (replaced with styles)
* Add <image> widget in WidgetLoader
* Paint labels, link labels, and views with styles
2015-02-26 09:53:19 -03:00
David Capello
f3974002d5 Fix int <-> double <-> float casts
It looks like allegro includes several implicit conversions between
float and double.
2015-02-14 22:37:56 -03:00
David Capello
2c6067f7e4 Update license of app/ module to GPLv2 2015-02-12 12:16:25 -03:00
David Capello
1d8939be8a Merge branch '1.0' 2015-01-21 02:00:48 -03:00
David Capello
9af8567a6b Make PopupWindow movable again (fix regression from 1f25579f5a) 2015-01-19 20:44:47 -03:00
David Capello
1b3d8650bd Remove Widget::user_data and theme_data fields 2014-11-25 22:46:50 -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
9e0990a70f Remove Manager::currentMouseButtons() 2014-11-25 22:11:44 -03:00
David Capello
752faf11f2 Remove jmouse_[xyz]() functions 2014-11-25 22:10:28 -03:00
David Capello
376fd0a23c Remove jmouse_b() function 2014-11-25 22:01:36 -03:00
David Capello
a35c32dcfe Rename jmouse_hide/show() to ui::hide/show_mouse_cursor() 2014-11-25 21:35:06 -03:00
David Capello
b74262e36e Remove jmouse_is_hidden() and jmouse_is_shown() functions 2014-11-25 21:32:22 -03:00
David Capello
d9ed3c2348 Rename jmouse_[gs]et_cursor() to ui::[gs]et_mouse_cursor() 2014-11-25 21:30:56 -03:00