Commit graph

24 commits

Author SHA1 Message Date
Alx Sa
9bef3b2edd widgets, themes: Fix bug with selection...
background color. Resolves #9983.

We now check the parent widget's color
first to prevent issues with the selection
altering the background color of the
icon until the view is refreshed.
As a result, we can now define the
selected color of an icon, fixing a
regression from 2.10.
2025-05-22 21:14:20 +00:00
bootchk
69fedf6995 Fix #10475 double popup context menu on RMB in dockable chooser
Chooser return GDK_EVENT_STOP so parent manager does not also popup second menu.
Specifically, return the result of the call to gimp_editor_popup_menu_at_pointer.
When a menu does pop up (for a dockable), that result is GDK_EVENT_STOP
and the event does not propagate to the parent widget.

Added a comment about why we ignore the result of a call
to gimp_editor_popup_menu_at_pointer in another place,
since it is not obvious why that call is different.

All other current behavior retained.
Other current behavior might be separate issue:
LMB or RMB outside any item, or in the current selected item,
in the chooser that popups from the toolbox,
should probably close the popup chooser, or give an audible alert,
because it does nothing.
Note that a chooser is also used in a remote dialog for a plugin,
and it closes a different way, choosing an OK button.
2024-01-25 14:13:00 +00:00
bootchk
6aa9f97819 Fix #10690 build broken on GLib < 2.74
Use 0 instead of new symbol G_CONNECT_DEFAULT first defined in glib2.74
2024-01-24 13:30:10 -05:00
bootchk
784cde7f14 Fix #10496 crash on RMB in chooser item not the current selection
Use g_signal_connect_object to ensure object passed to handler
is not destroyed in the middle of the handler by knock-on signal handling.

Note there are comments about this in gimpcontainertreeview.c line 1592.
And similar code i.e. calls to gimp_container_view_get_container
that seem to be intended to solve but might actually also be susceptible.
Those calls in icon view throw CRITICALs during this issue.
But testing of the tree view (a list instead of a grid)
doesn't seem to crash, so leave well enough alone.
2024-01-22 18:29:20 +00:00
Jehan
28457ce337 app: display the floating mask over the layer mask.
It would make using floating masks a lot easier as it is visually understandable
that it applies to the layer mask.
2022-11-09 02:15:41 +01:00
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