Commit Graph

112 Commits

Author SHA1 Message Date
David Capello 0cf39625f8 Minor fix in PaletteView::setBoxSize() to apply the guiscale() to the box size 2016-02-24 17:37:36 -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 2949ff0a7c Improve UI to drag-and-drop colors and the resize handle (related to #772) 2015-08-27 08:09:13 -03:00
David Capello dd6c028477 Add handle to resize the palette (fix #754) 2015-08-20 12:08:08 -03:00
David Capello cb867b7f84 Re-implement GIF decoder to load some .gif files correctly (fix #729)
- Better palette creation depending on local colormaps
- Reuse palette colors from previous frames
- Use frame transparent index correctly
- Convert to RGB automatically if the image has more than 256 colors
- Remove onPostLoad()
- Add progress bar feedback
2015-07-17 12:26:11 -03:00
David Capello 17bffc81c3 Fix Ctrl+mouse wheel in ColorBar to modify the size of each color box when UI Scaling > 100% 2015-07-06 16:46:12 -03:00
David Capello f6bf4e36a8 Fix PaletteView::onPaint() when multiple entries are being dragged 2015-07-06 13:56:53 -03:00
David Capello 32785562dd Show new palette size feedback in StatusBar when we drag-and-drop colors 2015-07-05 19:41:11 -03:00
David Capello b085fee918 Improve drag-and-drop in ColorBar/PaletteView widget 2015-07-04 19:11:50 -03:00
David Capello be6779631b Modify eyedropper tool to pick colors with alpha and support several modes
Issue #286
2015-07-02 18:13:47 -03:00
David Capello 318bc2e2f9 Add alpha channel to palette/color bar/color selector (issue #286) 2015-06-30 17:36:37 -03:00
David Capello 60a3da7b7c Fix PaletteView::setColumns() to set a correct number of columns for small palettes
If we have a palette with few colors (e.g. just one row of colors), we
would like to setup a columns number equal to the whole available
PaletteView width. This is because when we drag colors, we can drop them
in position that are outside the current palette size.
2015-06-29 12:33:41 -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 07f42d620d Change cut/clear behavior to remove palette entries 2015-06-18 16:20:42 -03:00
David Capello f19e1dc477 Add ability to drop colors outside the palette range
Like in the timeline, now we can drop colors out of the palette bounds
to create more entries.
2015-06-18 15:50:00 -03:00
David Capello 89e0392daa Add support for palettes with more less (and more) than 256 colors (fix #668)
With this commit we've removed doc::Palette::MaxColors constant.
2015-06-18 12:50:33 -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 27485b7ff6 Fix problem selecting transparent color from the ColorBar with middle button
When we move the mouse with the middle mouse button, we must trigger
onPaletteViewIndexChange() delegate in any case (the middle button
doesn't change the m_currentEntry).
2015-05-21 16:25:41 -03:00
David Capello 13aef4eecf Add support to change the transparent color with middle click 2015-05-20 12:11:47 -03:00
David Capello 1ff4f06a69 Show transparent index in ColorBar with a little dot 2015-05-20 11:40:22 -03:00
David Capello ae048f5756 Avoid including ColorBar in PaletteView 2015-05-20 11:38:38 -03:00
David Capello 7278f649f4 Select exact RGB match when we use eyedropper in RGB images
Fix #16
2015-05-11 11:25:53 -03:00
David Capello 2ac04c1c16 Show foreground/background color indicators in ColorBar
Related to #16 and #545
2015-05-11 10:53:50 -03:00
David Capello 300a5cc1cb Fix palette editor for one entry (non-selected range)
This fix the most common behavior where we are capable of use
eyedropper to pick just one color, and modify it with the editor.
2015-05-11 09:51:10 -03:00
David Capello 9fc7b993d4 Add ability to cut colors in the ColorBar 2015-05-10 21:36:46 -03:00
David Capello 38526f3b9e Rename PaletteView::clearSelection() -> deselect() 2015-05-10 19:23:30 -03:00
David Capello c1324d196e Fix ColorBar::onCanPaste() to return true when we can still paste colors 2015-05-09 20:27:40 -03:00
David Capello 2bbaa45844 Unify Cut/Copy/Paste/Clear handling with InputChain class 2015-05-09 19:55:33 -03:00
David Capello 11d86bb7c5 Add ability to copy colors using Ctrl + drag & drop 2015-05-09 15:57:46 -03:00
David Capello 62a3594598 Add ability to copy & paste colors with Ctrl+C and Ctrl+V
This commit includes the new doc::PalettePicks class. It's a helper
class to identify which entries are selected in the ColorBar.

We've removed the Copy/Paste buttons from the Palette Editor window.
2015-05-09 12:20:58 -03:00
David Capello 2995190d00 Fix crash making palette entries too small using scroll wheel 2015-05-08 17:00:44 -03:00
David Capello d3dbc11451 Add options to change palette entry size 2015-05-08 14:59:52 -03:00
David Capello 45f4d30450 Remove unused variables/functions 2015-04-09 11:36:09 -03:00
David Capello 3e44399e4b Remove unused local variables 2015-03-25 16:38:56 -03:00
David Capello fd62a60472 Save ColorBar box size in preferences 2015-03-23 14:39:21 -03:00
David Capello a1d2b5e0dc Change palette view's box size with Ctrl+mouse wheel 2015-03-23 13:28:16 -03:00
David Capello d14e4e8896 Add support to drag-and-drop colors in ColorBar/PaletteView (fix #37) 2015-03-23 12:25:32 -03:00
David Capello d41b08caa8 Add UI to drag and drop colors in PaletteView 2015-03-20 15:29:44 -03:00
David Capello 26970832ac PaletteView: highlight selection outline when the mouse is over it 2015-03-20 14:46:48 -03:00
David Capello 8f1ac5f488 Add PaletteView::getPaletteEntryBounds() to simplify paint/hit-test code 2015-03-20 08:44:39 -03:00
David Capello a79acfd24c Handle mouse selection in PaletteView like in the Timeline 2015-03-19 19:45:44 -03:00
David Capello 811e56a819 Remove PaletteView::setBoxSize() member function 2015-03-19 19:45:31 -03:00
David Capello e2b8d2be31 Draw PaletteView selection like Timeline selection 2015-03-19 19:45:12 -03:00
David Capello 2c6067f7e4 Update license of app/ module to GPLv2 2015-02-12 12:16:25 -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 0a7bbfba6b Add PaletteIndexChangeEvent for PaletteView::IndexChange event
This was added to avoid deprecated jmouse_b(0) function
in ColorBar::onPaletteIndexChange().
2014-11-25 21:51:06 -03:00
David Capello 63995c6f0a Merge "raster" namespace into "doc" library 2014-10-20 22:21:31 -03:00
David Capello a2718f83e4 Remove Allegro dependency from several files 2014-08-22 01:32:13 -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 c56d3d1170 Fix for PaletteView: redraw it when the palette is changed 2014-06-01 18:09:19 -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 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 6ad54689dd PaletteView: Apply jguiscale() to initial m_boxsize 2014-04-17 14:46:23 -03:00
David Capello 8dc869e1de Move drawing code of PaletteView widget from kPaintMessage to onPaint() 2014-04-13 16:26:00 -03:00
David Capello 01d79ddf9b Merge branch 'dev' of git@github.com:dacap/aseprite.git into dev 2013-11-09 20:00:16 -03:00
David Capello e5ba8e0922 Encapsulate Image implementation (private members, accessors, iterators, etc.)
- Rename _rgba/_graya to raster::rgba()/graya()
- Add raster::color_t type (alias for uint32_t)
- Rename raster::GfxObj to Object. And GfxObj::getType() to Object::type()
- Move conversion from raster::Image/Palette to Allegro BITMAP/RGB
  to raster/conversion_alleg.h file
- Add raster/color_scales.h
- Rename image_* functions to raster/primitives.h
- Reimplement ink processing with templates instead of macros
2013-11-09 19:59:05 -03:00
David Capello dbf4d0d490 Replace JRect/jrect struct with gfx::Rect
- Replaced Widget::rc -> Widget::m_bounds private member.
- Added Widget::offsetWidgets() method.
- Removed View::displaceWidgets().
2013-10-26 12:50:55 -03:00
David Capello cde54f3682 Change BSD license to MIT in sublibraries and fix headers 2013-08-08 21:01:20 -03:00
David Capello c88f9b172b Refactor: Move app files to src/app subdirectory inside app namespace
- Add HAVE_CONFIG_H wrapper to #include "config.h"
- Removed widgets namespace (it's in app now)
- Move some functions from src/file/file.h to src/base/cfile.h
- Move Vector2d to base library
- Rename MenuItem2 to AppMenuItem
2013-08-05 21:20:19 -03:00