Commit Graph

99 Commits

Author SHA1 Message Date
David Capello 8a7a585362 Load/save shades in user preferences (close #85) 2015-11-25 15:17:34 -03:00
David Capello 0f8997b3df Add drag-and-drop of colors in shade widget (#85) 2015-11-25 12:29:19 -03:00
David Capello cf7c4754cc Convert InkShadesField in a combobox-like widget to store several shades (#85)
Changes:
* Added new ui::IconButton widget to create widgets with one skin icon
  that is colored depending on the button state.
* ContextBar::InkShadesField was divided into a couple widgets (ShadeWidget
  and IconButton to drop-down a little menu with saved shades)
* Fixed CommonLockedSurface::drawColoredRgbaSurface() impl.
* Removed invalid gfx::setr/g/b/a() functions.
2015-11-24 18:37:13 -03:00
David Capello 25a331c43a Fix shades field preferred size when UI scaling > 100% 2015-11-23 15:05:35 -03:00
David Capello e683b8fb1a Switch shading colors with X key
Related to #85 and #854
2015-11-20 18:44:08 -03:00
David Capello 6cbb1882d4 Add shortcut to switch pixel-perfect mode (fix #858) 2015-11-18 16:15:25 -03:00
David Capello c29fd79796 Remove commented code in context_bar.cpp to select dots freehand algorithm 2015-11-18 15:32:48 -03:00
David Capello e5397d9ad3 Don't show symmetry controls on tools like eyedropper/move/zoom 2015-10-29 12:52:22 -03:00
David Capello 56854cdb9f Add symmetry mode (fix #208)
This is a first iteration of the feature, it doesn’t have handles to
move the symmetry line and it only contains two symmetry modes:
horizontal or vertical.

As an extra change, we have added the new Stroke type to wrap a vector
of gfx::Points and simplify some existing code in the ToolLoop.
2015-10-26 17:51:32 -03:00
David Capello 460d4b47c9 Add missing "override" modifier on some member functions
These ones were detected by clang-700.0.72
2015-09-30 16:34:43 -03:00
David Capello 984059e1bc Avoid selecting all RGBA+Index buttons in FilterTargetButtons 2015-08-28 15:41:02 -03:00
David Capello d994d67a2a Fix crash using Shading mode with sprites with different palette sizes 2015-08-28 12:22:32 -03:00
David Capello 62f90a1a76 Fix wording in empty ContextBar::InkShadesField widget 2015-08-27 08:10:09 -03:00
David Capello f3ac563e33 Add shading ink (fix #85) 2015-08-26 16:48:01 -03:00
David Capello 75a743f141 Separate pivot visibility and location options 2015-08-14 10:09:15 -03:00
David Capello 32bf3314e6 Add a new simple/default ink
This ink behaves as alpha compositing but doesn't use the opacity slider
(opacity is used from current color's alpha channel). Also, in case that
we pick the mask color, it behaves as the eraser tool.
2015-08-13 13:26:52 -03:00
David Capello e76d25283a Remove unused variable in ContextBar::BrushTypeField class 2015-08-06 17:37:16 -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 7cfdf76b0e Add rotation pivot options in context bar (fix #370)
With these options we can configure to show the pivot and the default
location when we select a sprite area.
2015-07-29 16:35:34 -03:00
David Capello 0898d685c2 Fix minor UI bug in the initial ContextBar::TransparentColorField state 2015-07-28 11:14:12 -03:00
David Capello 41bb23f1f1 Change opaque/transparent selection by default depending on the layer 2015-07-27 11:43:48 -03:00
David Capello bc29cd4bc5 Set alpha compositing as default
And "replace pixel" and "set alpha" were merged into "copy color" ink.
2015-07-27 11:24:00 -03:00
David Capello 35229e99a6 Add opaque/transparent mode in context bar for transformations (fix #546)
With this change now we add a "mask" image/parameter in rotation
functions. In this way we can identify which specific pixels are
inside the original mask/selection, and in opaque mode we can
include/scale/rotate all those pixels inside the mask, whatever
value they are, even if they are the mask color.

Fixes #730
2015-07-23 22:42:14 -03:00
David Capello 6aeee0b8fa Show opacity when brush is an image (ignoring the ink type) 2015-07-23 10:43:16 -03:00
David Capello 66ddc62a76 Add an option to share ink/opacity parameters between all tools 2015-07-23 10:07:07 -03:00
David Capello c6de475556 Add ContextBar::BrushChange signal 2015-07-06 13:05:06 -03:00
David Capello 17e1c22a65 Hide brush angle when it's not necessary 2015-07-03 13:41: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 d80b984f00 Adjust default ink to be more pixel-art friendly (just replace RGBA values)
Now that we have alpha channel in color selector and palette entries, it's
nice to have as a default ink a more pixel-art friendly, i.e.
an ink that just replace RGBA values instead of doing alpha compositing.

Issue #286
2015-07-02 13:16:06 -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 90f988d928 Add option to ignore grid limits in paint bucket or magic wand tools (fix 564) 2015-06-17 13:22:46 -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 41ed14f036 Replace ISettings::get/setAutoSelectLayer() with Preferences class 2015-05-13 11:57:13 -03:00
David Capello 00ff89529c Replace ISettings::get/setGrabAlpha() with Preferences class 2015-05-13 11:46:49 -03:00
David Capello cff735a7c8 Remove unused variables 2015-05-11 10:40:23 -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 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 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 f1d522f548 Replace brush slots until the user presses the shortcut
We replace brush slots until the user presses its keyboard shortcut, which
means he is interested in reusing the brush. In this way, if we want to
keep a brush, we can press Ctrl+B, select the brush area, and then Alt+1
to keep the first brush, then the next brush slot will be used/replaced
until Alt+2 is pressed, etc.
2015-04-30 11:59:47 -03:00
David Capello 03faee9ce4 Add option to delete all brushes 2015-04-29 17:26:25 -03:00
David Capello f5b7fd84dc Connect to BrushPopup::BrushChange just one time 2015-04-29 16:34:21 -03:00
David Capello edbff42dc8 We can delete brushes right-clicking them and selecting "Delete" 2015-04-29 15:00:05 -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 b08b226aef Move active brush information to ContextBar 2015-04-28 18:21:33 -03:00
David Capello 303bd120dc Keep one instance of BrushPopup in memory 2015-04-28 12:53:02 -03:00
David Capello f09db4d9aa Add new BrushPopup (now the image brush is previewed)
This is the first step to create a bigger BrushPopup to select brushes
from an history of brushes. The general idea is to use Alt+1, Alt+2, etc.
to select different brushes from a stock.

Also the "discard brush" was removed. As the brush can be discarded
changing the brush type.
2015-04-28 12:38:15 -03:00
David Capello 51b6def023 Remove the "New Brush" button from the ContextBar 2015-04-27 12:07:23 -03:00
David Capello 96769d061e Rename BrushPattern::ALIGNED_FROM_SRC to ALIGNED_TO_SRC 2015-04-27 11:45:00 -03:00