Commit Graph

54 Commits

Author SHA1 Message Date
David Capello a62f12ad09 Move all code to draw windows to ui-lib w/new styles 2017-02-17 14:18:47 -03:00
David Capello 97809952eb Remove some face colors from theme.xml using the center slide instead 2017-02-10 17:49:37 -03:00
David Capello 315584d819 Close toolbar popup when the document is closed 2016-12-07 11:12:19 -03:00
David Capello 4e3a979b97 Redraw the ToolBar when we switch to a quick tool 2016-11-22 14:32:18 -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 5ecc356a41 Replace GPL license with the new EULA 2016-08-29 13:08:21 -03:00
David Capello a09b00dba8 Fix synchronization of different UI elements depending on the active tool
With this patch now the context bar shows the real active tool
preferences. For example, if we choose the option to use the Eraser
tool with right-click, now right-clicking will draw with the Eraser
brush size (instead of using the selected tool/left-click tool brush
size).

Changes:
* Removed the toolBox.activeTool() field from preferences
  (as the option isn't persisted between sessions)
* Added an observable app::tools::ActiveToolManager class to sync all
  UI elements that depend on the active tool and ink.
* Moved a lot of "active tool" logic from app::Editor to the
  new ActiveToolManager
* Moved app::tools::ToolLoopManager::Pointer as an indepedent
  app::tools::Pointer class
2016-04-25 15:20:53 -03:00
David Capello 5f90ef7c9b Add properties in App to access directly to timeline/contextBar/workspace 2016-04-22 13:19:06 -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 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 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 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 a34931db3d Remove ConfigureTools command
These options were replaced with commands in "View" menu.
2015-08-10 18:52:29 -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 a7ea0f7ec5 Add "Snap to Grid" indicator when it's enabled (fix #122) 2015-07-28 13:05:59 -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 f01b816fb5 Remove JI_ prefix from ui/base.h constants 2015-06-23 14:00:00 -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 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 de3e46d879 Draw Tabs widget using styles.
* Add background-repeat style rule to specify how to repeat the
  background image
* Remove PART_TAB_* skin parts from skin_parts.h
2015-02-17 16:03:00 -03:00
David Capello 881667f01b Replaced app::skin::ThemeColor with app::gen::SkinTheme::Colors
Generate app::gen::SkinFile class from skin.xml to automate creation
of ID references.
2015-02-15 15:29:16 -03:00
David Capello 2c6067f7e4 Update license of app/ module to GPLv2 2015-02-12 12:16:25 -03:00
David Capello 5f78fbe354 Rename MiniEditorWindow to PreviewEditorWindow 2015-02-10 09:38:07 -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 f939ef5f02 Add keyboard shortcuts customization (close #253)
Changes:
* Add KeyboardShortcutsCommand and window
* Add SelectAccelerator window
* Replace modules/gui.cpp functions with app::KeyboardShortcuts and
  app::Key with the logic to load/save/handle keyboard shortcuts
* Change ui::Accelerator concept: now it represent just one keyboard
  shortcut, not a set of shortcuts
* Remove ui::Accelerator from ui::MenuItem, now the key is associated
  in app::AppMenuItem and it's a app::Key
* Add Command::onGetFriendlyName() to get a user friendly name of the
  command depending on its parameters
2014-10-29 11:58:03 -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 51ab478f49 Fix order of members initialization detected by clang 2014-08-17 20:38:55 -03:00
David Capello 5075c1f86f Remove unused variables/code 2014-08-17 20:37:12 -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 81ffb0c5bd Refactor: Create doc::Context and move some logic from app::Document to doc::Document
The objective of these changes is to create a more testable doc/logic API.

Included changes:
- Added doc::Context, doc::Documents (the old app::Documents),
  and doc::Sprites (and observers for each)
- Added raster::Sprite::createBasicSprite()
- Added doc::ColorMode (equal to raster::PixelFormat)
- Added some methods to doc::Document: context(), sprites(), sprite()
  (to replace app::Document::getSprite()), width/height(), colorMode(),
  name(), and close()
- Moved app::DocumentObserver/Event to doc::DocumentObserver/Event
- Replaced app::ContextObserver with doc::DocumentsObserver and a couple
  of signals.
- Renamed app::Context::getActiveDocument() with
  doc::Context::activeDocument()
- Renamed app::Context::getActiveLocation() with
  app::Context::activeLocation()
- Removed app::ContextObserverList
- Removed app::DocumentId (now we can use doc::ObjectId)
- Removed app::Context::getSettings()
2014-07-29 00:53:24 -03:00
David Capello 4b7bf5b835 Merge she::Color and ui::Color types in gfx::Color 2014-06-28 16:10:39 -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 6924990992 Simplify slot disconnections with the new Connection and ScopedConnection classes 2014-06-12 22:29:19 -03:00
David Capello ddf894867a Fix ToolBar behavior to avoid changing tools unintentionally
- Avoid opening other groups if the user is not with the mouse down
- A second MouseUp closes the group
2014-05-04 20:56:36 -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 a34d181530 Add Widget::is/setTransparent property to paint a widget merged with its background
This fixes problems with tooltips, toolbar popups and context bar popups.
It fixes issue #297 (undo notifications rendering problems).
2014-04-19 18:51:42 -03:00
David Capello 4beff46e02 We were calling dispatchMessages() on openPopupWindow(), which produces some messages that were deleting the toolstrip
We cannot use the "overlapped area" trick to draw the background of the
window. It's better to add a new "composite" kind of window.
2014-04-17 22:52:26 -03:00
David Capello 9ad86ef0ed Toolbar: Remove slot before the popup window is deleted
This fix some strange scenario/bug where slots iterators where invalidated
in the middle of the signaling process. (The whole signal/slot impl needs
a review/simplification.)
2014-04-17 22:30:07 -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 c387d330e6 Make hot-region bigger for ToolStrip popup 2014-04-13 21:20:32 -03:00
David Capello cd464f6694 Fix tooltip flicker on ToolBar 2014-04-13 21:20:06 -03:00
David Capello 31e1b4e387 Close all TipWindow automatically on click 2014-04-13 20:40:44 -03:00
David Capello c9bda7b329 Implement TipWindow in terms of PopupWindow 2014-04-13 19:35:15 -03:00
David Capello 312aca755e Fix issue 333: Tool Selection Icons Flicker
- Add PopupWindow::ClickBehavior
2014-04-13 19:25:06 -03:00
David Capello 49844267a5 ToolBar: Now we can press-move-release mouse to select tools over different ToolStrips 2014-04-13 17:34:02 -03:00
David Capello 23292edf0c Move drawing code of ToolBar from kPaintMessage to onPaint() 2014-04-13 14:16:29 -03:00