Commit Graph

1643 Commits

Author SHA1 Message Date
Kristian Rietveld ce3899e722 libgimpwidgets: gimppickbutton-quartz: do not release color_space
The color_space reference should not be released because it was obtained
with a Get-function, which means we do not have ownership.
2018-03-26 22:59:01 +02:00
Kristian Rietveld 0e9e167da8 libgimpwidgets: make pick button quartz work on macOS < 10.12
The symbol CGColorSpaceCopyICCData() is only available on macOS 10.12
and higher. We want GIMP to run from 10.9 onwards, so use the older
symbol CGColorSpaceCopyICCProfile() even though this one is deprecated.
2018-03-26 22:59:01 +02:00
Michael Natterer 8447e775ab Bug 783680 - Allow to hide color models in GimpColorScales
Redo the entire thing again:

- Rename the values of enum GimpColorSelectorModel to include "MODEL"
- Change GimpColorSelector API from set_model() to set_model_visible()
  so visibility of each model can be toggled individually and is not
  exclusive any longer
- The GUI is back to what it was before, except that the "GIMP" page
  now honors the model visibility and has a resonable minimum height
2018-03-19 23:11:27 +01:00
Jehan 6c8300923d Bug 779942 - Make GimpPickButton honor monitor profile.
Quartz/macOS implementation for the color picker.
This is untested but I am trying to advance our 2.10 blockers by
implementing the base code for this feature. Please anyone with macOS
machine access, review and fix if needed!
2018-03-16 17:17:54 +01:00
Lionel N 827d747fae Bug 400448 - ruler subdivision is wrong for inches
Add ruler subdivisions for feet and yards, the code is still disabled.
2018-02-27 23:27:00 +01:00
Ell cd8ea6b3ca libgimpwidgets: in GimpNumberPairEntry, add clear icon
Since the entry behaves differently based on whether the user
provided an explicit input or not, it makes sense to have a button
for clearing the entry.
2018-02-27 03:55:34 -05:00
Ell 45bfa168bf libgimpwidgets: in GimpNumberPairEntry, update font when updating text
... in particular, so that the font is updated correctly when
reverting an invalid string.
2018-02-27 03:55:34 -05:00
Ell 8d2381f6e7 libgimpwidgets: in GimpNumberPairEntry, fix parsing
... to classify strings beginning with a non-digit character as
INVALID, rather than CLEAR.
2018-02-27 03:55:33 -05:00
Ell 0de25a145a libgimpwidgets: in GimpNumberEntryPair, properly set user-override ...
... when focus is lost/enter is pressed

When a GimpNumberPairEntry loses focus, or when enter is pressed,
set its user-override property by calling
gimp_number_pair_entry_set_user_override(), instead of setting the
corresponding member directly, so that the entry's font is updated
correctly.
2018-02-25 03:09:25 -05:00
Jehan 56d0998e74 icons, libgimpwidgets: fixing indentation and cleaning out tabs. 2018-02-24 15:58:26 +01:00
Jehan 6a9c4f8ef1 icons, libgimpwidgets: now with proper gimp-attach + gimp-detach icons.
"gimp-detach" does not just use "gtk-convert" anymore and has its own
design. As for "gimp-attach", this is not used anywhere (yet), but it
could be soon as reverse action of gimp-detach. For instance, this icon
can be used for bug 791859 when we implement re-attaching overlay
dialogs.
2018-02-24 01:27:56 +01:00
Michael Natterer e93f458026 libgimpwidgets: change disabled code in GimpRuler to avoid a warning 2018-02-22 09:48:03 +01:00
Michael Natterer fd37737fe4 Bug 400448 - ruler subdivision is wrong for inches
This commit changes nothing, but contains disabled proof-of-concept
code to use different ruler subdivisions depending on the ruler's
unit.
2018-02-12 12:20:32 +01:00
Michael Natterer cc97a87257 libgimpwidgets: propwidgets: don't g_object_set() the same value again
Normally, the model would try to avoid notifications when a set()
doesn't change anything, but with g_object_set() that's not possible.

Do the same in the propwidgets' callbacks and avoid potentially
expensive notifications at the cost of a cheap g_object_get().

Also fix the syntax of "Since:" and "Deprecated:" annotations.
2018-02-04 19:56:55 +01:00
Jehan de81e33340 libgimpwidgets: add missing gimp_color_selector_model_get_type in def...
... file.
2018-01-26 15:49:56 +01:00
Michael Natterer 13b640f84c libgimpwidgets: restore ABI of GimpColorSelectorClass
Public structs must not change, that's why we have padding at the
end for extension.
2018-01-22 13:04:54 +01:00
Jehan 54a1e8f2b1 libgimpwidgets: use g_return_if_reached() in unreachable code path.
This way, we get proper CRITICAL if ever there is a logic error (or in
this case, if we add new values to enums and forget to append them to
switch cases.
This will make these bugs much easier to debug if (when!) they happen.
2018-01-22 11:28:09 +01:00
Jehan 90037116e4 libgimpwidgets: oups, fix some stupid miswrite.
Unfortunately not very problematic, unless when setting alpha channel.
2018-01-22 01:08:32 +01:00
Jehan 4d84925db0 Bug 783680 - Allow to hide color models in GimpColorScales.
GimpColorSelect now using color models tabs too.
2018-01-21 19:00:20 +01:00
Jehan 37e9be3a4f libgimpwidgets: arrange color models in tabs in GimpColorScales.
This allows to have a smaller and cleaner color dock instead of just
listing all possible channels (which may only grow up as we may add more
color spaces).
The API gimp_color_scales_(set|get)_show_hsv() are removed in favor of
more generic gimp_color_selector_(set|get)_model(). I assume this is
ok since they have only been available in the dev version (commit
6258d525ae, a month ago).
2018-01-21 18:37:18 +01:00
Alexandre Prokoudine 940a5866a9 Add symbolic icons for linear/perceptual color spaces 2018-01-06 01:49:17 +03:00
Alexandre Prokoudine 78821b4cb9 Add icons for Shadows-Highlights 2018-01-05 21:03:42 +03:00
Michael Natterer 467a663f16 libgimpwidgets: return TRUE in GimpColorProfileChooserDialog's "delete-event"
Otherwise the dialog is automatically destroyed when e.g. pressing
Escape, which the code doesn't expect, leaving dangling (crashing)
ponters around.
2018-01-02 22:10:10 +01:00
Michael Natterer 6f7b1d6425 libgimpwidgets: add new GimpColorScales symbols to gimpwidgets.def 2018-01-02 03:59:28 +01:00
Michael Natterer 1e99b12aba libgimpwidgets: several GimpColorSelector cleanups / changes
- make RED the default channel and reorder RGB before LCH/HSV
- use more of the new getters
- also use more of the previously existing setters
2017-12-31 19:05:54 +01:00
Michael Natterer 6258d525ae Bug 770054 - High bit-depth color selection widgets
This is WIP in the middle of cleaning up GimpColorSelector subclasses:

Add the possibility to switch between LCH and LSV and between 0..100
and 0..255 RGB in to GimpColorScales. Works almost fine, but needs
different UI to change the options...
2017-12-31 17:53:13 +01:00
Michael Natterer 6263e25dd9 libgimpwidgets: don't add new stock IDs, they are all deprecated
Instead, add GIMP_ICON_* defines for new icons.
2017-12-31 16:10:14 +01:00
Michael Natterer dd06ebafa2 libgimpwidgets: add a getter for every setter of GimpColorSelector
Also add API docs, pretty basic ones.
2017-12-31 16:02:21 +01:00
Alexandre Prokoudine b7d2c5eab1 Add Exposure tool icon, remove erroneous stock entry for the colortemp icon 2017-12-28 04:11:55 +03:00
Alexandre Prokoudine c281fca1c0 Fix variables for the new icons 2017-12-27 07:49:52 +03:00
Alexandre Prokoudine 4d11e2b184 Add colortemp icons to the build 2017-12-27 07:49:52 +03:00
Ell 981e8dcdfe app, menus, icons: add dashboard dockable
The dashboard dockable shows the current GEGL cache and swap sizes,
and their recent history.  It has options to control the update
rate and history duration of the data, and an option to warn (by
raising/blinking the dialog) when the swap size approaches its
limit.
2017-12-18 19:42:23 -05:00
Jehan ef6559b38f libgimpwidgets: add private headers for GimpPickButton implementations.
Though forward declarations of the implementations are ok, it is cleaner
to have proper header files for each variant (default, kwin, quartz
right now). Of course these new header files are not installed and must
be kept private for build only.
2017-12-09 00:05:08 +01:00
Jehan 06bbf3e436 Bug 780375 - Color picker won't pick on Wayland.
Add support for KWin API, for KDE on Wayland.
Unfortunately though, KWin's "pick" API seems to have failures, so I
fallback to the default color picking when this happens. This will still
not work on Wayland, but at least won't cause regression for color
picking on KDE/X11.
See also KDE bug: https://bugs.kde.org/show_bug.cgi?id=387720
2017-12-08 23:37:24 +01:00
Ell 0830fe8923 libgimpwidgets, app: make ABBREVIATED default GimpIntComboBox layout
There's no real reason not to do it (has no visible effect if the
model has no abbreviations to begin with), and it means less
special casing.
2017-12-01 09:22:42 -05:00
Ell ed2fe2d2d1 libgimpbase, libgimpwidgets: add new functions to .def files 2017-12-01 05:27:55 -05:00
Ell 8e51e7c351 libgimpwidgets: fix return type of gimp_int_combo_box_get_layout()
... and a small cleanup.
2017-12-01 05:12:42 -05:00
Ell 0f43dedfb5 libgimpwidgets: use ABBREVIATED layout for GimpEnumComboBoxes ...
... using enum models with abbreviated labels
2017-11-30 03:10:14 -05:00
Ell 47ac6111de libgimpwidgets: add "layout" property to GimpIntComboBox
The "layout" proerty controls the combo-box layout (but not its
menu layout), and can be one of:

  - ICON_ONLY:  Only show icons.

  - ABBREVIATED:  Show icons and abbreviated labels (or full
    labels, when there is no abbreviation).

  - FULL:  Show icons and full labels.  Default.

Avoid reconstructing the combo's cell-layout when the menu is
shown/hidden, by maintaining the combo's cell-layout and the menu's
cell-layout separately (probably a terrible hack, but one we already
use :P).
2017-11-30 03:10:14 -05:00
Ell 658d07dffe libgimpwidgets: fill ABBREV column in GimpEnumStore
Use gimp_enum_value_get_abbrev() to fill the ABBREV column of
GimpEnumStore.
2017-11-30 03:10:14 -05:00
Ell 684c850196 libgimpwidgets: add ABBREV column to GimpIntStore
... which holds an abbreviated label, or NULL to use the normal
label.
2017-11-30 03:10:14 -05:00
Ell f7d6805ebb */Makefile.am: add abbreviations to generated enum files
Update the dprod production of generated enum files to include
abbreviated value descriptions, as per the previous commits.

Add a comment for translators above the abbreviated descriptions,
specifying the full description they abbreviate.
2017-11-30 03:10:14 -05:00
Ell fa25b476be icons, modules, libgimpwidgets: add clip-warning display filter icon
... and use it instead of gimp-warning.
2017-11-23 13:34:49 -05:00
Ell 0323541d86 Bug 780375 - Color picker won't pick on Wayland
In GimpPickButton, try to pick from the local window under the
cursor, before falling back to picking from the root window, so
that we can at least pick from local windows on Wayland.
2017-10-31 11:21:44 -04:00
Ell 9fee677b5c libgimpwidgets: use default unit for eevl ratio quantity in size boxes
Pass the ratio quantity to be used for eevl ratio expressions in
terms of the default unit of the size box, instead of as a
dimensionless value.
2017-10-05 08:54:10 -04:00
Ell f2a80a093a libgimpwidgets: enable ratio expressions for size entries with two fields
When a size entry has exactly two fields, enable ratio expressions
in eevl.  Set the reference value to the value of the field that is
not currently being evaluated, and invert the ratio when evaluating
the second field.
2017-10-04 14:25:01 -04:00
Ell 6caae9c53b libgimpwidgets: add ratio expressions to eevl
Ratio expressions have the form 'x : y' (the ':' operator has the
highest precedence for a binary operator, and is left-associative).
Given a reference value 'a', the expression evaluates to
'a * (x / y)'.

Ratio expressions can be controlled by the caller by:

  - Enabling or disabling them:  They're meant to be used when the
    eevl servers two paired entries, and can be disabled otherwise.

  - Setting the reference value:  That's normally the value of the
    "other" entry of the pair--the one not currently being
    evaluated.

  - Inverting the ratios:  Normally, one entry refers to the
    antecedent term of the ratio, and the other entry refers to the
    consequent term of the ratio.  When evaluating the latter one,
    the ratio should be inverted.
2017-10-04 14:25:01 -04:00
Ell 7362d47922 libgimpwidgets: use struct, not parameters, to pass eevl options
Pass the evaluation options to gimp_eevl_evaluate() using a single
parameter of type GimpEevlOptions, instead of using individual
parameters for each option.  Add a GIMP_EEVL_OPTIONS_INIT macro,
used to initialize a GimpEevlOptions struct to the default set of
options.  This would allow us to add evaluation options more
easily.
2017-10-04 14:25:01 -04:00
Michael Natterer 582c6edd54 libgimp*: use some g_clear_object() and g_clear_pointer() 2017-09-03 15:14:51 +02:00
Ell 188a82552b libgimpwidgets: fix double $(AM_V_GEN) in Makefile.am
Due to commit 0ef3795f0a.
2017-08-28 16:50:25 -04:00