Commit Graph

1590 Commits

Author SHA1 Message Date
Elle Stone d13fa3900a Bug 749902 - Add Hue-Chroma operation/tool and LCH color selector
This patch increases the LCH Chroma slider maximum value from 100 to
200 and also makes the Chroma slider properly display out of gamut
Chroma selections for any given Hue/Lightness combinations.

The current Chroma slider only runs to 100. But quite a few sRGB
colors have LCH chroma values that are greater than 100. For example
reddest red has a chroma of 107, and bluest blue has a chroma of 131.
So it's inconvenient to have to deal with a Chroma slider limit of
100.

Also, the current Chroma slider doesn't properly show out of gamut
areas on the Chroma slider. So for example picking a given LCH Hue and
then moving the Lightness slider doesn't allow to see which Lightness
value allows for choosing the maximum in-gamut chroma for the chosen
Hue.
2017-07-16 15:13:11 +02:00
Jehan e5bdaa3f0f libgimpwidgets: fix some weird indentation. 2017-06-27 21:31:10 +02:00
Jehan 28d3897086 libgimpwidgets: fix typo s/shold/should/. 2017-06-27 21:31:10 +02:00
Alexandre Prokoudine 0098eedb81 Fix gimpicons.c, reorder items 2017-06-12 03:38:36 +03:00
Alexandre Prokoudine 70b389a7b1 Cherry-pick template updates from icons-wip branch by Klaus Staedtler 2017-06-12 03:24:32 +03:00
Michael Natterer f9ee38ea33 libgimp: add blurbs to all object properties for the docs
and some minor doc fixes.
2017-06-06 21:19:17 +02:00
Michael Natterer caef6d0deb libgimp*: various doc fixes 2017-06-03 21:22:12 +02:00
Ell 3ca48a0b30 enums: don't use comments in generated enum recipes
Works in bash, but apparently not portable.
2017-06-02 11:15:43 -04:00
Ell e64e61ca58 libgimpwidgets: call babl_exit() when unloading
If the compiler supports destructors (which should cover at least
GCC and Clang), pair the call to babl_init() in gimp_widgets_init()
with a call to babl_exit() when the library in unloaded.  This is
important in particular since the babl fish cache is constructed/
updated upon the last matched call to babl_exit().
2017-05-31 22:14:45 -04:00
Ell 1176482b4b libgimpwidgets: don't babl_init() in gimp_color_scale_class_init()
Woohoo!  We can actually inject this into the gtk-doc thingy!
2017-05-31 22:14:42 -04:00
Michael Natterer 6978094978 libgimpwidgets: make GimpColorButton set GimpColorConfig on the color dialog
it didn't even remember its GimpColorConfig, so had no chance of
setting it on the dialog's GimpColorSelection.
2017-05-28 16:41:01 +02:00
Michael Natterer 937900d618 Bug 783166 - Script-Fu color selector crashes
libgimpwidgets now needs an initialized babl if color selectors are
used, call babl_init() in gimp_widgets_init(). It can be safely called
redundantly.
2017-05-28 16:32:52 +02:00
Ell 5bcde32caf enums: run gimp-mkenums from the build dir
Commit 1e6acbd4e1 modified the
generated enum recipes to run gimp-mkenums from the source
directory, instead of the build directory, so that only the
basenames of the corresponding header files would appear in
the comment at the top of the generated files.  This was a
mistake -- $(GIMP_MKENUMS) is expecting to be invoked from the
build directory.

Switch back to running gimp-mkenums from the build directory.  To
avoid including the relative path from the build directory to the
source directory in the generated file, add a @basename@ production
variable to gimp-mkenums, which exapnds to the basename of the
input file, and use it instead of @filename@ in the recipes for the
generated enum files.
2017-05-22 20:29:18 -04:00
Ell f9fa0d1b18 enums: don't write generated enum files to src-dir if unchanged
When regenerating an enum file, don't copy it back to the source
directory if it hasn't actually changed.  This allows using a read-
only source directory where the enum header is newer than the
generated file, as long as they're not really out of sync.

OTOH, *do* touch the generated source-dir file even when unchanged,
in order to avoid re-running its recipe on the next build, however,
allow this to silently fail (which is harmless).
2017-05-22 17:58:04 -04:00
Michael Natterer 49469091b8 libgimpwidgets: reorder some code in gimp_scale_entry_new_internal()
just to keep the diff small for an hack on the gtk3-port branch.
2017-05-22 22:53:50 +02:00
Michael Natterer c61500066c libgimpwidgets: a bit of s/GtkObject/GtkAdjustment/
only the GtkObjects in the public API left now, can't change these until 3.x
2017-05-22 22:39:28 +02:00
Michael Natterer 1ec2e2eb2f libgimpwidgets: a little s/GtkObject/GtkAdjustent/ in gimpscaleentry.c 2017-05-19 12:07:19 +02:00
Michael Natterer 331fc27f11 libgimpwidgets: draw GimpColorArea's border on top of the oog indicator
and reduce the indicator to 2/3 of the area's shorter side.
2017-05-19 11:54:59 +02:00
Michael Natterer c4dfef0779 libgimpwidgets: add an out-of-gamut indicator to GimpColorArea 2017-05-19 11:00:38 +02:00
Michael Natterer 6ab57a12cf Bug 749902 - Add Hue-Chroma operation/tool and LCH color selector
Last bit for now: allow GimpColorScales' spinbuttons to go further
than its color scales. Please review the new min/max values of the
individual channels.
2017-05-18 19:53:47 +02:00
Michael Natterer 0c2ec6ad86 libgimpwidgets: simplify gimp_scale_entry a lot by using GBindings
Always use separate GtkAdjustments for the scale and the spinbutton,
and link them with a GBinding, either 1:1 or using logarithmic
transform functions.

This change also enables modifying both widgets' ranges independently
after construction, thus enabling the "constrain" feature also for
gimp_color_scale_entry_new().
2017-05-18 18:24:35 +02:00
Michael Natterer 9d482309bb libgimpwidgets: mark out-of-gamut colors also in the RGB and HSV color areas
instead of showing weird clipped or wrapped RGB values.
2017-05-18 17:59:49 +02:00
Michael Natterer 2b167d6337 Bug 749902 - Add Hue-Chroma operation/tool and LCH color selector
Add LCH to the color selectors, patch by Elle Stone and myself.

- Extend enum GimpColorSelectorChannel by LCH channels
- Support them in GimpColorScale, GimpColorScales and GimpColorSelect
- Did not yet remove the HSV channels until things are working 100% ok
- Change drawing in GimpColorSelect to be much faster, to compensate
  for babl_process() making the LCH modes pretty slow
- Clean up stuff in GimpColorSelect

This is WIP and should not be considered finished, biggest TODO is
displaying out-of-gamut values in GimpColorScales' spinbuttons.
2017-05-17 19:28:40 +02:00
Michael Natterer 89641ec5ea libgimpwidgets: gimp_prop_enum_combo_box_new(): reorder GimpSelectCriterion
so Alpha is not between the HSV and LCH group; put it after R, G, B.
2017-05-10 11:48:31 +02:00
Michael Natterer db4e120b8b libgimpwidgets: fix code duplication in gimp_prop_enum_combo_box_new() 2017-05-09 19:07:39 +02:00
Ell 1e6acbd4e1 enums: generate enum files in source dir
We check them into git, so this makes it easier to keep them in
sync when using a separate build directory.

Case in point -- this commit also syncs a few enum files that went
out-of-sync with their headers.
2017-05-06 17:26:16 -04:00
Michael Natterer ecb346a945 libgimpwidgets: gimp_prop_boolean_combo_box_new(): use a GimpIntComboBox
so we can set its "ellipsize" property. Except that this doesn't seem
to work, no idea why.
2017-05-01 00:41:28 +02:00
Éric Hoffman c585c99e80 Bug 740634 - Color picker crashes when there are multiple monitors
Use Windows API directly to get a screen pixel, works for all kinds of
monitor layouts.
2017-04-06 23:52:09 +02:00
Jehan 8322ffdac4 libgimpwidgets: some minor tab cleaning. 2017-03-24 15:16:15 +01:00
Jehan f861585051 libgimpwidgets: entry width of gimp_prop_size_entry_new() is too small.
One cannot just use the min/max values since the precision digits must
also be accounted for (as well as one additional character for the
decimal separator).
Current implementation is not perfect yet because GimpSizeEntry code
itself does not yet use gimp_unit_get_scaled_digits(). Moreover the
entry size could be updated when changing units (or the original size
be actually based of the bigger width considering every possible unit).
2017-03-23 02:45:47 +01:00
Michael Natterer 461d807b05 libgimpwidgets: order enum combos of GimpDesaturateMode more logically
This is a bad hack that hardcodes a special case for
GIMP_TYPE_DESATURATE_MODE right into gimp_prop_enum_combo_box_new(),
we should think of something better if we get more special cases.
2017-03-17 22:50:12 +01:00
Michael Natterer e2ff186861 Bug 779942 - Make GimpPickButton honor monitor profile
Pass the right flags to gimp_color_transform_new(), and handle a NULL
return value.
2017-03-13 09:06:00 +01:00
Michael Natterer 064c4527cb Bug 779942 - Make GimpPickButton honor monitor profile
Convert the picked pixel from the monitor color profile to sRGB.
Only changed the default impl, not the quartz code.
2017-03-12 23:30:03 +01:00
Michael Natterer 4a75f33c07 libgimpwidgets: s/"document-open"/GIMP_ICON_DOCUMENT_OPEN/ in GimpFileEntry 2017-03-10 23:00:04 +01:00
Michael Natterer dda54c1df8 Deprecate stock items for good and change all icon defines to GIMP_ICON_*
Try to sort all GIMP_ICON_* defines into FDO categories like in
https://specifications.freedesktop.org/icon-naming-spec/latest/ar01s04.html

Add defines for all icons we override, rename some icons to their FDO
standard names, and mark the ones we duplicate with a comment so we
don't forget to rename those to standard names in 3.0.
2017-03-05 16:01:59 +01:00
Michael Natterer 91e861adcc libgimpwidgets, *: deprecating stock IDs for good, part one...
Remove all stock items added since 2.8, restore accidentially removed
ones, and rename the newly added GIMP_STOCK_* defines to GIMP_ICON_*.

(will move to having GIMP_ICON_* defines instead of magic hardcoded
strings for all icons).
2017-02-28 19:31:27 +01:00
Ell 2cb26a040a libgimpwidgets: invalidate the rulers' backdrop when the widget style is changed
... in particular, when swithcing themes.

Otherwise, the rulers keep their old, mismatched, style, until the
ticks are updated.
2017-02-27 05:03:59 -05:00
Michael Natterer b119fc995a libgimpwidgets: show help buttons in dialogs again
GimpDialog's "help-id" property didn't have G_PARAM_CONSTRUCT.

Broken since commit a940300525.
2017-02-12 16:32:41 +01:00
Michael Natterer 40981f43cf libgimp*: get rid of icons in dialog buttons (use labels not stock IDs) 2017-02-12 16:18:54 +01:00
Michael Natterer eb9981e5e4 libgimpwidgets: add gimp_screen_get_color_profile()
and use it in gimp_widget_get_color_profile(). Will soon be used in
screenshot too.
2017-01-31 18:58:27 +01:00
Hartmut Kuhse 66bc98d299 Revert "New GimpMetadata as subclass of GExiv2Metadata"
This reverts commit 3ab08c8bfd.
2017-01-03 19:36:22 +01:00
Hartmut Kuhse 3ab08c8bfd New GimpMetadata as subclass of GExiv2Metadata 2017-01-03 19:26:35 +01:00
Øyvind Kolås c9520bae6d libgimpwidgets: make color chooser scales range to 100.0 instead of 255
Still using perceptual TRC - making 50% middle gray.  This for all of 8bit and
16bit integer, as well as for floating point precisions. Also added a decimal point, to make use of more precision for both RGB and HSV entries.
2016-12-30 17:45:00 +01:00
Ell 3c2b4df6e6 libgimpwidgets: handle invalid enum values in gimp_enum_store_set_icon_prefix()
If the store has invalid enum values the function segfaults,
instead of just ignoring them.  We use -1 to represent separator
rows in the layer mode combo; if we end up adding icons to this
combo, we need it... not to segfault.  Since this is public API,
it should probably be prepared to handle such uses regardless.
2016-12-28 19:51:16 -05:00
Michael Natterer 956d45bf61 libgimpwidgets: add property GimpCellRendererToggle:override-background
which makes the cell paint its background color even when the row is
selected.
2016-10-29 16:47:36 +02:00
Michael Natterer 8e65aca452 Bug 773334 - GimpColorScale's scrolling behaviour is inverted...
...(scroll up decreases the value)

Implement GtkWidget::scroll_event() and turn GDK_SCROLL_UP into RIGHT
and DOWN into LEFT. The default behaviour or good for scrollbars but
not for widgets where "right" == "higher value" == "up" like
GimpColorScale.
2016-10-23 18:38:06 +02:00
Jehan 15d9f4a354 icons, libgimpwidgets: delete "gimp-path-(new|up|down|delete)" icons.
Commit 82737bf got rid of the only pieces of code where these icons were
used. Since they were never available in any version release of GIMP,
let's delete them from libgimpwidgets API as well.
2016-10-02 19:48:48 +02:00
Michael Natterer 12cb09836a Bug 772303 - preferences > folders don't have tooltips
Add tooltips to all buttons and indicators of GimpFileEntry and
GimpPathEditor.
2016-10-01 21:44:59 +02:00
Michael Natterer 82737bf904 libgimpwidgets: don't use GIMP-specific icons for GimpPathEditor
These are file search paths, not vector shape paths, so the new icons
were using the wrong metaphor.

This reverts the only functional part of commit
92a9117ae0, we should
probably get rid of the icons too (they are now unused).
2016-10-01 21:14:03 +02:00
Michael Natterer e8309826b7 app, libgimpwidgets: use the new config path <-> GFile functions
Gets rid of temporary variables to hold both expanded and unexpanded
paths.
2016-09-30 22:07:00 +02:00