Commit Graph

162 Commits

Author SHA1 Message Date
Michael Natterer 3ed305f6f5 libgimpwidgets, app: have all previews track the monitor they are on
and update their color transforms with the new monitor's color
profile. A widget is considered changing monitors when its toplevel
window's center crosses, in order to let widgets within one window
have consistent colors.
2016-06-01 22:42:00 +02:00
Michael Natterer 1125f4df0f app: make sure icons in GimpContainerTreeView follow icon theme changes 2015-12-11 22:46:37 +01:00
Jehan 0aae50cfe2 Bug 750556 - validate a tree cell modification on focus out.
For instance, modifying a layer and going directly to draw in the canvas
should not cancel the layer name.
You can still cancel a layer renaming in progress with ESC.
2015-06-14 14:03:16 +02:00
Michael Natterer 55e8528eff app: GimpContainerTreeView: keep a reference on tree_view->model
during the lifetime of the widget. Leaving that up to the GtkTreeView
was working for mysterious reasons even during destruction of the
widget. It's safer and cleaner this way.
2014-06-06 22:48:35 +02:00
Michael Natterer 0d2d1c3752 app: port most of app's GUI from stock IDs to icon names
There is still quite some stock ID rendering around, stay tuned...
2014-05-07 15:30:38 +02:00
Michael Natterer 78ad0327da app: add new accessor gimp_container_tree_view_get_name_cell() 2013-11-07 11:32:23 +01:00
Jehan 3e082b356c Bug 681709 - GimpContainer continuously scrolls on dnd failure on Windows.
The scroll timeout is looping forever if the drag ends by a failure
event. For instance when hitting the Esc button during scrolling.
2013-10-02 21:18:10 +13: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 92a3944442 Bug 676821 - No drag layers in "window layers", after commit...
Remove the button_release handler again, setting dnd_widget to NULL on
container change is enough to fix the crash I've seen, I added the
other handler just out of paranoia and apparently didn't test it.
2012-05-25 21:25:29 +02:00
Michael Natterer 27a767ee54 app: set GimpContainerTreeView->dnd_renderer to NULL more reliably
specifically in button_release() and when the container changes, we
can badly crash in some situations otherwise.
2012-05-22 12:58:10 +02: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 f72806bbcd app: fix GimpContainerTreeView name editing so it always works the same
no matter how editing was started (double click, keyboard activate, F2).

Connect to "editing-started" of the name cell and set the object's
real name directly on the GtkCellEditable, instead of trying to hack
around in the tree store before the actual editing starts.
2012-02-06 19:28:37 +01:00
Michael Natterer 947ea55a07 app: chain up last in gimp_container_tree_view_set_context()
so all the view renderers already have the right context when the
parent interface code selects the right item, which in turn requires
the context to be already set on the renderers. Fixes warnings when
dragging dockables around.
2012-02-06 01:33:01 +01:00
Michael Natterer fffd1920e2 app: don't hardcode MOD2 in GimpContainerTreeView either
Add new utility function gimp_get_all_modifiers_mask() which returns
all modifiers used for "useful" things on the current platform, like
in the commit below.
2011-10-10 00:17:20 +02:00
Michael Natterer 374f4e5628 app: let GimpContainerTreeView's parent class handle MOD2-click 2011-10-07 01:02:54 +02:00
Michael Natterer f1d4dde36a libgimpwidgets: add gdk_event_triggers_context_menu() to gimp3migration.[ch]
and remove gimp_button_event_triggers_context_menu() again. Update
all callers to use the new function.
2011-10-02 16:23:59 +02:00
Massimo Valentini 0f03ed9e05 Bug 616416: hidden layer groups appear again after an image change
Introduced two virtual functions to a GimpViewable

'set_expanded' and 'get_expanded'

and a PROP_GROUP_ITEM_FLAGS to load/save the expanded state
of layer_groups and use them.
2011-09-25 21:57:20 +02:00
Massimo Valentini a67bb11cf5 Revert "Bug 616416: hidden layer groups appear again after an image change"
This reverts commit 359c9c22d9.
2011-09-25 21:49:36 +02:00
Massimo Valentini 359c9c22d9 Bug 616416: hidden layer groups appear again after an image change 2011-09-25 21:38:50 +02:00
Michael Natterer d92cd2f6c8 Add gimp_button_event_triggers_context_menu() and use it
instead of checking for event->button == 3, so context menus
work correctly on the Mac. Didn't change the image menu yet
because thet requires some more refactoring.
2011-09-19 00:47:23 +02:00
Michael Natterer 7c60bb5181 app: use more of the new GDK_KEY_foo key names
and move the compat defines from display-enums.h to widgets-enums.h
2011-03-29 17:24:08 +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 95f14f5de8 app: add an "edit-name" binding signal and default to F2 2011-02-14 20:01:08 +01:00
Michael Natterer 202124c438 app: implement GObject::constructed() instead of ::constructor() 2011-01-14 09:38:46 +01:00
Michael Natterer d2fd8a8dc8 app: don't call gimp_cell_renderer_viewable_pre_clicked() on a NULL cell 2010-06-28 00:13:19 +02:00
Martin Nordholts 706900c4f6 Bug 589010 - Don't make Alt-Clicked layers active
Add a "pre-clicked" signal to GimpCellRendererViewable that can
prevent a selection from happening. Move the Alt-Click code in
GimpLayerTreeView to this signal and if a layer is Alt-Clicked, don't
go ahead and make the layer active. Also add a test for this use case.
2010-06-27 21:46:53 +02:00
Michael Natterer 15906be4d9 app: pull more code into GimpContainerTreeStore
Keep a list of GimpCellRendererViewable around and add API to add
them. When items are removed or the store is cleared, set the
renderers' "viewable" property to NULL so they don't keep refing the
viewable.

This is not really "model" code but needs to be done for all container
views that have viewable cell renderers.

GimpContainerComboBox and GimpContainerEntry lacked that clearing, so
this change might fix some cases where objects (even images) were
removed but still stuck in memory until the model changed again.
2010-06-03 22:09:02 +02:00
Michael Natterer 788ba611af app: base multiple selection API on the GtkSelectionMode enum
change get,set_multiple_selection(gboolean) to
get,set_selection_mode(GtkSelectionMode) so the APIs are consistent
with GTK+.
2010-05-19 20:07:31 +02:00
Michael Natterer 89f7500b79 app: add gimp_container_tree_store_columns_init()
which initializes the type array with the default columns.
2010-05-17 21:34:11 +02:00
Michael Natterer e1a88379d0 app: remove the model column enum from gimpcontainertreeview.h
and use the right enum from gimpcontainertreestore.h all over the
place instead.
2010-05-17 21:28:17 +02:00
Michael Natterer 104d0ffb3e app: add gimp_container_tree_store_columns_add()
which adds a column to the GType array used for creating a
GimpContainerTreeStore.
2010-05-17 21:22:36 +02:00
Michael Natterer 82a5c62e54 app: add GimpContainerTreeStore which is a GtkTreeStore subclass
and pulls the store handling logic out of GimpContainerTreeView so
it can be reused.
2010-05-17 21:06:28 +02:00
Michael Natterer 7ea16558b6 app: some cosmetic cleanup in the multiple selection code 2010-04-04 15:00:26 +02:00
Aurimas Juška 381088b4b8 app: Bug 614604 - Crash when selecting a gradient from tool dialog
Actually disable multiple selection in all views by default. (It is
enabled explicitly where needed).
2010-04-02 00:29:43 +03:00
Michael Natterer 9565ef44a9 app: make sure the selected item's parent paths are all expanded 2010-03-14 22:59:29 +01:00
Aurimas Juška b46a89a302 app: Add methods to enable multiple selection in GimpContainerView
Enable multiple selection in GimpDataFactoryView now. It remains
disabled everywhere else.
2010-03-11 18:24:56 +02:00
Aurimas Juška 9e2723d390 app: Revert add flags for multiple selection support
Don't add additional constructor argument.
2010-03-11 18:24:56 +02:00
Aurimas Juška 8fb846160a app: Fix crash when GimpContainerTreeView is used to activate items
Use old code path when multiselection is not needed. Rely on parent
class to handle multiselection when it is.
2010-03-09 01:19:50 +02:00
Aurimas Juška 13b172b675 app: Add flags for multiple selection support
Multiple item selection is disabled by default and
currently enabled only for data views.
2010-03-07 18:59:28 +02:00
Aurimas Juška ebe9e51b62 app: Add support for multiple items selection
Implemented infrastructure for multiple selection support.
GimpContainerTreeView actually provides such functionality.
All other GimpContainerViews should work as before.
2010-03-07 18:59:27 +02:00
Michael Natterer 3a0557afe8 app: add a boolean model column which sets the sensitivity of the text renderer
I'm not entirely happy with this, but it's just 4 lines of code and
is easily remove again.
2010-02-14 22:39:40 +01:00
Michael Natterer f1a9908191 app: add a USER_DATA column to GimpContainerTreeView's model
so users which don't subclass can attach their own per-row stuff
2010-02-13 15:46:34 +01:00
Michael Natterer 1a23b9ecf2 Build with GSEAL_ENABLE and #undef it where accessors are missing 2009-10-17 20:20:39 +02:00
Michael Natterer a3558e3cb8 Remove GIMP_OBJECT() casts when calling gimp_object_get_name() 2009-08-31 22:47:18 +02:00
Michael Natterer 85885224c3 Also send double-clicks on the expander to GtkTreeView
Enables quickly expanding and collpasing of branches, instead of
disturbingly popping up the peoperties dialog.
2009-08-28 11:06:29 +02:00
Michael Natterer a302e084ab Rename some functions
- gimp_container_tree_view_prepend_toggle_cell_renderer() to
  gimp_container_tree_view_add_toggle_cell()

- gimp_container_tree_view_prepend_cell_renderer() to
  gimp_container_tree_view_add_renderer_cell()

because "prepend" is an implementation detail, "renderer" is obsolete,
and in the second case it's not "cell renderer" but really a "renderer
cell".
2009-08-28 10:59:27 +02:00
Michael Natterer b2a1583c2b Fix GimpContainerView::set_context() to really set all rows of a tree 2009-08-28 10:15:38 +02:00
Michael Natterer 5f3721235e Fix GimpContainerView::set_view_size() implementation for actual trees 2009-08-27 23:21:40 +02:00
Michael Natterer c4b9779161 Enable clicking on tree expanders
If we didn't click on any cell, but on empty space in the expander
column of a row that has children, let GtkTreeView process the button
press to maybe handle a click on an expander.
2009-08-26 20:25:30 +02:00
Michael Natterer d059f239ac Make reordering items between groups work in the core and the UI
* app/core/gimpimage.[ch]: rename all gimp_image_reposition_foo() to
  gimp_image_reorder_foo() and added "new_parent" parameters. Factor
  out calculating of the item's new container and index to a utility
  function.

* app/core/core-enums.[ch]: rename the REPOSITION undos to REORDER.

* app/core/gimpimage-undo-push.[ch]
* app/core/gimpchannelpropundo.[ch]
* app/core/gimplayerpropundo.[ch]
* app/vectors/gimpvectorspropundo.[ch]: change accordingly. Remember
  the old parent item in all item reorder undos.

* app/widgets/gimpitemtreeview.h: change GimpReorderItemFunc prototype
  accordingly.

* app/widgets/gimpchanneltreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpvectorstreeview.c (class_init): follow image API
  name changes.

* app/widgets/gimpitemtreeview.c (gimp_item_tree_view_drop_viewable):
  implement reordering of items between groups.

* app/widgets/gimpcontainertreeview.c
  (gimp_container_tree_view_reorder_item): fix to reorder the item
  within its level of the tree (unrelated to above changes, but needed
  to make them work).
2009-08-06 18:43:57 +02:00