Commit Graph

55 Commits

Author SHA1 Message Date
Ell
3b0040c043 app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()

g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58.  Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.

This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.

Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-18 14:39:56 -04:00
5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
b11aac154b app: remove useless "return" in GimpSpinScale 2018-05-30 00:35:18 +02:00
960b530d03 app: put back two lines that got lost in earlier GTK+ 3.0 porting 2018-05-20 21:06:32 +02:00
807e98b46c app: make spinscale much more bearable by fixing some coords 2018-05-20 21:06:32 +02:00
509813c1a9 spinscale: Decrease height 2018-05-20 21:06:32 +02:00
44b9bfe613 spinscale: remove our own border drawing 2018-05-20 21:06:32 +02:00
fde2df5539 spinscale: Fix styling 2018-05-20 21:06:32 +02:00
be6d77b915 app: undeprecate GimpSpinScale, still looks like shit tho 2018-05-20 21:06:30 +02:00
8c3a0d17f4 app: port GimpSpinScale to GTK+ 3.0 2018-05-20 21:06:27 +02:00
a31ee3ec22 app: fix outer border color of GimpSpinScale to look OK on all themes
it used to be "text" which is almost always too extreme; use "text_aa"
instead which is half way between "text" and "base" and always gives a
reasonable contrast.
2018-04-23 01:28:09 +02:00
4be9f84ed5 app: pass the GdkWindow to gimp_spin_scale_update,clear_target()
Another small thing to make maintaining gtk3-port easier.
2018-02-11 15:45:51 +01:00
Ell
e042393199 app: small cleanup in GimpSpinScale 2017-11-02 09:04:39 -04:00
Ell
ae851c34b4 app: avoid spin scale pointer wrap when value is at upper/loewr limit
When applying a relative adjustment to a spin scale, don't wrap the
pointer around the corresponding screen edge if the spin scale's
value is already minimal/maximal.
2017-11-02 02:36:39 -04:00
Ell
2bdf5372ba app: wrap pointer around screen edges during relative spin scale adjustment
While applying a relative spin scale adjusment (i.e., when dragging
from the lower half of the spin scale), wrap the pointer around the
screen edges (of the current monitor), so that the maximal possible
adjustment amount isn't artifically limited by the screen geometry.
This is especially useful for spin scales in dockables, since
dockables are normally placed near the edge of the screen.

When the mouse is released, move the pointer back to its initial
position (at the beginning of the drag), to allow for subsequent
adjustments.

Unfortunately, moving the pointer programatically isn't supported
on all envrionments (Wayland, Xephyr, ...), and worse yet,
detecting that the pointer failed to move is tricky, so we have to
resort to an ungly hack to maintain the current behavior in this
case.  Gah :P
2017-11-01 15:59:48 -04:00
Ell
90a024be54 app: improve spinscale target calculation
So pedantic... :)
2017-10-18 15:43:34 -04:00
Ell
8d90999814 app: highlight upper/lower halves of spinscales while hovering
When the mouse hovers over the upper or lower half of a spinscale,
highlight the corresponding area, to hint that the two halves
behave differently.  This seems to cause a lot of confusion, so the
different cursors are apparently not enough :P

We use a low-opacity version of the current theme's text color for
the highlight, since it should have a good contrast to both the bar
color and the background color.
2017-10-18 15:01:57 -04:00
0cb3e75f79 app: use a lot of g_clear_object() and g_clear_pointer()
More than 2000 lines of code less in app/, instead of

if (instance->member)
  {
    g_object_unref/g_free/g_whatever (instance->member);
    instance->member = NULL;
  }

we now simply use

g_clear_object/pointer (&instance->member);
2017-07-15 18:42:44 +02:00
aa6024dc93 app: don't leak all results from separate_uline_pattern() in GimpSpinScale 2014-10-06 20:34:22 +02:00
40cbbf8faf app: argh, so much for less stupid 2014-06-19 19:00:23 +02:00
5a4e9d0e03 app: make the new rounding code in GimpSpinScale less totally stupid 2014-06-19 18:56:43 +02:00
be80f49018 app: round mouse-entered GimpSpinScale values to the spinbutton's precision
So the adjustment's value is always what is shown (and can be entered
manually) in the widget. This way a GimpSpinScale will never change
its adjustment on focus-out, and not cause whatever unexpected updates
of its model and whatever is connected to it (like changing the
properties and thus unvalidating the caches of a Gegl graph).
2014-06-19 15:49:27 +02:00
aea161c9a5 app: also include <gegl.h> when we include "libgimpwidgets/gimpwidgets.h" 2013-11-01 22:28:18 +01:00
0a73a787ba app: remove GimpSpinScale's "factor" API again
The method of replacing the spinbutton's adjustment was just waiting
for some future bugs to appear.
2013-06-15 20:53:37 +02:00
0046f0eed6 app: fix gimp_spin_scale_set_factor() to not break if called more than once 2013-06-14 02:22:57 +02:00
766c4a026c app: add an optional "factor" to GimpSpinScale
which allows to display a value different from the original
adjustment's value.

This is sortof a hack but insanely useful to map normalized config
values to a nicer range (e.g. 0.0 -> 1.0 to 0 ->100).
2013-05-28 23:45:45 +02:00
bf3a1c89ef app: GimpSpinScale: the "none" keyval is GDK_KEY_VoidSymbol. not 0 2013-05-28 23:13:13 +02:00
4c0169aaaf app: add mnemonic support for GimpSpinScale's label 2013-05-28 22:46:22 +02:00
6940c00774 app: add gimp_spin_scale_set_label() and get_label() 2013-05-28 15:29:44 +02:00
fb6239320e app: reorder functions in GimpSpinScale so getter and setter are together 2013-05-28 15:19:04 +02:00
ce8ae69440 Bug 695687 - GimpSpinScale's label is unreadable on dark themes
Draw the label like GtkEntry draws its text: with different colors
inside and outside the progress bar.
2013-05-14 02:00:20 +02:00
85a099f988 Bug 688305 - drag and drop for guides broken if 'gtk-enable-tooltips = 0' is set
Fix GimpSpinScale too: add the needed events ourselves, and handle
motion hints (which the parent classes add) in motion().
2012-11-18 20:02:51 +01:00
f80b6a067a app: anal 2012-05-02 17:50:47 +02:00
8994acc6a8 app: handle negative fractions correctly in spinscale 2012-05-02 17:50:45 +02:00
d7e9c6b7fe app: git_spin_scale invoke value_changed when setting gamma 2012-05-02 17:50:44 +02:00
5666697362 app: initialize gamma of spin scale to 1.0 2012-05-02 17:50:44 +02:00
7181402a62 app: clean up warning in spinscale 2012-05-02 17:50:44 +02:00
553b7c7c03 app: add configurable nonlinear mapping (gamma) to spinscale widget
The default value is 1.0 which is linear and the old behavior, values above
1.0 gives finer control in the lower portions of the range, the lower half of
the widget behaves like before doing small relative adjustments.
2012-05-02 17:50:44 +02:00
b1483144cf app: remove unused variable in GimpSpinScale 2012-02-22 23:38:35 +01:00
aadfc82f11 app: various GimpSpinScale fixes
- make it respect RTL mode better, something is still weird though
- don't fiddle with the entry's inner_border
- place label and number on the same line
- adjust size_request to respect the label's requisition
- set the label to ellipsize
2012-02-22 22:48:42 +01:00
4a8fa1ab2a app: make GimpSpinScale RTL aware 2011-04-20 20:12:21 +02:00
3edf0cb531 app: GimpSpinScale: don't create two cairo_t in expose() 2011-04-20 00:43:30 +02:00
6dd463fb02 app: gimp_spin_scale_change_value(): remove "+ lower" from step calculation
It was never noticed because lower is 0.0 or 1.0 in all use cases.
2011-04-18 21:21:45 +02:00
d300ec6556 app: add a "scale_limit" API to GimpSpinScale
which allows to restrict the scale to a range that is smaller than
that of the model GtkAdjustment. This way we can enter large values in
the entry or by dragging beyond the end of the scale, but keep a
reasonably usable scale range for "normal" values.
2011-04-18 21:01:48 +02:00
854dd5b6ad app: correct cast for spinbutton 2011-04-16 11:52:49 +02:00
924d647284 app: set GimpSpinScale to numeric-only input
It's the right thing to do, but also works around focus issues in SWM,
at least while the widget has the focus.
2011-04-16 02:09:37 +02:00
24ee3370b8 Depend on GTK+ >= 2.24.3, cairo >= 1.20.1, gdk-pixbuf >= 2.22.1
and completely separate configure and sanity checks for gdk-pixbuf
from GTK+, because it's now distributed as a separate package. Remove
all sorts of conditional compiling based on GDK_CHECK_VERSION() and
CAIRO_VERSION.
2011-04-06 19:58:24 +02:00
39fa147c17 app: unset GimpSpinScale's context sensitive cursor when the pointer leaves 2011-04-04 01:10:44 +02:00
61aa1854fd app: make GimpSpinScale's slow part change the value 10x slower than the fast part 2011-03-18 15:42:50 +01:00
f1d1bb610d app: experimentally add fine-tuning to GimpSpinScale
by making the lower part change things in small steps.
2011-03-18 15:07:44 +01:00