Commit 186b5908 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

added help IDs for the drawable- and vectors-visible and -liked actions as

2004-09-15  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimphelp-ids.h: added help IDs for the drawable- and
	vectors-visible and -liked actions as well as for the layer mask
	property action.

	* app/actions/drawable-actions.c
	* app/actions/vectors-actions.c: use them.

	* app/actions/layers-actions.c
	* app/actions/layers-commands.[ch]: ditto. Use
	GIMP_STOCK_TRANSPARENCY for all layer opacity actions. Replaced
	"paint_mode" by "mode" in all action and function/variable names
	because this is the layer mode, not a paint mode.

	* app/actions/channels-commands.c
	* app/actions/layers-commands.c
	* app/actions/vectors-commands.c: set the "activates-default"
	property on the name entry in all "New Foo" and "Edit Foo
	Attributes" dialogs except in the "New Layer" dialog.
	Addresses bug #148026.

	* menus/image-menu.xml.in: added a (commented out) layer
	properties menu containing all the new actions.
parent 6a723efc
2004-09-15 Michael Natterer <mitch@gimp.org>
* app/widgets/gimphelp-ids.h: added help IDs for the drawable- and
vectors-visible and -liked actions as well as for the layer mask
property action.
* app/actions/drawable-actions.c
* app/actions/vectors-actions.c: use them.
* app/actions/layers-actions.c
* app/actions/layers-commands.[ch]: ditto. Use
GIMP_STOCK_TRANSPARENCY for all layer opacity actions. Replaced
"paint_mode" by "mode" in all action and function/variable names
because this is the layer mode, not a paint mode.
* app/actions/channels-commands.c
* app/actions/layers-commands.c
* app/actions/vectors-commands.c: set the "activates-default"
property on the name entry in all "New Foo" and "Edit Foo
Attributes" dialogs except in the "New Layer" dialog.
Addresses bug #148026.
* menus/image-menu.xml.in: added a (commented out) layer
properties menu containing all the new actions.
2004-09-15 Michael Natterer <mitch@gimp.org>
* app/actions/layers-actions.c
......
......@@ -384,6 +384,7 @@ channels_new_channel_query (GimpImage *gimage,
gtk_widget_show (table);
options->name_entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (options->name_entry), TRUE);
gtk_entry_set_text (GTK_ENTRY (options->name_entry),
(channel_name ? channel_name : _("New Channel")));
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
......@@ -541,6 +542,7 @@ channels_edit_channel_query (GimpChannel *channel,
gtk_widget_show (table);
options->name_entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (options->name_entry), TRUE);
gtk_entry_set_text (GTK_ENTRY (options->name_entry),
gimp_object_get_name (GIMP_OBJECT (channel)));
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
......
......@@ -69,13 +69,13 @@ static GimpToggleActionEntry drawable_toggle_actions[] =
N_("_Visible"), NULL, NULL,
G_CALLBACK (drawable_visible_cmd_callback),
FALSE,
NULL },
GIMP_HELP_LAYER_VISIBLE },
{ "drawable-linked", GIMP_STOCK_LINKED,
N_("_Linked"), NULL, NULL,
G_CALLBACK (drawable_linked_cmd_callback),
FALSE,
NULL }
GIMP_HELP_LAYER_LINKED }
};
static GimpEnumActionEntry drawable_flip_actions[] =
......
......@@ -47,13 +47,16 @@ static GimpActionEntry layers_actions[] =
{ "layers-popup", GIMP_STOCK_LAYERS, N_("Layers Menu"), NULL, NULL, NULL,
GIMP_HELP_LAYER_DIALOG },
{ "layers-menu", NULL, N_("_Layer") },
{ "layers-stack-menu", NULL, N_("Stac_k") },
{ "layers-colors-menu", NULL, N_("_Colors") },
{ "layers-colors-auto-menu", NULL, N_("_Auto") },
{ "layers-mask-menu", NULL, N_("_Mask") },
{ "layers-transparency-menu", NULL, N_("Tr_ansparency") },
{ "layers-transform-menu", NULL, N_("_Transform") },
{ "layers-menu", NULL, N_("_Layer") },
{ "layers-stack-menu", NULL, N_("Stac_k") },
{ "layers-colors-menu", NULL, N_("_Colors") },
{ "layers-colors-auto-menu", NULL, N_("_Auto") },
{ "layers-mask-menu", NULL, N_("_Mask") },
{ "layers-transparency-menu", NULL, N_("Tr_ansparency") },
{ "layers-transform-menu", NULL, N_("_Transform") },
{ "layers-properties-menu", NULL, N_("_Properties") },
{ "layers-opacity-menu", GIMP_STOCK_TRANSPARENCY, N_("_Opacity") },
{ "layers-mode-menu", GIMP_STOCK_TOOL_PENCIL, N_("Layer _Mode") },
{ "layers-text-tool", GIMP_STOCK_TOOL_TEXT,
N_("Te_xt Tool"), NULL, NULL,
......@@ -160,28 +163,28 @@ static GimpActionEntry layers_actions[] =
static GimpToggleActionEntry layers_toggle_actions[] =
{
{ "layers-preserve-transparency", GIMP_STOCK_TRANSPARENCY,
N_("Preserve Transparency"), NULL, NULL,
N_("Keep Transparency"), NULL, NULL,
G_CALLBACK (layers_preserve_trans_cmd_callback),
FALSE,
NULL },
GIMP_HELP_LAYER_KEEP_TRANSPARENCY },
{ "layers-mask-edit", GIMP_STOCK_EDIT,
N_("Edit Layer Mask"), NULL, NULL,
G_CALLBACK (layers_mask_edit_cmd_callback),
FALSE,
NULL },
GIMP_HELP_LAYER_MASK_EDIT },
{ "layers-mask-show", GIMP_STOCK_VISIBLE,
N_("Show Layer Mask"), NULL, NULL,
G_CALLBACK (layers_mask_show_cmd_callback),
FALSE,
NULL },
GIMP_HELP_LAYER_MASK_SHOW },
{ "layers-mask-disable", NULL,
N_("Disable Layer Mask"), NULL, NULL,
G_CALLBACK (layers_mask_disable_cmd_callback),
FALSE,
NULL }
GIMP_HELP_LAYER_MASK_DISABLE }
};
static GimpEnumActionEntry layers_mask_apply_actions[] =
......@@ -271,51 +274,51 @@ static GimpEnumActionEntry layers_opacity_actions[] =
{ "layers-opacity-set", GIMP_STOCK_TRANSPARENCY,
N_("Set Opacity"), NULL, NULL,
GIMP_ACTION_SELECT_SET,
NULL },
{ "layers-opacity-transparent", GTK_STOCK_GOTO_FIRST,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-transparent", GIMP_STOCK_TRANSPARENCY,
"Completely Transparent", NULL, NULL,
GIMP_ACTION_SELECT_FIRST,
NULL },
{ "layers-opacity-opaque", GTK_STOCK_GOTO_LAST,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-opaque", GIMP_STOCK_TRANSPARENCY,
"Completely Opaque", NULL, NULL,
GIMP_ACTION_SELECT_LAST,
NULL },
{ "layers-opacity-decrease", GTK_STOCK_REMOVE,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-decrease", GIMP_STOCK_TRANSPARENCY,
"More Transparent", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS,
NULL },
{ "layers-opacity-increase", GTK_STOCK_ADD,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-increase", GIMP_STOCK_TRANSPARENCY,
"More Opaque", NULL, NULL,
GIMP_ACTION_SELECT_NEXT,
NULL },
{ "layers-opacity-decrease-skip", GTK_STOCK_REMOVE,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-decrease-skip", GIMP_STOCK_TRANSPARENCY,
"10% More Transparent", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS,
NULL },
{ "layers-opacity-increase-skip", GTK_STOCK_ADD,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-increase-skip", GIMP_STOCK_TRANSPARENCY,
"10% More Opaque", NULL, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT,
NULL }
GIMP_HELP_LAYER_OPACITY }
};
static GimpEnumActionEntry layers_paint_mode_actions[] =
static GimpEnumActionEntry layers_mode_actions[] =
{
{ "layers-paint-mode-first", GIMP_STOCK_TOOL_PENCIL,
"First Paint Mode", NULL, NULL,
{ "layers-mode-first", GIMP_STOCK_TOOL_PENCIL,
"First Layer Mode", NULL, NULL,
GIMP_ACTION_SELECT_FIRST,
NULL },
{ "layers-paint-mode-last", GIMP_STOCK_TOOL_PENCIL,
"Last Paint Mode", NULL, NULL,
GIMP_HELP_LAYER_MODE },
{ "layers-mode-last", GIMP_STOCK_TOOL_PENCIL,
"Last Layer Mode", NULL, NULL,
GIMP_ACTION_SELECT_LAST,
NULL },
{ "layers-paint-mode-previous", GIMP_STOCK_TOOL_PENCIL,
"Previous Paint Mode", NULL, NULL,
GIMP_HELP_LAYER_MODE },
{ "layers-mode-previous", GIMP_STOCK_TOOL_PENCIL,
"Previous Layer Mode", NULL, NULL,
GIMP_ACTION_SELECT_PREVIOUS,
NULL },
{ "layers-paint-mode-next", GIMP_STOCK_TOOL_PENCIL,
"Next Paint Mode", NULL, NULL,
GIMP_HELP_LAYER_MODE },
{ "layers-mode-next", GIMP_STOCK_TOOL_PENCIL,
"Next Layer Mode", NULL, NULL,
GIMP_ACTION_SELECT_NEXT,
NULL }
GIMP_HELP_LAYER_MODE }
};
......@@ -356,9 +359,9 @@ layers_actions_setup (GimpActionGroup *group)
G_CALLBACK (layers_opacity_cmd_callback));
gimp_action_group_add_enum_actions (group,
layers_paint_mode_actions,
G_N_ELEMENTS (layers_paint_mode_actions),
G_CALLBACK (layers_paint_mode_cmd_callback));
layers_mode_actions,
G_N_ELEMENTS (layers_mode_actions),
G_CALLBACK (layers_mode_cmd_callback));
}
void
......
......@@ -69,7 +69,7 @@
#include "gimp-intl.h"
static const GimpLayerModeEffects paint_modes[] =
static const GimpLayerModeEffects layer_modes[] =
{
GIMP_NORMAL_MODE,
GIMP_DISSOLVE_MODE,
......@@ -108,7 +108,7 @@ static void layers_resize_layer_query (GimpDisplay *gdisp,
GimpLayer *layer,
GimpContext *context,
GtkWidget *parent);
static gint layers_paint_mode_index (GimpLayerModeEffects paint_mode);
static gint layers_mode_index (GimpLayerModeEffects layer_mode);
/* public functions */
......@@ -559,31 +559,31 @@ layers_opacity_cmd_callback (GtkAction *action,
}
void
layers_paint_mode_cmd_callback (GtkAction *action,
gint value,
gpointer data)
layers_mode_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpImage *gimage;
GimpLayer *layer;
GimpLayerModeEffects paint_mode;
GimpLayerModeEffects layer_mode;
gint index;
GimpUndo *undo;
gboolean push_undo = TRUE;
return_if_no_layer (gimage, layer, data);
undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO,
GIMP_UNDO_LAYER_OPACITY);
GIMP_UNDO_LAYER_MODE);
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (layer))
push_undo = FALSE;
paint_mode = gimp_layer_get_mode (layer);
layer_mode = gimp_layer_get_mode (layer);
index = action_select_value ((GimpActionSelectType) value,
layers_paint_mode_index (paint_mode),
0, G_N_ELEMENTS (paint_modes) - 1,
layers_mode_index (layer_mode),
0, G_N_ELEMENTS (layer_modes) - 1,
1.0, 1.0, FALSE);
gimp_layer_set_mode (layer, paint_modes[index], push_undo);
gimp_layer_set_mode (layer, layer_modes[index], push_undo);
gimp_image_flush (gimage);
}
......@@ -975,13 +975,6 @@ edit_layer_query_response (GtkWidget *widget,
gtk_widget_destroy (options->query_box);
}
static void
edit_layer_query_activate (GtkWidget *widget,
EditLayerOptions *options)
{
gtk_dialog_response (GTK_DIALOG (options->query_box), GTK_RESPONSE_OK);
}
static void
edit_layer_toggle_rename (GtkWidget *widget,
EditLayerOptions *options)
......@@ -1055,6 +1048,7 @@ layers_edit_layer_query (GimpLayer *layer,
gtk_widget_show (table);
options->name_entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (options->name_entry), TRUE);
gtk_entry_set_text (GTK_ENTRY (options->name_entry),
((gimp_layer_is_floating_sel (layer) ?
_("Floating Selection") :
......@@ -1063,10 +1057,6 @@ layers_edit_layer_query (GimpLayer *layer,
_("Layer _Name"), 1.0, 0.5,
options->name_entry, 1, FALSE);
g_signal_connect (options->name_entry, "activate",
G_CALLBACK (edit_layer_query_activate),
options);
/* For text layers add a toggle to control "auto-rename" */
if (gimp_drawable_is_text_layer (GIMP_DRAWABLE (layer)))
{
......@@ -1371,11 +1361,11 @@ layers_resize_layer_query (GimpDisplay *gdisp,
}
static gint
layers_paint_mode_index (GimpLayerModeEffects paint_mode)
layers_mode_index (GimpLayerModeEffects layer_mode)
{
gint i = 0;
while (i < (G_N_ELEMENTS (paint_modes) - 1) && paint_modes[i] != paint_mode)
while (i < (G_N_ELEMENTS (layer_modes) - 1) && layer_modes[i] != layer_mode)
i++;
return i;
......
......@@ -84,7 +84,7 @@ void layers_alpha_to_selection_cmd_callback (GtkAction *action,
void layers_opacity_cmd_callback (GtkAction *action,
gint value,
gpointer data);
void layers_paint_mode_cmd_callback (GtkAction *action,
void layers_mode_cmd_callback (GtkAction *action,
gint value,
gpointer data);
......
......@@ -126,13 +126,13 @@ static GimpToggleActionEntry vectors_toggle_actions[] =
N_("_Visible"), NULL, NULL,
G_CALLBACK (vectors_visible_cmd_callback),
FALSE,
NULL },
GIMP_HELP_PATH_VISIBLE },
{ "vectors-linked", GIMP_STOCK_LINKED,
N_("_Linked"), NULL, NULL,
G_CALLBACK (vectors_linked_cmd_callback),
FALSE,
NULL }
GIMP_HELP_PATH_LINKED }
};
static GimpEnumActionEntry vectors_to_selection_actions[] =
......
......@@ -555,10 +555,11 @@ vectors_new_vectors_query (GimpImage *gimage,
options->name_entry = gtk_entry_new ();
gtk_widget_set_size_request (options->name_entry, 150, -1);
gtk_table_attach_defaults (GTK_TABLE (table), options->name_entry,
1, 2, 0, 1);
gtk_entry_set_activates_default (GTK_ENTRY (options->name_entry), TRUE);
gtk_entry_set_text (GTK_ENTRY (options->name_entry),
(vectors_name ? vectors_name : _("New Path")));
gtk_table_attach_defaults (GTK_TABLE (table), options->name_entry,
1, 2, 0, 1);
gtk_widget_show (options->name_entry);
gtk_widget_show (options->query_box);
......@@ -668,10 +669,11 @@ vectors_edit_vectors_query (GimpVectors *vectors,
options->name_entry = gtk_entry_new ();
gtk_widget_set_size_request (options->name_entry, 150, -1);
gtk_table_attach_defaults (GTK_TABLE (table), options->name_entry,
1, 2, 0, 1);
gtk_entry_set_activates_default (GTK_ENTRY (options->name_entry), TRUE);
gtk_entry_set_text (GTK_ENTRY (options->name_entry),
gimp_object_get_name (GIMP_OBJECT (vectors)));
gtk_table_attach_defaults (GTK_TABLE (table), options->name_entry,
1, 2, 0, 1);
gtk_widget_show (options->name_entry);
gtk_widget_show (options->query_box);
......
......@@ -144,9 +144,17 @@
#define GIMP_HELP_LAYER_DESATURATE "gimp-layer-desaturate"
#define GIMP_HELP_LAYER_INVERT "gimp-layer-invert"
#define GIMP_HELP_LAYER_EQUALIZE "gimp-layer-equalize"
#define GIMP_HELP_LAYER_VISIBLE "gimp-layer-visible"
#define GIMP_HELP_LAYER_LINKED "gimp-layer-linked"
#define GIMP_HELP_LAYER_OPACITY "gimp-layer-opacity"
#define GIMP_HELP_LAYER_MODE "gimp-layer-mode"
#define GIMP_HELP_LAYER_KEEP_TRANSPARENCY "gimp-layer-keep-transparency"
#define GIMP_HELP_LAYER_MASK_ADD "gimp-layer-mask-add"
#define GIMP_HELP_LAYER_MASK_APPLY "gimp-layer-mask-apply"
#define GIMP_HELP_LAYER_MASK_DELETE "gimp-layer-mask-delete"
#define GIMP_HELP_LAYER_MASK_EDIT "gimp-layer-mask-edit"
#define GIMP_HELP_LAYER_MASK_SHOW "gimp-layer-mask-show"
#define GIMP_HELP_LAYER_MASK_DISABLE "gimp-layer-mask-disable"
#define GIMP_HELP_LAYER_MASK_SELECTION_REPLACE "gimp-layer-mask-selection-replace"
#define GIMP_HELP_LAYER_MASK_SELECTION_ADD "gimp-layer-mask-selection-add"
#define GIMP_HELP_LAYER_MASK_SELECTION_SUBTRACT "gimp-layer-mask-selection-subtract"
......@@ -196,6 +204,8 @@
#define GIMP_HELP_PATH_DUPLICATE "gimp-path-duplicate"
#define GIMP_HELP_PATH_DELETE "gimp-path-delete"
#define GIMP_HELP_PATH_MERGE_VISIBLE "gimp-path-merge-visible"
#define GIMP_HELP_PATH_VISIBLE "gimp-path-visible"
#define GIMP_HELP_PATH_LINKED "gimp-path-linked"
#define GIMP_HELP_PATH_SELECTION_REPLACE "gimp-path-selection-replace"
#define GIMP_HELP_PATH_SELECTION_ADD "gimp-path-selection-add"
#define GIMP_HELP_PATH_SELECTION_SUBTRACT "gimp-path-selection-subtract"
......
......@@ -39,7 +39,7 @@
<menu action="context-colors-menu" name="Colors">
<menuitem action="context-colors-default" />
<menuitem action="context-colors-swap" />
</menu>
</menu>
<menu action="context-opacity-menu" name="Opacity">
<menuitem action="context-opacity-transparent" />
<menuitem action="context-opacity-opaque" />
......@@ -389,6 +389,26 @@
<separator />
<menuitem action="drawable-offset" />
</menu>
<!--
<menu action="layers-properties-menu" name="Properties">
<menuitem action="layers-edit-attributes" />
<menu action="layers-opacity-menu" name="Opacity">
<menuitem action="layers-opacity-transparent" />
<menuitem action="layers-opacity-opaque" />
<menuitem action="layers-opacity-decrease" />
<menuitem action="layers-opacity-increase" />
</menu>
<menu action="layers-mode-menu" name="Layer Mode">
<menuitem action="layers-mode-first" />
<menuitem action="layers-mode-last" />
<menuitem action="layers-mode-previous" />
<menuitem action="layers-mode-next" />
</menu>
<menuitem action="drawable-visible" />
<menuitem action="drawable-linked" />
<menuitem action="layers-preserve-transparency" />
</menu>
-->
<separator />
<placeholder name="Resize">
<menuitem action="layers-resize" />
......@@ -401,14 +421,6 @@
<menuitem action="layers-crop" />
</placeholder>
<separator />
<!--
<placeholder name="Properties">
<menuitem action="drawable-visible" />
<menuitem action="drawable-linked" />
<menuitem action="layers-preserve-transparency" />
</placeholder>
-->
<separator />
</menu>
<menu action="tools-menu" name="Tools">
......
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