Commit Graph

580 Commits

Author SHA1 Message Date
David Capello
eca3080d24 Fix bug counting two consecutive Timer::start() calls as two different timers 2018-12-22 23:56:35 -03:00
David Capello
72313e1c48 Add possibility to pin/unpin recent items 2018-12-22 00:14:31 -03:00
David Capello
b6d9156013 Add support to drag and drop recent file items
The items are still not persisted/synchronized with the .ini file.
2018-12-21 12:22:25 -03:00
David Capello
3fdde68bdb ui::Timers must be called from the UI thread only now
This simplifies the code about timers: we can use a std::vector
instead of a obs::safe_list, and use ui::execute_from_ui_thread() to
avoid using mutexes, etc.
2018-12-21 09:37:47 -03:00
David Capello
027c19783e Simplify Timer::haveRunningTimers() function
As it's called on each UI message generation loop, we can avoid
iterating all timers on each message loop.
2018-12-21 08:46:02 -03:00
David Capello
c6e321b55c Fix crash using deferDelete() rebuilding the RecentListBox items 2018-12-19 15:32:33 -03:00
David Capello
8407f05434 Remove ui::Manager::removeWidgetFromRecipients() 2018-12-15 10:08:47 -03:00
David Capello
9e3c6dc5f4 Remove unused iterator from ui::Message 2018-12-15 10:08:03 -03:00
David Capello
7e638cddcc Fix keyboard shortcuts dialog items: don't create/dsetroy children widgets continuously inside KeyItem
Don't send a leave message (e.g. kMouseLeaveMessage) if the old
focused widget (mouse_widget) if an ancestor of the new focused
widget.
2018-12-13 14:47:19 -03:00
David Capello
c0fcef0240 Unify ToolTipManagers in MainWindow
In this way we avoid having too many message filters in the ui::Manager.
2018-12-13 14:08:56 -03:00
David Capello
3ccd09dd8d Replace internal macro with an inlined function 2018-12-13 11:00:22 -03:00
David Capello
06352f79e8 Add ui::IGNORE_MOUSE flag for static widgets
This avoids some MouseEnter/Leave messages between widgets that don't
need them.
2018-12-13 10:48:12 -03:00
David Capello
105d389fdc Remove list of recipients from ui::Message 2018-12-13 10:11:56 -03:00
David Capello
ab9883e260 Avoid running ui::Entry timer when it's not needed 2018-12-12 13:27:24 -03:00
David Capello
3b810701ce Minor change in Timer::stop() to avoid calling removeMessagesForTimer() when it's not necessary 2018-12-12 13:26:35 -03:00
David Capello
92330adc30 Avoid busy-waiting when a menu item is clicked
When a menu item is clicked a kExecuteMenuItemMessage is enqueued, so
the msg_queue will not be empty until we exit the menu item
callback (MenuItem::onClick()). This will prevent us to use a
os::Event::getEvent() where we can wait the OS for the event (see that
Manager::generateMessagesFromOSEvents() checks that msg_queue must be
empty to block the thread for OS events).
2018-12-12 00:40:39 -03:00
David Capello
21544bb666 Remove unused function Manager::removeMessage() 2018-12-12 00:27:54 -03:00
David Capello
53f2b4a121 Don't go to sleep if there are delayed painting messages 2018-12-12 00:26:28 -03:00
David Capello
e0b246dd87 Remove unused function Message::prependRecipient() 2018-12-12 00:24:27 -03:00
David Capello
f6a2090ed9 Fix bug losing the ui::DIRTY flag from the ui::Manager after closing a fullscreen ui::Window 2018-12-04 17:44:21 -03:00
David Capello
0a179acc90 Minor change in Widget::invalidate*() funcs to use onInvalidateRegion() 2018-12-04 17:32:01 -03:00
David Capello
4790e3845a Fix regression introduced in 767897d665
In some cases we have to enable the DIRTY flag in the hierarchy.
Reproducible case: right-click a tab with an image, open in a folder,
then right-click the tab again.
2018-12-04 12:54:40 -03:00
David Capello
e3dc8fa3a6 Minor change 2018-12-04 12:51:56 -03:00
David Capello
2ffb708be8 Move Manager::invalidateDisplayRegion() to Manager::onInvalidateRegion() 2018-12-03 23:59:42 -03:00
David Capello
767897d665 Set DIRTY flag on Widgets without going to all parents 2018-12-03 22:16:00 -03:00
David Capello
e516d26fa8 Fix glitch showing/hiding Preview window with the toolbar button on sprites with canvas size > Preview window viewport 2018-11-28 12:02:57 -03:00
David Capello
9af7366662 Fix bug redrawing the area occupied by the window when it's destroyed 2018-11-28 10:35:13 -03:00
David Capello
0ab7f45c35 Update ui/README file 2018-11-28 10:34:35 -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
9b2889ef66 Fix issue with overlays on macOS w/the new async painting (fix #1931)
Fixed regression introduced in d20436f957.
Now overlays are kept on the screen and the overlapped area is restored
just in time when we have to re-paint some widget on that area.
2018-11-15 15:42:50 -03:00
David Capello
d32d8bf938 Fix color problems with overlays (fix #1914)
There were two problems:
1) Overlays weren't using the screen color space, so restoring the
   pixels were modifying the original saved area
2) A custom cursor (when "Use native cursors" option were enabled) was
   using overlays, when we could use a native custom cursor
   anyway (without overlays)
2018-10-31 11:10:44 -03:00
David Capello
4487c3d35f Check that we're calling the Widget::invalidate() from the ui thread 2018-10-25 17:29:07 -03:00
David Capello
bccd3f1bf8 lua: add Dialog() 2018-10-11 12:01:21 -03:00
David Capello
f604ac95dd lua: add app.alert() function 2018-09-07 16:42:58 -03:00
David Capello
798d6df5ff Add File > Scripts menu 2018-09-05 13:35:13 -03:00
David Capello
039e064d6b ui library doesn't depend on pixman directly
ui-lib depends on laf-gfx which already depends on pixman.
2018-08-29 10:23:15 -03:00
David Capello
efffde5673 Wait for OS messages when is possible
With this change we will reduce the CPU and energy consumption levels
as now we can go to sleep when there is no OS messages left and no
timers running.
2018-08-17 22:09:34 -03:00
David Capello
c6a5982c26 Don't call flushRedraw() when moving scroll
It looks like we don't need this call anymore (maybe it was there for
the Allegro port).
2018-08-17 16:45:57 -03:00
David Capello
4fb66b6a10 Use drawSurface() instead of drawRgbaSurface() to draw the render 2018-08-17 16:30:03 -03:00
David Capello
6b7aec27b7 Improve ui::move_region() performance for regions with more than 1 rectangle 2018-08-16 20:46:36 -03:00
David Capello
72fb45aede Minor change (auto& -> const auto&) 2018-08-16 20:45:14 -03:00
David Capello
220d043873 Discard enqueued kWinMoveMessage messages (fix #1006)
When we're moving or resizing a window, sending several
kWinMoveMessage doesn't make sense. So we discard all kWinMoveMessage
and re-enqueue a new one with the latest window bounds.
2018-08-16 15:55:46 -03:00
David Capello
a6fab8d1d9 Move os/ft/gfx libraries to laf 2018-08-09 16:36:11 -03:00
David Capello
5cb2d984f0 Rename she -> os 2018-08-09 12:58:43 -03:00
David Capello
f9c1c68012 Remove Allegro back-end (#139) 2018-08-09 11:43:35 -03:00
David Capello
f2ed45e795 Replace base::UniquePtr -> std::unique_ptr 2018-08-08 17:27:26 -03:00
David Capello
7c19744798 Add some checks in ui/manager.cpp to report messages correctly 2018-07-04 14:27:13 -03:00
David Capello
6b1c884eb5 Add code to check integrity of backups 2018-07-04 12:35:15 -03:00
David Capello
3e0ebd34c9 Fix macOS bug executing commands from other native menu instead of the open aseprite menubox when we use mnemonics 2018-06-29 12:14:54 -03:00
David Capello
f595ceea7f Add possibility to write math expression in number textboxes (fix #1762) 2018-06-28 13:33:13 -03:00