Commit Graph

139 Commits

Author SHA1 Message Date
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
Michael Natterer e8c6e3dbd3 Expand the treeview to newly inserted items 2009-08-04 09:06:03 +02:00
Michael Natterer 3c0df851d0 Make the preview column the expander column 2009-08-04 00:21:07 +02:00
Michael Natterer 8a578354fe Show expanders in treeviews showing actual trees 2009-08-03 23:46:19 +02:00
Michael Natterer ee022e907e Add basic support for trees of containers in GimpContainerView classes
* app/widgets/gimpcontainerview.[ch]: add and remove container trees
  recursively. Change virtual function ::add_item() to pass the
  insert_data of the parent viewable.

* app/widgets/gimpcontainercombobox.c
* app/widgets/gimpcontainerentry.c
* app/widgets/gimpcontainergridview.c: changed accordingly.

* app/widgets/gimpcontainertreeview.c
* app/widgets/gimpitemtreeview.c
* app/widgets/gimplayertreeview.c: dito, but actually use the passed
  parent_insert_data to insert the item at the right place in the
  GtkTreeView.
2009-08-01 19:13:35 +02:00
Michael Natterer b78b6f6274 Set the tree view's "show-expanders" to FALSE
Don't waste the expander space in all GimpContainerTreeViews. We can
later set it to TRUE in individual subclasses which actually display a
tree and not only a list.
2009-07-26 14:19:58 +02:00
Michael Natterer bc51e8f98c Use the right area for click detection on treeview cells
Use gtk_tree_view_get_cell_area() instead of
gtk_tree_view_get_background_area() because the latter includes things
like expanders, indentation and padding and messes up the x coordinate
of our naive click detection.
2009-07-26 14:13:30 +02:00
Michael Natterer 344f52bbc2 Use GtkTreeStore instead of GtkListStore in GimpContainerTreeView 2009-07-25 17:38:03 +02:00
Michael Natterer be21d3a1e3 Restrict the set of modifiers that prevent treeview item activation
Check for SHIFT, CONTROL and MOD1 explicitely so the code doesn't prevent
item activation for esoteric modifiers that are set by whatever X
component (like XKB).
2009-05-24 22:17:42 +02:00
Martin Nordholts 2f9e2662c4 app: Don't activate container tree view items while modkey pressed
Only activate container tree view items when no modifier keys are
pressed so that for example the layer properties dialog is not shown
when quickly toggling a layer mask with Ctrl + Click.
2009-05-22 22:49:14 +02:00
Michael Natterer d85fb156b5 app/widgets/gimpblobeditor.c app/widgets/gimpbrushselect.c
2009-03-22  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpblobeditor.c
	* app/widgets/gimpbrushselect.c
	* app/widgets/gimpcolorbar.c
	* app/widgets/gimpcolordialog.c
	* app/widgets/gimpcolorframe.c
	* app/widgets/gimpcontainergridview.c
	* app/widgets/gimpcontainerpopup.c
	* app/widgets/gimpcontainertreeview.c
	* app/widgets/gimpcontrollereditor.c
	* app/widgets/gimpcontrollerlist.c
	* app/widgets/gimpcursor.c
	* app/widgets/gimpcurveview.c
	* app/widgets/gimpdasheditor.c
	* app/widgets/gimpdialogfactory.c
	* app/widgets/gimpdnd-xds.c
	* app/widgets/gimpdockable.c
	* app/widgets/gimperrordialog.c
	* app/widgets/gimpfgbgeditor.c
	* app/widgets/gimpfgbgview.c
	* app/widgets/gimpfiledialog.c
	* app/widgets/gimpfontselect.c
	* app/widgets/gimpgradienteditor.c
	* app/widgets/gimpgradientselect.c
	* app/widgets/gimphandlebar.c
	* app/widgets/gimphistogrambox.c
	* app/widgets/gimphistogramview.c
	* app/widgets/gimpmessagedialog.c
	* app/widgets/gimpnavigationview.c
	* app/widgets/gimppaletteselect.c
	* app/widgets/gimppaletteview.c
	* app/widgets/gimppatternselect.c
	* app/widgets/gimpprogressbox.c
	* app/widgets/gimpprogressdialog.c
	* app/widgets/gimpscalebutton.c
	* app/widgets/gimpselectiondata.c
	* app/widgets/gimpsessioninfo.c
	* app/widgets/gimpsettingsbox.c
	* app/widgets/gimpstrokeeditor.c
	* app/widgets/gimptexteditor.c
	* app/widgets/gimptoolbox.c
	* app/widgets/gimpuimanager.c
	* app/widgets/gimpview-popup.c
	* app/widgets/gimpview.c
	* app/widgets/gimpviewabledialog.c
	* app/widgets/gimpwidgets-utils.c: use accessors for various
	members of GTK+ structures that don't exist any longer when
	GSEAL_ENABLE is defined.


svn path=/trunk/; revision=28193
2009-03-22 16:35:53 +00:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
2009-01-17  Michael Natterer  <mitch@gimp.org>

	* all files with a GPL header and all COPYING files:

	Change licence to GPLv3 (and to LGPLv3 for libgimp).

	Cleaned up some copyright headers and regenerated the parsers in
	the ImageMap plugin.


svn path=/trunk/; revision=27913
2009-01-17 22:28:01 +00:00
Martin Nordholts dff24a3d98 Format static function prototypes.
* app/widgets/gimpcontainertreeview.c: Format static function
prototypes.

svn path=/trunk/; revision=27880
2009-01-03 22:27:30 +00:00
Martin Nordholts 2f25fb132f Use GimpContainer getters instead of poking into the class
instance struct.

* app/actions/context-commands.c
* app/actions/data-commands.c
* app/actions/plug-in-commands.c
* app/actions/templates-commands.c
* app/core/gimp-utils.c
* app/core/gimpdrawablestack.c
* app/core/gimpitemstack.c
* app/core/gimplist.c
* app/gui/gui-vtable.c
* app/widgets/gimpcontainerbox.c
* app/widgets/gimpcontainercombobox.c
* app/widgets/gimpcontainereditor.c
* app/widgets/gimpcontainerentry.c
* app/widgets/gimpcontainergridview.c
* app/widgets/gimpcontainerpopup.c
* app/widgets/gimpcontainertreeview-dnd.c
* app/widgets/gimpcontainertreeview.c
* app/widgets/gimpcontainerview-utils.c
* app/widgets/gimpcontainerview.c
* app/widgets/gimpdataeditor.c
* app/widgets/gimpdatafactoryview.c
* app/widgets/gimpsettingsbox.c
* app/widgets/gimpviewablebutton.c

svn path=/trunk/; revision=27693
2008-11-20 23:43:58 +00:00
Martin Nordholts 35c1687678 app/widgets/gimpcontainertreeview.[ch] Make the renderer_cells and
* app/widgets/gimpcontainertreeview.[ch]
* app/widgets/gimpcontainertreeview-private.h: Make the
renderer_cells and toggle_cells members private.

(gimp_container_tree_view_set_main_column_title)
(gimp_container_tree_view_prepend_toggle_cell_renderer)
(gimp_container_tree_view_prepend_cell_renderer): New interface.

* app/widgets/gimptoolview.c
* app/widgets/gimpitemtreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpcontrollerlist.c: Use new interface.

svn path=/trunk/; revision=27675
2008-11-16 20:58:53 +00:00
Martin Nordholts 72d733ce8f Move container tree view model column enums here and call the last enum
* app/widgets/gimpcontainertreeview.[ch]: Move container tree view
model column enums here and call the last enum _N_COLUMNS.

* app/widgets/widgets-enums.h: Remove the enum. It was meant only
for the container tree view class hierarchy anyway.

svn path=/trunk/; revision=27672
2008-11-16 19:59:16 +00:00
Martin Nordholts 9eda1bb7c8 New setter function so that we can make the "gboolean dnd_drop_to_empty"
* app/widgets/gimpcontainertreeview.[ch]
(gimp_container_tree_view_set_dnd_drop_to_empty): New setter
function so that we can make the "gboolean dnd_drop_to_empty"
class instance member private.

* app/widgets/gimpcontainertreeview-private.h: Move member here.

* app/widgets/gimpcontainertreeview-dnd.c: Go through priv pointer.

* app/widgets/gimpitemtreeview.c (gimp_item_tree_view_init): Use
the new function.

svn path=/trunk/; revision=27671
2008-11-16 19:48:54 +00:00
Martin Nordholts 137734aaed Put the GimpContainerTreeView enums here instead of exposing them through
* app/widgets/widgets-enums.h: Put the GimpContainerTreeView enums
here instead of exposing them through silly class instance
members.

* app/widgets/gimpcontainertreeview.c: 
* app/widgets/gimpcontainertreeview-dnd.c
* app/widgets/gimpdatafactoryview.c
* app/widgets/gimpitemtreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpsettingseditor.c
* app/widgets/gimptemplateview.c
* app/widgets/gimptoolview.c: Clean up and use new enum names.

svn path=/trunk/; revision=27666
2008-11-15 20:01:55 +00:00
Martin Nordholts e9153bf52d Don't expose class instance struct members that is currently only used
* app/widgets/gimpcontainertreeview.[ch]: Don't expose class
instance struct members that is currently only used within the
GimpContainerTreeView implementation.

* app/widgets/gimpcontainertreeview-private.h: New file containing
the definition of the private struct.

* app/widgets/gimpcontainertreeview-dnd.c: Change accordingly.

* app/widgets/Makefile.am: Add new file.

svn path=/trunk/; revision=27662
2008-11-15 18:08:50 +00:00
Michael Natterer f1b8cab63d Bug 545325 – Scrollbars do not disappear automatically
2008-09-05  Michael Natterer  <mitch@gimp.org>

	Bug 545325 – Scrollbars do not disappear automatically

	* app/widgets/gimpcontainertreeview.c: autosize the columns after
	each operation that can reduce the treeview's width.


svn path=/trunk/; revision=26875
2008-09-05 14:06:01 +00:00
Michael Natterer 5e5448c16a add new function gimp_container_tree_view_connect_name_edited() which
2008-06-28  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpcontainertreeview.[ch]: add new function
	gimp_container_tree_view_connect_name_edited() which makes the
	name cell editable and connects a passed "edited" callback.

	* app/widgets/gimpdatafactoryview.c
	* app/widgets/gimpitemtreeview.c
	* app/widgets/gimpsettingseditor.c
	* app/widgets/gimptemplateview.c: use it instead of having the
	same code four times.


svn path=/trunk/; revision=26009
2008-06-28 16:05:05 +00:00
Michael Natterer f53ed53cdb app/widgets/gimpactionview.c app/widgets/gimpblobeditor.c
2008-06-28  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpactionview.c
	* app/widgets/gimpblobeditor.c
	* app/widgets/gimpbrushfactoryview.c
	* app/widgets/gimpbrushselect.c
	* app/widgets/gimpcellrendererdashes.c
	* app/widgets/gimpcellrendererviewable.c
	* app/widgets/gimpcolorbar.c
	* app/widgets/gimpcoloreditor.c
	* app/widgets/gimpcolorframe.c
	* app/widgets/gimpcomponenteditor.c
	* app/widgets/gimpcontainerbox.c
	* app/widgets/gimpcontainergridview.c
	* app/widgets/gimpcontainerpopup.c
	* app/widgets/gimpcontainertreeview.c
	* app/widgets/gimpcurveview.c
	* app/widgets/gimpdasheditor.c
	* app/widgets/gimpdatafactoryview.c
	* app/widgets/gimpdock.c
	* app/widgets/gimpdockable.c
	* app/widgets/gimpdockseparator.c
	* app/widgets/gimpfgbgeditor.c
	* app/widgets/gimpfgbgview.c
	* app/widgets/gimpgradienteditor.c
	* app/widgets/gimphandlebar.c
	* app/widgets/gimphistogrambox.c
	* app/widgets/gimphistogramview.c
	* app/widgets/gimpitemtreeview.c
	* app/widgets/gimpmenudock.c
	* app/widgets/gimpmessagebox.c
	* app/widgets/gimppaletteview.c
	* app/widgets/gimpscalebutton.c
	* app/widgets/gimpsessioninfo-book.c
	* app/widgets/gimpsessioninfo-dock.c
	* app/widgets/gimpsettingseditor.c
	* app/widgets/gimpstrokeeditor.c
	* app/widgets/gimptemplateeditor.c
	* app/widgets/gimptemplateview.c
	* app/widgets/gimpthumbbox.c
	* app/widgets/gimptoolbox.c
	* app/widgets/gimptooloptionseditor.c
	* app/widgets/gimptoolview.c
	* app/widgets/gimpuimanager.c
	* app/widgets/gimpviewabledialog.c
	* app/widgets/gimpviewrenderervectors.c
	* app/widgets/gimpwidgets-utils.c: use accessors instead of
	accessing members of GTK+ widgets directly.


svn path=/trunk/; revision=26008
2008-06-28 15:50:27 +00:00
Sven Neumann b131f8011c added a finalizer that frees the memory allocated for the cell lists.
2008-03-30  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpcontainertreeview.c: added a finalizer that 
frees
	the memory allocated for the cell lists.


svn path=/trunk/; revision=25316
2008-03-30 17:20:36 +00:00
Michael Natterer a446f3d7fb use the new tooltip API instead of the old deprecated one. Removed
2007-11-09  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimphelpui.[ch]: use the new tooltip API instead
	of the old deprecated one. Removed _gimp_help_init(). Remember
	whether tooltips are enabled or not in a local variable that can
	only be altered at startup time and not after. The API now expects
	markup instead of plain text which might cause warnings and
	perhaps needs to be changed.

	* libgimpwidgets/gimpwidgets-private.c: don't call _gimp_help_init().

	* app/config/gimpguiconfig.c: made show-tooltips a
	GIMP_CONFIG_PARAM_RESTART property.

	* app/widgets/gimptoolbox-color-area.c: don't add the tooltip here...

	* app/widgets/gimptoolbox.c: ...but here (as for all other
	indicators). Also escape '&' properly because we now use markup.

	* app/tools/gimpselectionoptions.c
	* app/widgets/gimpeditor.c
	* app/widgets/gimpwidgets-utils.c: print modifiers and
	shortcuts in bold instead of in ().

	* app/widgets/gimpcontainertreeview.c: show tooltips on rows if
	gimp_viewable_get_description() returns a tip.

	* app/dialogs/preferences-dialog.c
	* plug-ins/jpeg/jpeg-save.c
	* plug-ins/MapObject/mapobject_ui.c
	* plug-ins/Lighting/lighting_ui.c
	* plug-ins/common/animationplay.c
	* plug-ins/common/warp.c: no need to add event boxes just to have
	tooltips, the new ones work on all widgets.


svn path=/trunk/; revision=24093
2007-11-09 11:17:00 +00:00