diff options
author | Marco Pesenti Gritti <marco@gnome.org> | 2004-07-11 18:31:28 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2004-07-11 18:31:28 +0800 |
commit | b341a4983b97e022d87e16590d5b7d8aa88c5374 (patch) | |
tree | adc72d21c5fc21df52a0df1549a7b1acedae4df3 /lib/egg/egg-toolbars-model.c | |
parent | 391cc13ee086c2af18e9ad75ad0c626d7e6a26e6 (diff) | |
download | gsoc2013-epiphany-b341a4983b97e022d87e16590d5b7d8aa88c5374.tar gsoc2013-epiphany-b341a4983b97e022d87e16590d5b7d8aa88c5374.tar.gz gsoc2013-epiphany-b341a4983b97e022d87e16590d5b7d8aa88c5374.tar.bz2 gsoc2013-epiphany-b341a4983b97e022d87e16590d5b7d8aa88c5374.tar.lz gsoc2013-epiphany-b341a4983b97e022d87e16590d5b7d8aa88c5374.tar.xz gsoc2013-epiphany-b341a4983b97e022d87e16590d5b7d8aa88c5374.tar.zst gsoc2013-epiphany-b341a4983b97e022d87e16590d5b7d8aa88c5374.zip |
Add api to move items.
2004-07-11 Marco Pesenti Gritti <marco@gnome.org>
* lib/egg/egg-toolbars-model.c: (egg_toolbars_model_move_item):
* lib/egg/egg-toolbars-model.h:
Add api to move items.
* src/bookmarks/ephy-bookmark-action.c: (get_item_position),
(remove_from_model), (move_in_model), (move_left_activate_cb),
(move_right_activate_cb), (show_context_menu):
* src/bookmarks/ephy-topic-action.c: (get_item_position),
(remove_from_model), (move_in_model), (move_left_activate_cb),
(move_right_activate_cb), (show_context_menu):
Add Move Left/Move Right context menus.
Diffstat (limited to 'lib/egg/egg-toolbars-model.c')
-rwxr-xr-x | lib/egg/egg-toolbars-model.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c index f10dcc25b..e38d0f96d 100755 --- a/lib/egg/egg-toolbars-model.c +++ b/lib/egg/egg-toolbars-model.c @@ -668,6 +668,37 @@ egg_toolbars_model_remove_item (EggToolbarsModel *t, toolbar_position, position); } +void +egg_toolbars_model_move_item (EggToolbarsModel *t, + int toolbar_position, + int position, + int new_toolbar_position, + int new_position) +{ + GNode *node, *toolbar, *new_toolbar; + + g_return_if_fail (EGG_IS_TOOLBARS_MODEL (t)); + + toolbar = g_node_nth_child (t->priv->toolbars, toolbar_position); + g_return_if_fail (toolbar != NULL); + + new_toolbar = g_node_nth_child (t->priv->toolbars, new_toolbar_position); + g_return_if_fail (new_toolbar != NULL); + + node = g_node_nth_child (toolbar, position); + g_return_if_fail (node != NULL); + + g_node_unlink (node); + + g_signal_emit (G_OBJECT (t), egg_toolbars_model_signals[ITEM_REMOVED], 0, + toolbar_position, position); + + g_node_insert (new_toolbar, new_position, node); + + g_signal_emit (G_OBJECT (t), egg_toolbars_model_signals[ITEM_ADDED], 0, + new_toolbar_position, new_position); +} + int egg_toolbars_model_n_items (EggToolbarsModel *t, int toolbar_position) |