Commit 39614b34 authored by Simon Budig's avatar Simon Budig Committed by Simon Budig

renamed tool_manager_arrow_key_active to tool_manager_key_press_active.

2004-06-12  Simon Budig  <simon@gimp.org>

	* app/tools/tool_manager.[ch]: renamed
	tool_manager_arrow_key_active to tool_manager_key_press_active.

	* app/display/gimpdisplayshell-callbacks.c: Also dispatch
	GDK_Return/KP_Enter/BackSpace/Delete to the tools "arrow_key"
	member of GimpTool probably should be renamed.

	* app/tools/gimpvectortool.c: Use Enter/Return to convert the
	current path to a selection, use Backspace/Delete to delete the
	currently active anchors in a path.

	Implemented on Jimmacs request - thanks for being a great host  :)
parent fc03867f
2004-06-12 Simon Budig <simon@gimp.org>
* app/tools/tool_manager.[ch]: renamed
tool_manager_arrow_key_active to tool_manager_key_press_active.
* app/display/gimpdisplayshell-callbacks.c: Also dispatch
GDK_Return/KP_Enter/BackSpace/Delete to the tools "arrow_key"
member of GimpTool probably should be renamed.
* app/tools/gimpvectortool.c: Use Enter/Return to convert the
current path to a selection, use Backspace/Delete to delete the
currently active anchors in a path.
Implemented on Jimmacs request - thanks for being a great host :)
2004-06-12 Sven Neumann <sven@gimp.org>
* app/widgets/gimphistogrameditor.c (gimp_histogram_editor_init):
......
......@@ -169,6 +169,8 @@ gimp_display_shell_events (GtkWidget *widget,
case GDK_Alt_L: case GDK_Alt_R:
case GDK_Shift_L: case GDK_Shift_R:
case GDK_Control_L: case GDK_Control_R:
case GDK_Return: case GDK_KP_Enter:
case GDK_BackSpace: case GDK_Delete:
break;
case GDK_Escape:
......@@ -1072,13 +1074,17 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
switch (kevent->keyval)
{
case GDK_Return:
case GDK_KP_Enter:
case GDK_BackSpace:
case GDK_Delete:
case GDK_Left:
case GDK_Right:
case GDK_Up:
case GDK_Down:
if (! gimp_image_is_empty (gimage))
{
tool_manager_arrow_key_active (gimp,
tool_manager_key_press_active (gimp,
kevent,
gdisp);
}
......
......@@ -131,6 +131,8 @@ static void gimp_vector_tool_move_selected_anchors
(GimpVectorTool *vector_tool,
gdouble x,
gdouble y);
static void gimp_vector_tool_delete_selected_anchors
(GimpVectorTool *vector_tool);
static void gimp_vector_tool_verify_state (GimpVectorTool *vector_tool);
static void gimp_vector_tool_undo_push (GimpVectorTool *vector_tool,
const gchar *desc);
......@@ -814,6 +816,15 @@ gimp_vector_tool_arrow_key (GimpTool *tool,
switch (kevent->keyval)
{
case GDK_KP_Enter:
case GDK_Return:
gimp_vector_tool_to_selection_extended (vector_tool,
kevent->state);
break;
case GDK_BackSpace:
case GDK_Delete:
gimp_vector_tool_delete_selected_anchors (vector_tool);
break;
case GDK_Left:
gimp_vector_tool_move_selected_anchors (vector_tool, -xdist, 0);
break;
......@@ -1687,6 +1698,32 @@ gimp_vector_tool_move_selected_anchors (GimpVectorTool *vector_tool,
}
}
static void
gimp_vector_tool_delete_selected_anchors (GimpVectorTool *vector_tool)
{
GimpAnchor *cur_anchor;
GimpStroke *cur_stroke = NULL;
GList *anchors;
GList *list;
while ((cur_stroke = gimp_vectors_stroke_get_next (vector_tool->vectors,
cur_stroke)))
{
/* anchors */
anchors = gimp_stroke_get_draw_anchors (cur_stroke);
for (list = anchors; list; list = g_list_next (list))
{
cur_anchor = GIMP_ANCHOR (list->data);
if (cur_anchor->selected)
gimp_stroke_anchor_delete (cur_stroke, cur_anchor);
}
g_list_free (anchors);
}
}
static void
gimp_vector_tool_verify_state (GimpVectorTool *vector_tool)
{
......
......@@ -329,7 +329,7 @@ tool_manager_motion_active (Gimp *gimp,
}
void
tool_manager_arrow_key_active (Gimp *gimp,
tool_manager_key_press_active (Gimp *gimp,
GdkEventKey *kevent,
GimpDisplay *gdisp)
{
......
......@@ -53,7 +53,7 @@ void tool_manager_motion_active (Gimp *gimp,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp);
void tool_manager_arrow_key_active (Gimp *gimp,
void tool_manager_key_press_active (Gimp *gimp,
GdkEventKey *kevent,
GimpDisplay *gdisp);
......
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