Commit e80c9172 authored by Øyvind Kolås's avatar Øyvind Kolås

added raise/lower commands to the menu when in move mode.

* bin/editor.c: (raise), (lower), (gui_press_event):
* bin/gegl-tree-editor-action.c: (gegl_move_item_up),
(gegl_move_item_down): added raise/lower commands to the menu when in
move mode.

svn path=/trunk/; revision=2716
parent d3afda38
2008-11-09 Øyvind Kolås <pippin@gimp.org>
* bin/editor.c: (raise), (lower), (gui_press_event):
* bin/gegl-tree-editor-action.c: (gegl_move_item_up),
(gegl_move_item_down): added raise/lower commands to the menu when in
move mode.
2008-11-09 Øyvind Kolås <pippin@gimp.org> 2008-11-09 Øyvind Kolås <pippin@gimp.org>
* bin/gegl-tree-editor-action.c: (gegl_remove_item): added a function * bin/gegl-tree-editor-action.c: (gegl_remove_item): added a function
......
...@@ -933,6 +933,35 @@ static void path_slice (cairo_t *cr, ...@@ -933,6 +933,35 @@ static void path_slice (cairo_t *cr,
} }
void gegl_remove_item (GeglNode *node); void gegl_remove_item (GeglNode *node);
void gegl_move_item_up (GeglNode *node);
void gegl_move_item_down (GeglNode *node);
static gint raise (gint argc, char **argv)
{
GeglNode *self = tree_editor_get_active (editor.tree_editor);
GeglNode *parent = gegl_parent (self);
if (g_str_equal (gegl_node_get_operation (parent), "gegl:over"))
{
gegl_move_item_up (parent);
tree_editor_set_active (editor.tree_editor, self);
}
return 0;
}
static gint lower (gint argc, char **argv)
{
GeglNode *self = tree_editor_get_active (editor.tree_editor);
GeglNode *parent = gegl_parent (self);
if (g_str_equal (gegl_node_get_operation (parent), "gegl:over"))
{
gegl_move_item_down (parent);
tree_editor_set_active (editor.tree_editor, self);
}
return 0;
}
static gint remove_item (gint argc, char **argv) static gint remove_item (gint argc, char **argv)
{ {
...@@ -1284,6 +1313,8 @@ gui_press_event (GtkWidget *widget, ...@@ -1284,6 +1313,8 @@ gui_press_event (GtkWidget *widget,
case STATE_MOVE: case STATE_MOVE:
menu_add ("paint", G_CALLBACK (do_command), "set-state strokes"); menu_add ("paint", G_CALLBACK (do_command), "set-state strokes");
menu_add ("path", G_CALLBACK (do_command), "set-state edit-nodes"); menu_add ("path", G_CALLBACK (do_command), "set-state edit-nodes");
menu_add ("raise", G_CALLBACK (do_command), "raise");
menu_add ("lower", G_CALLBACK (do_command), "lower");
menu_add ("width", G_CALLBACK (do_command), "set-state edit-width"); menu_add ("width", G_CALLBACK (do_command), "set-state edit-width");
menu_add ("remove", G_CALLBACK (do_command), "remove-item"); menu_add ("remove", G_CALLBACK (do_command), "remove-item");
/* check the current curve type,. */ /* check the current curve type,. */
......
...@@ -403,6 +403,27 @@ add_sibling_op (GtkAction *action, gpointer userdata) ...@@ -403,6 +403,27 @@ add_sibling_op (GtkAction *action, gpointer userdata)
gtk_tree_selection_select_iter (tree_selection, &iter); gtk_tree_selection_select_iter (tree_selection, &iter);
} }
void gegl_move_item_up (GeglNode *node);
void gegl_move_item_up (GeglNode *node)
{
/* hack hack */
tree_editor_set_active (editor.tree_editor, node);
move_up (NULL, tree_editor_get_treeview (editor.tree_editor));
node = tree_editor_get_active (editor.tree_editor);
property_editor_rebuild (editor.property_editor, node);
}
void gegl_move_item_down (GeglNode *node);
void gegl_move_item_down (GeglNode *node)
{
/* hack hack */
tree_editor_set_active (editor.tree_editor, node);
move_down (NULL, tree_editor_get_treeview (editor.tree_editor));
node = tree_editor_get_active (editor.tree_editor);
property_editor_rebuild (editor.property_editor, node);
}
void gegl_remove_item (GeglNode *node); void gegl_remove_item (GeglNode *node);
void gegl_remove_item (GeglNode *node) void gegl_remove_item (GeglNode *node)
......
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