Commit Graph

3257 Commits

Author SHA1 Message Date
David Capello
97609b6504 Add option to change the zoom behavior with keys 2015-05-07 15:56:38 -03:00
David Capello
b2955d58ad Add option to change the zoom behavior with scroll wheel 2015-05-07 15:52:26 -03:00
David Capello
3d29adcbdf Fix zoom behavior when the zoom is changed from the center 2015-05-07 15:13:26 -03:00
David Capello
bfaf8a5921 Add ability to change the Preview zoom using 1...6 keys above the Preview 2015-05-07 14:43:33 -03:00
David Capello
35c8cc893b Add some help text in ContextBar when SelectBoxState is running 2015-05-07 13:11:44 -03:00
David Capello
18b067ee77 Add ContextBar::updateForCurrentTool() which is a common thing to do 2015-05-07 12:32:08 -03:00
David Capello
e398a1f21f Allow any size of boundaries for brushes
As now the eraser must show the boundaries of custom brushes, the fixed
maximum limit we were using (MAX_SAVED) for boundaries is not enough.
So now we use a std::vector for saved pixels.
2015-05-07 12:18:58 -03:00
David Capello
c90677333b Show current brush bounds for eraser tool (even for custom brushes) 2015-05-07 12:10:04 -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
24c3c3e3a3 Add '=' key has alternative to '+' (as in US keyboards plus sign is Shift+'=') 2015-05-06 18:02:59 -03:00
David Capello
9f39f4384c Add a menu option to lock/unlock each brush
This is an alternative to lock brushes using its keyboard shortcut.
2015-05-06 17:39:40 -03:00
David Capello
9dfd5ae0d3 Fix conflict between two classes named app::Item (in brush_popup.cpp and data_recovery_view.cpp)
This conflict was generating a crash when the "Recover Lost Sprites"
button was pressed.
2015-05-06 17:23:43 -03:00
David Capello
cb5fd3963f Fix problem where the cel opacity slider in StatusBar was not activated
After creating a new cel from a tool loop, we have to generate an
ActiveSiteChange notification (because now we have a cel in the active
position). In this way the StatusBar can update/enable the opacity slider.
2015-05-06 17:08:08 -03:00
David Capello
c6c7439566 Close autocomplete popup when we change the active folder in FileSelector 2015-05-06 16:58:32 -03:00
David Capello
05fb32bb84 Fix navigation keys for OS X and Windows
On OS X we can use Cmd+[ or Cmd+] to navigate the history. And Cmd+Up/Down
to go to the enclosing folder, or enter in a folder respectively.

On Windows we can use Alt+Left/Right to navigate the history. And Alt+Up
to go to the enclosing folder. (Alt+Down is an extra shortcut to enter
in the folder).
2015-05-06 16:47:43 -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
a0ea3ae07b Fix bug trying to remove one keyboard shortcut when other is removed instead
We've to regenerate all buttons that modify a specific keyboard shortcut
because they are listening the Click signal with the specific index of
the that shortcut. The index is given as parameter to the Signal connect()
function.

We've converted all buttons to shared pointers to simplify the code.
2015-05-06 12:13:35 -03:00
David Capello
decaa6510f Add TODO comment for SkinParts enum 2015-05-06 10:53:01 -03:00
David Capello
d0fe427805 SkinProperty doesn't have mini font by default 2015-05-06 10:50:21 -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
fed03e7d7b Continue playing animation when we scroll 2015-05-05 15:31:25 -03:00
David Capello
91c2872908 Fix bug showing "&&" in About dialog 2015-05-05 13:41:27 -03:00
David Capello
a489efdf03 Use ContextObserver to update the StatusBar
Instead of calling StatusBar::updateUsingEditor(Editor*), now the StatusBar
is a ContextObserver that observe changes in the active doc::Site. The
Editor notifies a ActiveSiteChange event when the active frame/layer
is changed.

Fix #657
2015-05-05 13:24:26 -03:00
David Capello
c3d7a96a87 Replace ContextObserver::onActiveDocumentChange() with onActiveSiteChange() 2015-05-05 12:58:50 -03:00
David Capello
14d369404e Use new filename_formatter() in tests (fix #658) 2015-05-05 12:04:20 -03:00
David Capello
53e25770b1 Status bar should not eat Enter key when it isn't focused (fix #660) 2015-05-05 09:47:05 -03:00
David Capello
a4db7ff0eb Ignore current ink mode for custom brushes 2015-05-04 19:18:12 -03:00
David Capello
88930a6d69 Replace PRINTF with TRACE in TwoPointsController 2015-05-04 19:04:11 -03:00
David Capello
01cffe202e Fix comment in app/tools/controller.h's include guard 2015-05-04 19:03:50 -03:00
David Capello
bdf28c01de Fix problem initializing oldX/Width fields for the docked tab
This fixes a problem creating interpolation between random
oldX/Width values and x/width fields. I've added some special values
in the initialization of a Tab to know if we are using uninitialized
values oldX/Width/x/width values in the animation.
2015-05-04 18:16:29 -03:00
David Capello
ae03dd5461 Don't use last selected document as active document if UI is enabled
Related to bug found in #656. In this way, if the UI is enabled,
the active document is != null only if there is an active view for it.

Anyway, in batch mode we can potentially have a lot of bugs. There are
several UI commands that think that active view != null (and
current_editor != null) when the active document != null.
2015-05-04 16:25:28 -03:00
David Capello
4f33bef43c Command::short_name() is id() now
(Fix compilation in Release mode.)
2015-05-04 16:08:15 -03:00
David Capello
5538c5a749 Update all tabs (main Tabs and from subpanels) when a document is modified 2015-05-04 15:52:00 -03:00
David Capello
53e572eaf5 Rename TabsDelegate::isModifiedTab() to isTabModified() 2015-05-04 15:33:05 -03:00
David Capello
f766763a92 Add CLA-signing step in CONTRIBUTING file 2015-05-04 15:18:15 -03:00
David Capello
116f0a760e Merge branch 'master' of git@github.com:aseprite/aseprite.git 2015-05-04 14:58:38 -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
9528cae9db Merge pull request #656 from blackmiaool/fix_new_brush
Fix crash using NewBrush when Home tab is selected
2015-05-04 11:57:26 -03:00
David Capello
6f8603bcb1 Merge pull request #655 from blackmiaool/fix_palette
Show checkbox in Palette > Palette Editor
2015-05-04 11:47:40 -03:00
David Capello
8a2b1d46a1 Merge pull request #653 from blackmiaool/master
Select Home tab when it's not selected in HomeCommand
2015-05-04 11:47:24 -03:00
David Capello
fa8afc02e9 Create new layers above the current one
We've added a "top" parameter to have the previous behavior.
2015-05-04 11:45:08 -03:00
blackmiaool
00b45c3bd7 Fix crash using NewBrush when Home tab is selected 2015-05-04 22:38:15 +08: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
blackmiaool
1d98f51197 Show checkbox in Palette > Palette Editor menu item when the Palette Editor is visible 2015-05-04 13:02:58 +08:00