Commit Graph

19 Commits

Author SHA1 Message Date
Jehan 60bf8cd87e app: fix selecting an object in an icon view.
We must make sure to care about slight discrepancies between context
object and actually selected icon representing an object, which might be
slightly different at selection change time (just before everything
syncs up).
2021-12-23 13:43:51 +01:00
Jehan 8faf6a832c app: get rid of GimpContainerViewInterface select_item signal.
Now that we have implementations for select_items everywhere and that
all the code is only wired to call or handle select_items, the single
item variant select_item is of no use anymore. Let's make a big cleanup.
2021-12-23 12:55:11 +01:00
Jehan a404500f3e app: add a select_items() implementation on various classes…
… implementing GimpContainerViewInterface.
2021-12-23 12:55:11 +01:00
Niels De Graef eed28c0941 app: Popup menu at rect in GimpEditor
Rather than trying to fix up our own heuristics using a
`GtkMenuPositionFunc`, use whatever GTK provides to position given a
specific rectangle, which also has the benefit of nicely integrating
with GDK backends such as Wayland. Another advantage is that we can use
GdkGravity to center the popup.

Since GTK 3, GtkWidget also gained a "popup-menu" signal, which we
can/should use instead of rolling our own context signals.
2021-12-13 20:57:21 +01:00
Jehan 288bec3b79 app: add a "select-items" signal to GimpContainerView.
Properly pass the multi-selection information through the container
classes. Previous implementation was incomplete (most code paths with
multiple item selected were just ignored) and data was passed through
the "select-item" signal with the GimpViewable to NULL and the data to a
list of items (instead of being a GtkTreeIter otherwise). Having a
pointer data which changes meaning in the same function/class is not the
best idea. So instead "select-items" will have 2 list as parameters: a
list of items and a list of GtkTreePath to be used similarly and with
less ambiguity.
2020-05-17 18:32:15 +02:00
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
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Michael Natterer f294d5e1af app: gimp_container_icon_view_select_item() must only select one item
Call gtk_icon_view_unselect_all() before gtk_icon_view_select_path()
or we end up with an unintended multi-selection.
2018-06-28 23:32:20 +02:00
Michael Natterer ed1d57a882 app: port GimpContainerIconView to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 1a82e4adce app: add ugly workaround to make the icon view adapt to view size changes 2018-05-20 21:06:27 +02:00
Michael Natterer 908f727f0a Chain up unconditionally in GObject::constructed()
It's supported since GLib 2.28.
2012-11-12 21:51:22 +01:00
Michael Natterer 867da8f293 app: add gimp_context_get_foreground,background_pixel()
which takes a Babl format to convert from/to.
Include <gegl.h> in a million places.
2012-05-02 17:50:41 +02:00
Michael Natterer fcfb7cf160 Use the new g_[s]list_free_full() instead of foreach() and free() 2011-03-07 17:11:28 +01:00
Michael Natterer 30e847c921 app: forgot to implement dragging from GimpContainerIconView 2011-03-01 15:32:08 +01:00
Michael Natterer 202124c438 app: implement GObject::constructed() instead of ::constructor() 2011-01-14 09:38:46 +01:00
Michael Natterer 8a1517f18b app: properly select icon view items
so that they are visually selected also when the widget never got
focus.
2010-10-21 11:53:41 +02:00
Michael Natterer c60e29254b app: don't try to set properties of a NULL icon view 2010-10-21 11:38:58 +02:00
Martin Nordholts ed630a1852 app: Remove unused variables and dead code 2010-06-24 22:46:20 +02:00
Michael Natterer e6983567f2 app: add GimpContainerIconView, a new GimpContainerView based on GtkIconView
This is supposed to finally replace GimpContainerGridView along with
GtkWrapBox. The code is experimental and currently even crashes
without a modified GTK+, so it's disabled. Keeping it in GIT makes
developing easier though.
2010-06-03 22:19:09 +02:00