app, menus: rename confusing layers-text-tool and vectors-path-tool.

"layers-text-tool" action shows as "Text Tool" while "vectors-path-tool"
shows as "Path Tool". That's very confusing with tools-text and
tools-vectors respectively.
These actions are mostly about entering in edit mode with the active
layer or path. For text layers, it will enter text edition on canvas,
whereas just open the attributes edition dialog on other layers. For
consistency, layers-text-edit is renamed as well too layers-edit-text.
This also fix the side effect of commits 10099bd and 526918b where I
didn't realize that layers-text-tool was also working on non text layers
on purpose (being very badly named). Now there is a separate layers-edit
and layers-edit-text.
Thanks to Pat David for English corrections. :-)
This commit is contained in:
Jehan 2017-05-13 00:15:05 +02:00
parent 002e7fc98f
commit 0dbdf232d5
11 changed files with 61 additions and 21 deletions

View File

@ -85,11 +85,17 @@ static const GimpActionEntry layers_actions[] =
{ "layers-mode-menu", GIMP_ICON_TOOL_PENCIL,
NC_("layers-action", "Layer _Mode") },
{ "layers-text-tool", GIMP_ICON_TOOL_TEXT,
NC_("layers-action", "Te_xt Tool"), NULL,
NC_("layers-action", "Activate the text tool on this text layer"),
G_CALLBACK (layers_text_tool_cmd_callback),
GIMP_HELP_TOOL_TEXT },
{ "layers-edit", GIMP_ICON_EDIT,
NC_("layers-action", "Default edit action"), NULL,
NC_("layers-action", "Activate the default edit action for this type of layer"),
G_CALLBACK (layers_edit_cmd_callback),
GIMP_HELP_LAYER_EDIT },
{ "layers-edit-text", GIMP_ICON_EDIT,
NC_("layers-action", "Edit Te_xt on canvas"), NULL,
NC_("layers-action", "Edit this text layer content on canvas"),
G_CALLBACK (layers_edit_text_cmd_callback),
GIMP_HELP_LAYER_EDIT },
{ "layers-edit-attributes", GIMP_ICON_EDIT,
NC_("layers-action", "_Edit Layer Attributes..."), NULL,
@ -866,8 +872,9 @@ layers_actions_update (GimpActionGroup *group,
#define SET_LABEL(action,label) \
gimp_action_group_set_action_label (group, action, label)
SET_VISIBLE ("layers-text-tool", text_layer && !ac);
SET_SENSITIVE ("layers-text-tool", text_layer && !ac);
SET_SENSITIVE ("layers-edit", !ac && ((layer && !fs) || text_layer));
SET_VISIBLE ("layers-edit-text", text_layer && !ac);
SET_SENSITIVE ("layers-edit-text", text_layer && !ac);
SET_SENSITIVE ("layers-edit-attributes", layer && !fs && !ac);
if (layer && gimp_layer_is_floating_sel (layer))

View File

@ -176,7 +176,27 @@ static GimpInterpolationType layer_scale_interp = -1;
/* public functions */
void
layers_text_tool_cmd_callback (GtkAction *action,
layers_edit_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
GtkWidget *widget;
return_if_no_layer (image, layer, data);
return_if_no_widget (widget, data);
if (gimp_item_is_text_layer (GIMP_ITEM (layer)))
{
layers_edit_text_cmd_callback (action, data);
}
else
{
layers_edit_attributes_cmd_callback (action, data);
}
}
void
layers_edit_text_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *image;

View File

@ -19,7 +19,9 @@
#define __LAYERS_COMMANDS_H__
void layers_text_tool_cmd_callback (GtkAction *action,
void layers_edit_cmd_callback (GtkAction *action,
gpointer data);
void layers_edit_text_cmd_callback (GtkAction *action,
gpointer data);
void layers_edit_attributes_cmd_callback (GtkAction *action,
gpointer data);

View File

@ -50,9 +50,10 @@ static const GimpActionEntry vectors_actions[] =
NC_("vectors-action", "Color Tag"), NULL, NULL, NULL,
GIMP_HELP_PATH_COLOR_TAG },
{ "vectors-path-tool", GIMP_ICON_TOOL_PATH,
NC_("vectors-action", "Path _Tool"), NULL, NULL,
G_CALLBACK (vectors_vectors_tool_cmd_callback),
{ "vectors-edit", GIMP_ICON_TOOL_PATH,
NC_("vectors-action", "Edit Pa_th"), NULL,
NC_("vectors-action", "Edit the active path"),
G_CALLBACK (vectors_edit_cmd_callback),
GIMP_HELP_TOOL_VECTORS },
{ "vectors-edit-attributes", GIMP_ICON_EDIT,
@ -380,7 +381,7 @@ vectors_actions_update (GimpActionGroup *group,
#define SET_ACTIVE(action,condition) \
gimp_action_group_set_action_active (group, action, (condition) != 0)
SET_SENSITIVE ("vectors-path-tool", vectors);
SET_SENSITIVE ("vectors-edit", vectors);
SET_SENSITIVE ("vectors-edit-attributes", vectors);
SET_SENSITIVE ("vectors-new", image);

View File

@ -111,8 +111,8 @@ static void vectors_export_callback (GtkWidget *dialog,
/* public functions */
void
vectors_vectors_tool_cmd_callback (GtkAction *action,
gpointer data)
vectors_edit_cmd_callback (GtkAction *action,
gpointer data)
{
GimpImage *image;
GimpVectors *vectors;

View File

@ -19,7 +19,7 @@
#define __VECTORS_COMMANDS_H__
void vectors_vectors_tool_cmd_callback (GtkAction *action,
void vectors_edit_cmd_callback (GtkAction *action,
gpointer data);
void vectors_edit_attributes_cmd_callback (GtkAction *action,
gpointer data);

View File

@ -486,7 +486,9 @@ user_install_mkdir_with_parents (GimpUserInstall *install,
"\"<Actions>/file/file-export\"" "|" \
"\"<Actions>/edit/edit-paste-as-new\"" "|" \
"\"<Actions>/buffers/buffers-paste-as-new\"" "|" \
"\"<Actions>/tools/tools-value-[1-4]-.*\""
"\"<Actions>/tools/tools-value-[1-4]-.*\"" "|" \
"\"<Actions>/layers/layers-text-tool\"" "|" \
"\"<Actions>/vectors/vectors-path-tool\""
/**
* callback to use for updating a menurc from GIMP over 2.0.
@ -544,6 +546,14 @@ user_update_menurc_over20 (const GMatchInfo *matched_value,
g_string_append (new_value, "\"<Actions>/tools/tools-angle-");
g_string_append (new_value, match + 31);
}
else if (g_strcmp0 (match, "\"<Actions>/layers/layers-text-tool\"") == 0)
{
g_string_append (new_value, "\"<Actions>/layers/layers-edit\"");
}
else if (g_strcmp0 (match, "\"<Actions>/vectors/vectors-path-tool\"") == 0)
{
g_string_append (new_value, "\"<Actions>/vectors/vectors-edit\"");
}
/* Should not happen. Just in case we match something unexpected by
* mistake.
*/

View File

@ -210,7 +210,7 @@ gimp_layer_tree_view_class_init (GimpLayerTreeViewClass *klass)
item_view_class->new_item = gimp_layer_tree_view_item_new;
item_view_class->action_group = "layers";
item_view_class->activate_action = "layers-text-tool";
item_view_class->activate_action = "layers-edit";
item_view_class->new_action = "layers-new";
item_view_class->new_default_action = "layers-new-last-values";
item_view_class->raise_action = "layers-raise";

View File

@ -98,7 +98,7 @@ gimp_vectors_tree_view_class_init (GimpVectorsTreeViewClass *klass)
iv_class->new_item = gimp_vectors_tree_view_item_new;
iv_class->action_group = "vectors";
iv_class->activate_action = "vectors-path-tool";
iv_class->activate_action = "vectors-edit";
iv_class->new_action = "vectors-new";
iv_class->new_default_action = "vectors-new-last-values";
iv_class->raise_action = "vectors-raise";

View File

@ -3,7 +3,7 @@
<ui>
<popup action="layers-popup">
<menuitem action="layers-text-tool" />
<menuitem action="layers-edit-text" />
<menuitem action="layers-edit-attributes" />
<menu action="layers-blend-space-menu" name="Blend Space">
<menuitem action="layers-blend-space-auto" />

View File

@ -3,7 +3,7 @@
<ui>
<popup action="vectors-popup">
<menuitem action="vectors-path-tool" />
<menuitem action="vectors-edit" />
<menuitem action="vectors-edit-attributes" />
<menu action="vectors-color-tag-menu" name="Color Tags">
<menuitem action="vectors-color-tag-none" />