diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-04-25 23:23:09 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-04-25 23:23:09 +0800 |
commit | 7fcf1690b730892033993c1001c08666448f90b1 (patch) | |
tree | e1080fc2e0b87abacd9fee7aec64d377ab525bdf /lib | |
parent | 33a47e1d4cc08edd1006d3bfd85b7a15d350119d (diff) | |
download | gsoc2013-epiphany-7fcf1690b730892033993c1001c08666448f90b1.tar gsoc2013-epiphany-7fcf1690b730892033993c1001c08666448f90b1.tar.gz gsoc2013-epiphany-7fcf1690b730892033993c1001c08666448f90b1.tar.bz2 gsoc2013-epiphany-7fcf1690b730892033993c1001c08666448f90b1.tar.lz gsoc2013-epiphany-7fcf1690b730892033993c1001c08666448f90b1.tar.xz gsoc2013-epiphany-7fcf1690b730892033993c1001c08666448f90b1.tar.zst gsoc2013-epiphany-7fcf1690b730892033993c1001c08666448f90b1.zip |
Get back toolbar editing functionalities. More work on the bookmarks
2003-04-25 Marco Pesenti Gritti <marco@it.gnome.org>
* data/ui/epiphany-toolbar.xml.in:
* data/ui/epiphany-ui.xml.in:
* lib/egg/egg-editable-toolbar.c: (egg_editable_toolbar_hide),
(egg_editable_toolbar_set_drag_dest):
* lib/egg/egg-editable-toolbar.h:
* src/bookmarks/ephy-topic-action.c: (create_tool_item):
* src/ephy-shell.c: (save_toolbars), (ephy_shell_finalize),
(ephy_shell_get_toolbars_model):
* src/ephy-toolbars-model.c: (impl_add_item),
(ephy_toolbars_model_class_init):
* src/ephy-toolbars-model.h:
* src/ephy-window.c: (ephy_window_set_chrome):
* src/toolbar.c: (ensure_bookmark_action), (toolbar_ensure_action),
(action_added_cb), (init_bookmarks_toolbar), (toolbar_set_window),
(toolbar_new), (toolbar_set_visibility):
* src/toolbar.h:
* src/window-commands.c: (toolbar_editor_destroy_cb),
(window_cmd_edit_toolbar):
Get back toolbar editing functionalities.
More work on the bookmarks toolbars implementation.
The toolbars context menus are regressed but it's not my fault :/
The signal on EggToolbar is borked.
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/egg/egg-editable-toolbar.c | 51 | ||||
-rwxr-xr-x | lib/egg/egg-editable-toolbar.h | 23 |
2 files changed, 63 insertions, 11 deletions
diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c index 5220629a5..b024bf7df 100755 --- a/lib/egg/egg-editable-toolbar.c +++ b/lib/egg/egg-editable-toolbar.c @@ -585,3 +585,54 @@ egg_editable_toolbar_show (EggEditableToolbar *etoolbar, } } } + +void +egg_editable_toolbar_hide (EggEditableToolbar *etoolbar, + const char *name) +{ + int i, n_toolbars; + EggToolbarsModel *model = etoolbar->priv->model; + + g_return_if_fail (model != NULL); + + n_toolbars = egg_toolbars_model_n_toolbars (model); + for (i = 0; i < n_toolbars; i++) + { + const char *toolbar_name; + + toolbar_name = egg_toolbars_model_toolbar_nth (model, i); + if (strcmp (toolbar_name, name) == 0) + { + gtk_widget_hide (get_toolbar_nth (etoolbar, i)); + } + } +} + +void +egg_editable_toolbar_set_drag_dest (EggEditableToolbar *etoolbar, + const GtkTargetEntry *targets, + gint n_targets, + const char *toolbar_name) +{ + int i, n_toolbars; + EggToolbarsModel *model = etoolbar->priv->model; + + g_return_if_fail (model != NULL); + + n_toolbars = egg_toolbars_model_n_toolbars (model); + for (i = 0; i < n_toolbars; i++) + { + const char *name; + + name = egg_toolbars_model_toolbar_nth (model, i); + if (strcmp (toolbar_name, name) == 0) + { + GtkWidget *widget = get_toolbar_nth (etoolbar, i); + gtk_drag_dest_unset (widget); + gtk_drag_dest_set (widget, GTK_DEST_DEFAULT_DROP, + targets, n_targets, + GDK_ACTION_MOVE | GDK_ACTION_COPY); + } + } +} + diff --git a/lib/egg/egg-editable-toolbar.h b/lib/egg/egg-editable-toolbar.h index d528ca4a4..5a73d4205 100755 --- a/lib/egg/egg-editable-toolbar.h +++ b/lib/egg/egg-editable-toolbar.h @@ -53,17 +53,18 @@ struct EggEditableToolbarClass }; GType egg_editable_toolbar_get_type (void); -GtkWidget *egg_editable_toolbar_new (EggMenuMerge *merge, - EggToolbarsModel *model); -void egg_editable_toolbar_set_edit_mode (EggEditableToolbar *etoolbar, - gboolean mode); -void egg_editable_toolbar_show (EggEditableToolbar *etoolbar, - const char *name); -void egg_editable_toolbar_hide (EggEditableToolbar *etoolbar, - const char *name); -void egg_editable_toolbar_add_drag_type (EggEditableToolbar *etoolbar, - const char *drag_type, - const char *toolbar_name); +GtkWidget *egg_editable_toolbar_new (EggMenuMerge *merge, + EggToolbarsModel *model); +void egg_editable_toolbar_set_edit_mode (EggEditableToolbar *etoolbar, + gboolean mode); +void egg_editable_toolbar_show (EggEditableToolbar *etoolbar, + const char *name); +void egg_editable_toolbar_hide (EggEditableToolbar *etoolbar, + const char *name); +void egg_editable_toolbar_set_drag_dest (EggEditableToolbar *etoolbar, + const GtkTargetEntry *targets, + gint n_targets, + const char *toolbar_name); G_END_DECLS |