Collapsing the tree gets rid of any selection in the collapsed branch,
and doesn't restore it upon exapnding. So connect to the
GtkTreeView::row-expanded signal and select the active item manually.
Had to add evil hack that makes sure we don't try this on child items
that are currently being inserted, because our parent class has no
choice but to expand the tree while the item is not completely
inserted in all subclasses yet.
* app/core/gimpdrawable.[ch]: add "gboolean push_undo" to
GimpDrawable::convert_type().
* app/core/gimpdrawable-convert.[ch]: same here for the gray and rgb
conversion functions.
* app/core/gimpchannel.c
* app/core/gimplayer.c: pass FALSE when called from GimpItem::convert()
because it can be called on unattached items only.
* app/core/gimpimage-convert.c: pass TRUE.
* app/core/core-enums.[ch]
* app/core/gimpgrouplayerundo.[ch]
* app/core/gimpimage-undo-push.[ch]: add GIMP_UNDO_GROUP_LAYER_CONVERT
which simply calls gimp_drawable_convert_type() with the old type
when undone/redone.
* app/core/gimpgrouplayer.c: push a group layer convert undo so this
can be properly undone/redone.
In order to allow the toolbox dock to set geometry hints on the
GtkWindow it is in, introduce host geometry hint setting through a new
virtual function GimpDock::set_host_geometry_hints() and a new
"geometry-invalidated" signal.
Docks that needs to setup geometry hints on the window they are in
call gimp_dock_invalidate_geometry(). The GimpDockWindow will listen
to this and give the dock a chance to set geometry hints (or any setup
really) on the GimpDockWindow.
Add a "title-invalidated" signal to GimpDock and a virtual function
GimpDock::get_title(). When GimpDocks have a state change that their
title depends on they call gimp_dock_invalidate_title(). The
GimpDockWindow listens to this signal and update its window title
using GimpDock::get_title() in an idle handler.
Move the dock window related themeing namely default dock heght and
font scale from GimpDock to GimpDockWindow to get rid of yet another
GtkWindow dependency from GimpDock.
Note that this change requires gtkrc updates where "GimpDock::" needs
to be repaced with "GimpDockWindow::".
Add a GimpDialogFactory property to GimpDockWindow so that it can get
rid of its GimpDock dependency. We need to call the property
"gimp-dialog-factory" instead of "dialog-factory" though as long as
GimpDock subclasses GimpDockWindow.
Move the GimpUIManager from GimpImageDock to GimpDockWindow. This
includes making the ui_manager_name class-member of GimpImageDock a
normal instance member of GimpDockWindow since the UI manager name no
longer can be configured at the class level.
Needed because a group layer's projection can have a different type
than its image, at least at some pathologic moment during image type
conversion. But even if it didn't, it's cleaner this way anyway.
* app/core/gimpprojectable.[ch]: add the new vfunc plus public API.
* app/core/gimpprojection.c: use it instead of using the type of the
image returned by gimp_projectable_get_image(). The get_image()
function is now unused in the projection and only needs to stay
because the projection is also a GimpPickable.
* app/core/gimpgrouplayer.c: implement GimpProjectable::get_image_type().
The dock needs to listen to image changes in the context and not only
display changes since the introduction of the empty-image-window does
not cause any display changes when creating the first image.
Move pixel conversion code from gimp_layer_convert() to the new
gimp_layer_convert_type() implementation and call
gimp_drawable_convert_type() from convert(). In convert_type(), simply
chain up to convert to gray and rgb and only implement indexed
conversion ourselves.
This may look like duplication of GimpItem::convert() but in fact will
fix the longstanding uglyness that GimpItem::convert() both transfers
an item to another image *and* converts the image type of drawables.
When this refactoring is done, GimpItem::convert() will only move an
item to another image, and its implementation in GimpDrawable classes
will call GimpDrawable::convert_type() to convert the pixels to
whatever format.
Takes a "dest_image" parameter anyway because for converting to
indexed we need the destination colormap. The default impl in
GimpDrawable can only convert to gray and rgb however.
The GimpDockWindow will need to have a GimpContext so add such a
property but call it "gimp-context" for now to avoid clashing with
"context" of GimpDock.
Introduce GimpDockWindow and make GimpDock inherit from it. Right now
it is just a GimpWindow, but window logic from GimpDock and subclasses
will gradually be moved here so that we eventually can make GimpDock a
GtkBin. That in turn will allow us to put several GimpDocks next to
each other in columns, or GimpDocks in an image window.
Don't blindly fill the dest region's alpha channel even if it has
none. Fixes longstanding bug that made things without alpha dropped
to indexed images to arrive broken.
The new functions reall convert the drawable this time, using the
previously renamed convert_tiles functions. Remove tile manager
fiddling from all callers and leave it there only for converting to
indexed.
Rename them from gimp_drawable_convert_foo() to
gimp_drawable_convert_tiles_foo() because they don't convert the
drawable itself, they convert its tiles into passed-in tiles.