Commit 02fa3542 authored by Jehan's avatar Jehan

app: replace more gimp_(s|g)et_active_layer() to *_selected_layers().

parent 579cfc06
......@@ -161,7 +161,7 @@ text_tool_actions_update (GimpActionGroup *group,
GimpTextTool *text_tool = GIMP_TEXT_TOOL (data);
GimpDisplay *display = GIMP_TOOL (text_tool)->display;
GimpImage *image = gimp_display_get_image (display);
GimpLayer *layer;
GList *layers;
GimpVectors *vectors;
GimpDisplayShell *shell;
GtkClipboard *clipboard;
......@@ -171,10 +171,10 @@ text_tool_actions_update (GimpActionGroup *group,
GimpTextDirection direction;
gint i;
layer = gimp_image_get_active_layer (image);
layers = gimp_image_get_selected_layers (image);
if (layer)
text_layer = gimp_item_is_text_layer (GIMP_ITEM (layer));
if (g_list_length (layers) == 1)
text_layer = gimp_item_is_text_layer (GIMP_ITEM (layers->data));
vectors = gimp_image_get_active_vectors (image);
......
......@@ -101,12 +101,16 @@ gimp_floating_selection_undo_pop (GimpUndo *undo,
case GIMP_UNDO_FS_TO_LAYER:
if (undo_mode == GIMP_UNDO_MODE_UNDO)
{
GList *layers;
/* Update the preview for the floating selection */
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (floating_layer));
gimp_layer_set_floating_sel_drawable (floating_layer,
floating_sel_undo->drawable);
gimp_image_set_active_layer (undo->image, floating_layer);
layers = g_list_prepend (NULL, floating_layer);
gimp_image_set_selected_layers (undo->image, layers);
g_list_free (layers);
gimp_drawable_attach_floating_sel (gimp_layer_get_floating_sel_drawable (floating_layer),
floating_layer);
......
......@@ -217,6 +217,7 @@ floating_sel_activate_drawable (GimpLayer *layer)
{
GimpImage *image;
GimpDrawable *drawable;
GList *selected_drawables;
g_return_if_fail (GIMP_IS_LAYER (layer));
g_return_if_fail (gimp_layer_is_floating_sel (layer));
......@@ -230,24 +231,21 @@ floating_sel_activate_drawable (GimpLayer *layer)
{
GimpLayerMask *mask = GIMP_LAYER_MASK (drawable);
gimp_image_set_active_layer (image, gimp_layer_mask_get_layer (mask));
selected_drawables = g_list_prepend (NULL, gimp_layer_mask_get_layer (mask));
gimp_image_set_selected_layers (image, selected_drawables);
}
else if (GIMP_IS_CHANNEL (drawable))
{
GList *channels = g_list_prepend (NULL, drawable);
gimp_image_set_selected_channels (image, channels);
g_list_free (channels);
selected_drawables = g_list_prepend (NULL, drawable);
gimp_image_set_selected_channels (image, selected_drawables);
}
else
{
GList *layers = g_list_prepend (NULL, drawable);
gimp_image_set_selected_layers (image, layers);
g_list_free (layers);
selected_drawables = g_list_prepend (NULL, drawable);
gimp_image_set_selected_layers (image, selected_drawables);
}
g_list_free (selected_drawables);
}
const GimpBoundSeg *
......
......@@ -1560,7 +1560,9 @@ gimp_display_shell_start_scrolling (GimpDisplayShell *shell,
{
GimpStatusbar *statusbar;
gimp_image_set_active_layer (image, layer);
layers = g_list_prepend (NULL, layer);
gimp_image_set_selected_layers (image, layers);
g_list_free (layers);
statusbar = gimp_display_shell_get_statusbar (shell);
gimp_statusbar_push_temp (statusbar, GIMP_MESSAGE_INFO,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment