Commit Graph

3186 Commits

Author SHA1 Message Date
Michael Natterer 4e9f198831 Fix dropping an item into an empty group item immediately above it 2009-08-07 09:46:16 +02:00
Michael Natterer d2e1f2ac74 Add a button to create a group layer to the layers dialog
Will probably hide that button again, or make it only appear
when some environment variable is set until the stuff works
completely.
2009-08-06 21:34:54 +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 b2c7c4f61b Add infrastructure for dragging things between branches of a tree
* app/widgets/gimpcontainertreeview-dnd.c
  (gimp_container_tree_view_real_drop_possible): support DND within a
  tree and make sure a group item is not dropped into itself.

* app/widgets/gimpitemtreeview.c (gimp_item_tree_view_drop_viewable):
  implement intra-container reordering within all branches; print a
  message for inter-container reordering because that's not yet
  implemented in the core.
2009-08-05 18:57:08 +02:00
Sven Neumann 5febc2e417 Add functions to get the ISO 639-1 language code from GimpLanguageEntry
and to set the language using this code.
2009-08-04 22:46:01 +02:00
Sven Neumann bf8885f637 Bug 132509 – Allow to choose language in text tool
Remove the commented out language entry from the text editor and add
one to the text tool options instead. Work in progress...
2009-08-04 22:46:01 +02:00
Sven Neumann e2dbd56c5a app: add stubs for gimp_prop_language_entry_new() 2009-08-04 22:46:01 +02:00
Michael Natterer 86239d3b55 Use GimpTreeHandler to connect to all layers in the image 2009-08-04 22:41:49 +02:00
Michael Natterer 57f44b89e8 Use GimpTreeHandler to connect to all items' "visible" and "linked" callbacks
Makes the visibility and link buttons work for all items in a tree.
2009-08-04 20:20:09 +02:00
Michael Natterer 00682ee7cf Replace the hash table of container handlers by a single GimpTreeHandler 2009-08-04 20:19:13 +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 ac052aabf4 Add items at the right place again (did not affect item treeviews) 2009-08-04 00:13:58 +02:00
Michael Natterer 8a578354fe Show expanders in treeviews showing actual trees 2009-08-03 23:46:19 +02:00
Michael Natterer ad806713ae Add a per-class flags that indicates that a container view's model is a tree
* app/widgets/gimpcontainerview.h: add "gboolean model_is_tree"
  to GimpContainerViewInterface.

* app/widgets/gimpcontainerview.c: default to FALSE and enable the
  commented-out optimization in remove_container() for list-only
  container views.
2009-08-03 23:42:55 +02:00
Michael Natterer a53d4566da Use GIMP_IMAGE_ACTIVE_PARENT instead of a NULL parent in all obvious places 2009-08-03 22:30:36 +02:00
Michael Natterer c4075975bf Bring parent items to the public API in the core
* app/core/gimpimage.[ch]: make the parent parameter public in
add_layer(), add_layers(), add_channel() and add_vectors().

* app/vectors/gimpvectors-import.[ch]: add parent parameters to
  the vectors import functions.

* app/core/gimpchannelundo.[ch]
* app/core/gimplayerundo.[ch]
* app/vectors/gimpvectorsundo.[ch]
* app/core/gimpimage-undo-push.[ch]: remember the parent item when
  removing layers, channels and vectors.

* app/actions/channels-commands.c
* app/actions/debug-commands.c
* app/actions/edit-commands.c
* app/actions/layers-commands.c
* app/actions/vectors-commands.c
* app/core/gimp-edit.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-merge.c
* app/core/gimpimage-quick-mask.c
* app/core/gimplayer-floating-sel.c
* app/core/gimpselection.c
* app/core/gimptemplate.c
* app/dialogs/file-open-dialog.c
* app/display/gimpdisplayshell-dnd.c
* app/text/gimptext-compat.c
* app/tools/gimptexttool.c
* app/tools/gimpvectortool.c
* app/widgets/gimptoolbox-dnd.c
* app/xcf/xcf-load.c
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/paths.pdb
* tools/pdbgen/pdb/vectors.pdb: pass NULL as parent item to above
  functions and add FIXMEs all over the place because there is some
  more hacking needed to make adding with index = -1 (on top of the
  current item) work again.

* app/pdb/image-cmds.c
* app/pdb/paths-cmds.c
* app/pdb/vectors-cmds.c: regenerated.

* app/core/gimpimage-duplicate.c: duplicate the original image's
  tree structure in the copy.

* app/widgets/gimpitemtreeview.[ch]: add parent to GimpAddItemFunc,
  add utility function gimp_item_tree_view_get_drop_index() which
  figures where to add something dropped to an item tree.

* app/widgets/gimpchanneltreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpvectorstreeview.c: changed accordingly, using above
  new GimpItemTreeView API.
2009-08-03 19:21:51 +02:00
Martin Nordholts f026c52478 Bug 568445 – Closing the Toolbox causes the program to close
Instead of invoking the file-quit action when closing the toolbox, use
gimp_dialog_factory_hide_dialog().
2009-08-02 14:57:46 +02:00
Michael Natterer 7805bd2186 Use the new item counting functions where appropriate 2009-08-02 12:24:06 +02:00
Michael Natterer 01c77b18d5 Use the new item iter API instead of the image APIs in some straightforward places 2009-08-01 23:07:07 +02:00
Michael Natterer 88f49a5ddb Use gimp_item_get_index() all over the place
Remove gimp_image_get_layer,channel,vectors_index() and
use the new function everywhere.
2009-08-01 20:49:55 +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
Stephen Griffiths 6a41c872f6 app: Make GimpToolEditor changes cancellable
Allow the user to cancel rearrangements of tool order and visibility
in Preferences. See enhancement request/bug #500930.
2009-08-01 16:27:34 +02:00
Michael Natterer 96126034c9 Get rid of antique code duplication
Factor out large portions of identical code into new utility functions
gimp_container_view_connect_context() and
gimp_container_view_disconnect_context().
2009-07-28 21:02:32 +02:00
Michael Natterer 3ae83c5ced Fix setting a context for the unlikely case that the container is frozen 2009-07-28 19:17:42 +02:00
Michael Natterer eff6d4f930 Cosmetic changes 2009-07-28 19:15:36 +02:00
Michael Natterer b54a0fdf88 Replace the name_changed_handler_id GQuark by a hash of quarks
Keep around the handler IDs for the "name-changed" signals of the
container's children in a hash table that maps containers to handler
IDs and move adding/removing of the handler to
add_container()/remove_container(). This way the name-changed code is
prepared for handling multiple containers.
2009-07-28 19:08:07 +02:00
Michael Natterer 13ec6cca81 Add utility functions for adding/removing a container to/from the view
In preparation of having a tree of containers, added

gimp_container_view_add_container(),
gimp_container_view_remove_container() and
gimp_container_view_remove_foreach()

which do all the job of inserting/removing items and
connecting/disconnecting the "add", "remove" and "reorder" signals.

Also refactored things so when the toplevel container freezes/thaws,
it simply gets removed from the view instead of ignoring its signals.

gimp_container_view_real_set_container()
gimp_container_view_freeze()
gimp_container_view_thaw(): use the new add_container() and
remove_container() APIs and fix the code for the unlikely case
that a frozen container gets added/removed.
2009-07-28 16:47:28 +02:00
Michael Natterer 1b759561ce Keep the item hash table around permanently
GHashTable has g_hash_table_remove_all() since GLib 2.12, so there is
no need any longer to clear the hash table by destroyung it. Instead,
keep the hash around during the view's entire lifetime and remove all
re-creation code and all checks for its existence.
2009-07-28 15:04:43 +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 07ecd55b1c Rename private->hash_table to private->item_hash 2009-07-25 18:21:23 +02:00
Michael Natterer 344f52bbc2 Use GtkTreeStore instead of GtkListStore in GimpContainerTreeView 2009-07-25 17:38:03 +02:00
Michael Natterer 472bf62b67 Some straightforward tool editor cleanups
- split up button callbacks into one callback per button
- add stephen to copyright
- some minor whitespace fixups
2009-07-23 10:28:04 +02:00
Martin Nordholts ce5cfe0f1c app: Rename gimptoolview.[ch] to gimptooleditor.[ch]
Rename gimptoolview.[ch] to gimptooleditor.[ch]. The contents of the
file has already gone through this change, we do the file name change
separately for better diffs. Part of fix for bug #500930.
2009-07-22 00:21:31 +02:00
Stephen Griffiths 450db18abb app: Convert GimpToolView into a non-dockable GimpToolEditor
Convert the GimpToolView dockable to a non-dockable GimpToolEditor,
but wait with renaming the file so that we get better diffs. Part of
fix for bug #500930.
2009-07-22 00:21:31 +02:00
Martin Nordholts c6818c5710 app: Remove transient-docks gimprc setting
Remove the transient-docks setting for gimprc. What GIMP tried to
accomplish with this enabled is much better accomplished by the window
manager with the docks set to the 'Utility window' window hint. See
discussion in bug #322577.
2009-07-21 17:12:34 +02:00
Martin Nordholts cfbcdbd207 app: Add WM debug output 2009-07-20 13:16:30 +02:00
Martin Nordholts b2b2b41e62 Get rid of artificial compiler warnings
Get rid of artificial compiler warnings generated with the #warning
directive. They pollute the build output and don't work as incentives
for fixing stuff.
2009-07-20 12:47:59 +02:00
Michael Natterer e564cc2e4e Fix motion event processing on the tag popup's scroll arrows
Should work properly now wrt detecting the different speed
areas and stopping scolling upon leaving the arrow.
2009-07-18 19:58:33 +02:00
Martin Nordholts 20aa60ac8c app: Fix a free cell renderer for GimpLanguageEntry
We must set the text column with
gtk_entry_completion_set_text_column() in order to get a free cell
renderer.
2009-07-18 19:56:10 +02:00
Michael Natterer 84fd35d832 Connect to widget signals in init() instead of constructor() 2009-07-18 19:34:42 +02:00
Michael Natterer 48a8b89bea Only redraw the affected tags when prelight changes, not the entire widget 2009-07-18 19:31:21 +02:00
Michael Natterer 5d76dd9bc5 Fix unprelighting of the prelighted tag when there is no hit on any tag 2009-07-18 19:23:26 +02:00
Michael Natterer 24209f7625 Use g_value_dup_object() inatead of g_value_get_object() and g_object_ref() 2009-07-18 18:57:15 +02:00
Michael Natterer 6fd729cfb6 Remove the possibility to disable mnemonics (bug #120034)
There is GtkSettings:gtk-enable-mnemonics: now, so there is no
reason to do the same in GIMP:

* app/config/gimpguiconfig.[ch]: turn "menu-mnemonics" into a dummy.

* app/dialogs/preferences-dialog.c: remove its GUI.

* app/widgets/gimpactionfactory.[ch]
* app/widgets/gimpactiongroup.[ch]: remove infrastructure for disabling
  menu mnemonics.

* app/actions/actions.c: bye bye glue code.
2009-07-18 17:51:04 +02:00
Michael Natterer 0d81ce9717 Bug 446171 – select content by click on layer icon
* app/widgets/gimplayertreeview.c (gimp_layer_tree_view_layer_clicked):
  when ALT is pressed, select the layer's alpha. SHIFT and CONTROL work
  as usual to add, subtract and intersect.

* app/widgets/gimpchanneltreeview.c
* app/widgets/gimpvectorstreeview.c: add "clicked" handlers here too
  and do the same select-on-alt-click thing.
2009-07-18 16:59:43 +02:00
Martin Nordholts 99ce3bd8b2 Bug 120563 – Add an easy way to use the default comment
Add a 'Use default comment' button to the Comment tab in Image
Properties that if clicked sets the image comment to the default
comment set in Preferences.
2009-07-18 09:38:58 +02:00
Michael Natterer 65421aa0b6 Use accessors instead of widget->style and widget->window 2009-07-15 04:05:24 +02:00
Michael Natterer 84e933d80b Use accessors instead of widget->window and widget->style 2009-07-15 03:58:30 +02:00