Commit 2a08c79b authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

app/actions/layers-actions.c app/core/gimpimage.c

2005-05-06  Sven Neumann  <sven@gimp.org>

	* app/actions/layers-actions.c
	* app/core/gimpimage.c (gimp_image_position_layer)
	* app/widgets/gimplayertreeview.c (gimp_layer_tree_view_drop_possible):
	drop the limitation that layers not at the bottom of the stack
	have to have an alpha channel. Allow the user to move the
	background layer up in the stack or reposition it using DND.

	* tips/gimp-tips.xml.in: changed the relevant tip and some more.
parent 65098dda
2005-05-06 Sven Neumann <sven@gimp.org>
* app/actions/layers-actions.c
* app/core/gimpimage.c (gimp_image_position_layer)
* app/widgets/gimplayertreeview.c (gimp_layer_tree_view_drop_possible):
drop the limitation that layers not at the bottom of the stack
have to have an alpha channel. Allow the user to move the
background layer up in the stack or reposition it using DND.
* tips/gimp-tips.xml.in: changed the relevant tip and some more.
2005-05-06 Michael Natterer <mitch@gimp.org>
* plug-ins/common/compressor.c: use G_DIR_SEPARATOR instead of '/'.
......
......@@ -392,7 +392,6 @@ layers_actions_update (GimpActionGroup *group,
gboolean alpha = FALSE; /* alpha channel present */
gboolean indexed = FALSE; /* is indexed */
gboolean preserve = FALSE;
gboolean next_alpha = FALSE;
gboolean text_layer = FALSE;
GList *next = NULL;
GList *prev = NULL;
......@@ -422,9 +421,6 @@ layers_actions_update (GimpActionGroup *group,
next = g_list_next (list);
}
if (next)
next_alpha = gimp_drawable_has_alpha (GIMP_DRAWABLE (next->data));
if (layer)
text_layer = gimp_drawable_is_text_layer (GIMP_DRAWABLE (layer));
}
......@@ -450,10 +446,10 @@ layers_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("layers-select-previous", layer && !fs && !ac && prev);
SET_SENSITIVE ("layers-select-next", layer && !fs && !ac && next);
SET_SENSITIVE ("layers-raise", layer && !fs && !ac && alpha && prev);
SET_SENSITIVE ("layers-raise-to-top", layer && !fs && !ac && alpha && prev);
SET_SENSITIVE ("layers-lower", layer && !fs && !ac && next && next_alpha);
SET_SENSITIVE ("layers-lower-to-bottom", layer && !fs && !ac && next && next_alpha);
SET_SENSITIVE ("layers-raise", layer && !fs && !ac && prev);
SET_SENSITIVE ("layers-raise-to-top", layer && !fs && !ac && prev);
SET_SENSITIVE ("layers-lower", layer && !fs && !ac && next);
SET_SENSITIVE ("layers-lower-to-bottom", layer && !fs && !ac && next);
SET_SENSITIVE ("layers-anchor", layer && fs && !ac);
SET_SENSITIVE ("layers-merge-down", layer && !fs && !ac && next);
......@@ -467,7 +463,7 @@ layers_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("layers-crop", layer && sel);
SET_SENSITIVE ("layers-alpha-add", layer && !fs && !alpha);
SET_SENSITIVE ("layers-alpha-add", layer && !fs && !alpha);
SET_SENSITIVE ("layers-preserve-transparency", layer);
SET_ACTIVE ("layers-preserve-transparency", preserve);
......
......@@ -3003,14 +3003,13 @@ gimp_image_position_layer (GimpImage *gimage,
gboolean push_undo,
const gchar *undo_desc)
{
gint index;
gint num_layers;
gint index;
gint num_layers;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE);
index = gimp_container_get_child_index (gimage->layers,
GIMP_OBJECT (layer));
index = gimp_container_get_child_index (gimage->layers, GIMP_OBJECT (layer));
if (index < 0)
return FALSE;
......@@ -3021,23 +3020,6 @@ gimp_image_position_layer (GimpImage *gimage,
if (new_index == index)
return TRUE;
/* check if we want to move it below a bottom layer without alpha */
if (new_index == num_layers - 1)
{
GimpLayer *tmp;
tmp = (GimpLayer *) gimp_container_get_child_by_index (gimage->layers,
num_layers - 1);
if (new_index == num_layers - 1 &&
! gimp_drawable_has_alpha (GIMP_DRAWABLE (tmp)))
{
g_message (_("Layer '%s' has no alpha. Layer was placed above it."),
GIMP_OBJECT (tmp)->name);
new_index--;
}
}
if (push_undo)
gimp_image_undo_push_layer_reposition (gimage, undo_desc, layer);
......
......@@ -666,6 +666,9 @@ gimp_layer_tree_view_drop_possible (GimpContainerTreeView *tree_view,
GtkTreeViewDropPosition *return_drop_pos,
GdkDragAction *return_drag_action)
{
/* If we are dropping a new layer, check if the destionation image
* has a floating selection.
*/
if (src_type == GIMP_DND_TYPE_URI_LIST ||
src_type == GIMP_DND_TYPE_TEXT_PLAIN ||
src_type == GIMP_DND_TYPE_NETSCAPE_URL ||
......@@ -673,28 +676,10 @@ gimp_layer_tree_view_drop_possible (GimpContainerTreeView *tree_view,
src_type == GIMP_DND_TYPE_PIXBUF ||
GIMP_IS_DRAWABLE (src_viewable))
{
GimpLayer *dest_layer = GIMP_LAYER (dest_viewable);
GimpImage *dest_image = GIMP_ITEM_TREE_VIEW (tree_view)->gimage;
if (gimp_image_floating_sel (dest_image))
return FALSE;
if (dest_layer)
{
if (! gimp_drawable_has_alpha (GIMP_DRAWABLE (dest_layer)) &&
drop_pos == GTK_TREE_VIEW_DROP_AFTER)
return FALSE;
if (GIMP_IS_LAYER (src_viewable))
{
GimpLayer *src_layer = GIMP_LAYER (src_viewable);
GimpImage *src_image = gimp_item_get_image (GIMP_ITEM (src_layer));
if (src_image == dest_image &&
! gimp_drawable_has_alpha (GIMP_DRAWABLE (src_layer)))
return FALSE;
}
}
}
return GIMP_CONTAINER_TREE_VIEW_CLASS (parent_class)->drop_possible (tree_view,
......
......@@ -25,7 +25,7 @@
<big>Welcome to the GNU Image Manipulation Program!</big>
</_welcome>
<_thetip>
The GIMP can undo most changes to the image, so feel free
GIMP allows you to undo most changes to the image, so feel free
to experiment.
</_thetip>
</tip>
......@@ -37,53 +37,52 @@
<tip level="beginner">
<_thetip>
You can get context-sensitive help for most of the GIMP's features by
pressing the F1 key at any time. This also works inside the menus.
You can get context-sensitive help for most of the GIMP's features by
pressing the F1 key at any time. This also works inside the menus.
</_thetip>
</tip>
<tip level="beginner">
<_thetip>
The GIMP uses layers to let you organize your image. Think of them
as a stack of slides or filters, such that looking through them you
see a composite of their contents.
GIMP uses layers to let you organize your image. Think of them
as a stack of slides or filters, such that looking through them you
see a composite of their contents.
</_thetip>
</tip>
<tip level="beginner">
<_thetip>
You can perform many layer operations by right-clicking on the text
label of a layer in the Layers dialog.
You can perform many layer operations by right-clicking on the text
label of a layer in the Layers dialog.
</_thetip>
</tip>
<tip level="beginner">
<_thetip>
When you save an image to work on it again later, try using XCF,
the GIMP's native file format (use the file extension <tt>.xcf</tt>).
This preserves the layers and every aspect of your work-in-progress.
Once a project is completed, you can save it as JPEG, PNG, GIF, ...
When you save an image to work on it again later, try using XCF,
GIMP's native file format (use the file extension <tt>.xcf</tt>).
This preserves the layers and every aspect of your work-in-progress.
Once a project is completed, you can save it as JPEG, PNG, GIF, ...
</_thetip>
</tip>
<tip level="beginner">
<_thetip>
The layer named &quot;Background&quot; is special because it lacks
transparency. This prevents you from moving the layer up in the
stack. You may add transparency to it by right-clicking in the
Layers dialog and selecting &quot;Add Alpha Channel&quot;.
Most plug-ins work on the current layer of the current image. In
some cases, you will have to merge all layers (Image-&gt;Flatten Image)
if you want the plug-in to work on the whole image.
</_thetip>
</tip>
<tip level="beginner">
<_thetip>
Most plug-ins work on the current layer of the current image. In
some cases, you will have to merge all layers (Image-&gt;Flatten Image)
if you want the plug-in to work on the whole image.
If a layer's name in the Layers dialog is displayed in <b>bold</b>,
this layer doesn't have an alpha-channel. You can add an alpha-channel
using Layer-&gt;Transparency-&gt;Add Alpha Channel.
</_thetip>
</tip>
<tip level="beginner">
<_thetip>
Not all effects can be applied to all kinds of images. This is
indicated by a grayed-out menu-entry. You may need to change
the image mode to RGB (Image-&gt;Mode-&gt;RGB), add an alpha-channel
(Layer-&gt;Transparency-&gt;Add Alpha Channel) or flatten it
(Image-&gt;Flatten Image).
Not all effects can be applied to all kinds of images. This is
indicated by a grayed-out menu-entry. You may need to change
the image mode to RGB (Image-&gt;Mode-&gt;RGB), add an alpha-channel
(Layer-&gt;Transparency-&gt;Add Alpha Channel) or flatten it
(Image-&gt;Flatten Image).
</_thetip>
</tip>
......@@ -93,112 +92,112 @@
<tip level="intermediate">
<_thetip>
You can drag and drop many things in the GIMP. For example, dragging
a color from the toolbox or from a color palette and dropping it into
an image will fill the current image or selection with that color.
You can drag and drop many things in GIMP. For example, dragging
a color from the toolbox or from a color palette and dropping it into
an image will fill the current image or selection with that color.
</_thetip>
</tip>
<tip level="intermediate">
<_thetip>
When using a drawing tool (Paintbrush, Airbrush, or Pencil),
<tt>Shift</tt>-click will draw a straight line from your last drawing
point to your current cursor position. If you also press <tt>Ctrl</tt>,
the line will be constrained to 15 degree angles.
When using a drawing tool (Paintbrush, Airbrush, or Pencil),
<tt>Shift</tt>-click will draw a straight line from your last drawing
point to your current cursor position. If you also press <tt>Ctrl</tt>,
the line will be constrained to 15 degree angles.
</_thetip>
</tip>
<tip level="intermediate">
<_thetip>
You can use the middle mouse button to pan around the image, if it's
larger than its display window.
You can use the middle mouse button to pan around the image, if it's
larger than its display window.
</_thetip>
</tip>
<tip level="intermediate">
<_thetip>
Click and drag on a ruler to place a guide on an image. All
dragged selections will snap to the guides. You can remove
guides by dragging them off the image with the Move tool.
Click and drag on a ruler to place a guide on an image. All
dragged selections will snap to the guides. You can remove
guides by dragging them off the image with the Move tool.
</_thetip>
</tip>
<tip level="intermediate">
<_thetip>
You can drag a layer from the Layers dialog and drop it onto the
toolbox. This will create a new image containing only that layer.
You can drag a layer from the Layers dialog and drop it onto the
toolbox. This will create a new image containing only that layer.
</_thetip>
</tip>
<tip level="intermediate">
<_thetip>
A floating selection must be anchored to a new layer or to the last
active layer before doing other operations on the image. Click on the
&quot;New Layer&quot; or the &quot;Anchor Layer&quot; button in the
Layers dialog, or use the menus to do the same.
A floating selection must be anchored to a new layer or to the last
active layer before doing other operations on the image. Click on the
&quot;New Layer&quot; or the &quot;Anchor Layer&quot; button in the
Layers dialog, or use the menus to do the same.
</_thetip>
</tip>
<tip level="intermediate">
<_thetip>
The GIMP supports gzip compression on the fly. Just add <tt>.gz</tt>
(or <tt>.bz2</tt>, if you have bzip2 installed) to the filename and
your image will be saved compressed. Of course loading compressed
images works too.
GIMP supports gzip compression on the fly. Just add <tt>.gz</tt>
(or <tt>.bz2</tt>, if you have bzip2 installed) to the filename and
your image will be saved compressed. Of course loading compressed
images works too.
</_thetip>
</tip>
<tip level="intermediate">
<_thetip>
Pressing and holding the <tt>Shift</tt> key before making a selection
allows you to add to the current selection instead of replacing it.
Using <tt>Ctrl</tt> before making a selection subtracts from the
current one.
Pressing and holding the <tt>Shift</tt> key before making a selection
allows you to add to the current selection instead of replacing it.
Using <tt>Ctrl</tt> before making a selection subtracts from the
current one.
</_thetip>
</tip>
<tip level="intermediate">
<_thetip>
You can press or release the <tt>Shift</tt> and <tt>Ctrl</tt> keys
while you are making a selection in order to constrain it to a
square or a circle, or to have it centered on its starting point.
You can press or release the <tt>Shift</tt> and <tt>Ctrl</tt> keys
while you are making a selection in order to constrain it to a
square or a circle, or to have it centered on its starting point.
</_thetip>
</tip>
<tip level="intermediate">
<_thetip>
You can adjust or move a selection by using <tt>Alt</tt>-drag.
If this makes the window move, your window manager uses the
<tt>Alt</tt> key already. Try pressing <tt>Shift</tt> at the same
time.
You can adjust or move a selection by using <tt>Alt</tt>-drag.
If this makes the window move, your window manager uses the
<tt>Alt</tt> key already. Try pressing <tt>Shift</tt> at the same
time.
</_thetip>
</tip>
<tip level="intermediate">
<_thetip>
You can draw simple squares or circles using Edit-&gt;Stroke Selection.
It strokes the edge of your current selection. More complex shapes
can be drawn using the Path tool or with Filters-&gt;Render-&gt;Gfig.
You can draw simple squares or circles using Edit-&gt;Stroke Selection.
It strokes the edge of your current selection. More complex shapes
can be drawn using the Path tool or with Filters-&gt;Render-&gt;Gfig.
</_thetip>
</tip>
<tip level="intermediate">
<_thetip>
If you stroke a path (Edit-&gt;Stroke Path), the paint tools can
be used with their current settings. You can use the Paintbrush in
gradient mode or even the Eraser or the Smudge tool.
If you stroke a path (Edit-&gt;Stroke Path), the paint tools can
be used with their current settings. You can use the Paintbrush in
gradient mode or even the Eraser or the Smudge tool.
</_thetip>
</tip>
<tip level="intermediate">
<_thetip>
You can create and edit complex selections using the Path tool.
The Paths dialog allows you to work on multiple paths and to convert
them to selections.
You can create and edit complex selections using the Path tool.
The Paths dialog allows you to work on multiple paths and to convert
them to selections.
</_thetip>
</tip>
<tip level="intermediate">
<_thetip>
You can use the paint tools to change the selection. Click on the
&quot;Quick Mask&quot; button at the bottom left of an image window.
Change your selection by painting in the image and click on the button
again to convert it back to a normal selection.
You can use the paint tools to change the selection. Click on the
&quot;Quick Mask&quot; button at the bottom left of an image window.
Change your selection by painting in the image and click on the button
again to convert it back to a normal selection.
</_thetip>
</tip>
<tip level="intermediate">
<_thetip>
You can save a selection to a channel (Select-&gt;Save to Channel) and
then modify this channel with any paint tools. Using the buttons in
the Channels dialog, you can toggle the visibility of this new channel
or convert it to a selection.
You can save a selection to a channel (Select-&gt;Save to Channel) and
then modify this channel with any paint tools. Using the buttons in
the Channels dialog, you can toggle the visibility of this new channel
or convert it to a selection.
</_thetip>
</tip>
......@@ -209,76 +208,77 @@
<tip level="advanced">
<_thetip>
After you enabled &quot;Dynamic Keyboard Shortcuts&quot; in the
Preferences dialog, you can reassign shortcut keys. Do so by bringing
up the menu, selecting a menu item, and pressing the desired key
combination. If &quot;Save Keyboard Shortcuts&quot; is enabled, the
key bindings are saved when you exit GIMP.
After you enabled &quot;Dynamic Keyboard Shortcuts&quot; in the
Preferences dialog, you can reassign shortcut keys. Do so by bringing
up the menu, selecting a menu item, and pressing the desired key
combination. If &quot;Save Keyboard Shortcuts&quot; is enabled, the
key bindings are saved when you exit GIMP.
</_thetip>
</tip>
<tip level="advanced">
<_thetip>
If your screen is too cluttered, you can press <tt>Tab</tt> multiple
times in an image window to hide or show the toolbox and other dialogs.
If your screen is too cluttered, you can press <tt>Tab</tt> multiple
times in an image window to hide or show the toolbox and other dialogs.
</_thetip>
</tip>
<tip level="advanced">
<_thetip>
You can adjust the selection range for fuzzy select
by clicking and dragging left and right.
You can adjust the selection range for fuzzy select
by clicking and dragging left and right.
</_thetip>
</tip>
<tip level="advanced">
<_thetip>
<tt>Shift</tt>-click on the eye icon in the Layers dialog to hide all
layers but that one. <tt>Shift</tt>-click again to show all layers.
<tt>Shift</tt>-click on the eye icon in the Layers dialog to hide all
layers but that one. <tt>Shift</tt>-click again to show all layers.
</_thetip>
</tip>
<tip level="advanced">
<_thetip>
<tt>Ctrl</tt>-click on the layer mask's preview in the Layers dialog
toggles the effect of the layer mask.
<tt>Ctrl</tt>-click on the layer mask's preview in the Layers dialog
toggles the effect of the layer mask.
</_thetip>
</tip>
<tip level="advanced">
<_thetip>
<tt>Alt</tt>-click on the layer mask's preview in the Layers dialog
toggles viewing the mask directly.
<tt>Alt</tt>-click on the layer mask's preview in the Layers dialog
toggles viewing the mask directly.
</_thetip>
</tip>
<tip level="advanced">
<_thetip>
You can use <tt>Alt</tt>-<tt>Tab</tt> to cycle through all layers in
an image (if your window manager doesn't trap those keys...).
You can use <tt>Alt</tt>-<tt>Tab</tt> to cycle through all layers in
an image (if your window manager doesn't trap those keys...).
</_thetip>
</tip>
<tip level="advanced">
<_thetip>
<tt>Ctrl</tt>-click with the Bucket Fill tool to have it use
the background color instead of the foreground color.
<tt>Ctrl</tt>-click with the Bucket Fill tool to have it use
the background color instead of the foreground color.
</_thetip>
</tip>
<tip level="advanced">
<_thetip>
<tt>Ctrl</tt>-drag with the Rotate tool will constrain the
rotation to 15 degree angles.
<tt>Ctrl</tt>-drag with the Rotate tool will constrain the
rotation to 15 degree angles.
</_thetip>
</tip>
<tip level="advanced">
<_thetip>
To create a circle-shaped selection, hold <tt>Shift</tt> while doing
an ellipse select. To place a circle precisely, drag horizontal and
vertical guides tangent to the circle you want to select, place
your cursor at the intersection of the guides, and the resulting
selection will just touch the guides.
To create a circle-shaped selection, hold <tt>Shift</tt> while
doing an ellipse select. To place a circle precisely, drag
horizontal and vertical guides tangent to the circle you want to
select, place your cursor at the intersection of the guides, and
the resulting selection will just touch the guides.
</_thetip>
</tip>
<tip level="advanced">
<_thetip>
If some of your scanned photos do not look colorful enough, you can
easily improve their tonal range with the &quot;Auto&quot; button in the
Levels tool (Layer-&gt;Colors-&gt;Levels). If there are any color casts,
you can correct them with the Curves tool (Layer-&gt;Colors-&gt;Curves).
If some of your scanned photos do not look colorful enough, you
can easily improve their tonal range with the &quot;Auto&quot;
button in the Levels tool (Layer-&gt;Colors-&gt;Levels). If
there are any color casts, you can correct them with the Curves
tool (Layer-&gt;Colors-&gt;Curves).
</_thetip>
</tip>
......
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