diff options
author | Marco Pesenti Gritti <marco@gnome.org> | 2003-09-19 16:50:56 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2003-09-19 16:50:56 +0800 |
commit | e886e958845ad243debf35139ffa81be9aad3088 (patch) | |
tree | f34abd6e2d5a11a346d59b0584e25a0900e7e127 /lib/egg | |
parent | 3d4cc4657225dcd214857e2c6d9798d881d00623 (diff) | |
download | gsoc2013-epiphany-e886e958845ad243debf35139ffa81be9aad3088.tar gsoc2013-epiphany-e886e958845ad243debf35139ffa81be9aad3088.tar.gz gsoc2013-epiphany-e886e958845ad243debf35139ffa81be9aad3088.tar.bz2 gsoc2013-epiphany-e886e958845ad243debf35139ffa81be9aad3088.tar.lz gsoc2013-epiphany-e886e958845ad243debf35139ffa81be9aad3088.tar.xz gsoc2013-epiphany-e886e958845ad243debf35139ffa81be9aad3088.tar.zst gsoc2013-epiphany-e886e958845ad243debf35139ffa81be9aad3088.zip |
Do not use .in for not to translate files.
2003-09-19 Marco Pesenti Gritti <marco@gnome.org>
* data/ui/Makefile.am:
* data/ui/epiphany-bookmark-editor-ui.xml.in:
* data/ui/epiphany-fs-toolbar.xml:
* data/ui/epiphany-history-window-ui.xml.in:
* data/ui/epiphany-toolbar.xml.in:
* data/ui/epiphany-ui.xml.in:
Do not use .in for not to translate files.
* lib/egg/egg-editable-toolbar.c: (create_toolbar),
(toolbars_clean), (egg_editable_toolbar_construct),
(egg_editable_toolbar_set_model), (egg_editable_toolbar_set_merge):
* lib/egg/egg-toolbars-model.c: (parse_toolbars):
Handle change of properties correctly. Add a toolbar
style property in the xml.
* src/bookmarks/ephy-bookmark-properties.c:
(ephy_bookmark_properties_init):
* src/bookmarks/ephy-bookmarks-editor.c:
(ephy_bookmarks_editor_init):
* src/ephy-shell.c: (ephy_shell_init), (ephy_shell_finalize),
(ephy_shell_get_toolbars_model):
* src/ephy-shell.h:
* src/ephy-window.c: (ephy_window_fullscreen),
(ephy_window_unfullscreen):
* src/toolbar.c: (bookmark_destroy_cb), (toolbar_ensure_action),
(init_bookmarks_toolbar), (init_normal_mode),
(init_fullscreen_mode), (window_state_event_cb),
(toolbar_set_window), (toolbar_set_visibility):
* src/toolbar.h:
* src/window-commands.c: (toolbar_editor_response_cb),
(window_cmd_edit_toolbar):
Special, more compact, toolbar layout for fullscreen.
Diffstat (limited to 'lib/egg')
-rwxr-xr-x | lib/egg/egg-editable-toolbar.c | 68 | ||||
-rwxr-xr-x | lib/egg/egg-toolbars-model.c | 8 |
2 files changed, 59 insertions, 17 deletions
diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c index 85537c9bd..d69088200 100755 --- a/lib/egg/egg-editable-toolbar.c +++ b/lib/egg/egg-editable-toolbar.c @@ -309,6 +309,7 @@ create_toolbar (EggEditableToolbar *t) toolbar = gtk_toolbar_new (); gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), TRUE); + gtk_widget_show (toolbar); gtk_drag_dest_set (toolbar, GTK_DEST_DEFAULT_DROP, dest_drag_types, n_dest_drag_types, @@ -482,24 +483,18 @@ item_removed_cb (EggToolbarsModel *model, } static void -egg_editable_toolbar_set_model (EggEditableToolbar *t, - EggToolbarsModel *model) +toolbars_clean (EggEditableToolbar *t) { - g_return_if_fail (IS_EGG_TOOLBARS_MODEL (model)); - g_return_if_fail (IS_EGG_EDITABLE_TOOLBAR (t)); + GList *children, *l; - t->priv->model = model; + children = gtk_container_get_children (GTK_CONTAINER (t)); - g_signal_connect_object (model, "item_added", - G_CALLBACK (item_added_cb), t, 0); - g_signal_connect_object (model, "item_removed", - G_CALLBACK (item_removed_cb), t, 0); - g_signal_connect_object (model, "toolbar_added", - G_CALLBACK (toolbar_added_cb), t, 0); - g_signal_connect_object (model, "toolbar_removed", - G_CALLBACK (toolbar_removed_cb), t, 0); - g_signal_connect_object (model, "toolbar_changed", - G_CALLBACK (toolbar_changed_cb), t, 0); + for (l = children; l != NULL; l = l->next) + { + gtk_widget_destroy (GTK_WIDGET (l->data)); + } + + g_list_free (children); } static void @@ -515,10 +510,17 @@ egg_editable_toolbar_construct (EggEditableToolbar *t) for (i = 0; i < n_toolbars; i++) { GtkWidget *toolbar; + EggTbModelFlags flags; toolbar = create_toolbar (t); gtk_box_pack_start (GTK_BOX (t), toolbar, FALSE, FALSE, 0); + flags = egg_toolbars_model_get_flags (model, i); + if (flags & EGG_TB_MODEL_ICONS_ONLY) + { + gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS); + } + n_items = egg_toolbars_model_n_items (model, i); for (l = 0; l < n_items; l++) { @@ -537,15 +539,47 @@ egg_editable_toolbar_construct (EggEditableToolbar *t) } static void +egg_editable_toolbar_set_model (EggEditableToolbar *t, + EggToolbarsModel *model) +{ + g_return_if_fail (IS_EGG_TOOLBARS_MODEL (model)); + g_return_if_fail (IS_EGG_EDITABLE_TOOLBAR (t)); + + if (t->priv->model == model) return; + + t->priv->model = model; + + toolbars_clean (t); + egg_editable_toolbar_construct (t); + + g_signal_connect_object (model, "item_added", + G_CALLBACK (item_added_cb), t, 0); + g_signal_connect_object (model, "item_removed", + G_CALLBACK (item_removed_cb), t, 0); + g_signal_connect_object (model, "toolbar_added", + G_CALLBACK (toolbar_added_cb), t, 0); + g_signal_connect_object (model, "toolbar_removed", + G_CALLBACK (toolbar_removed_cb), t, 0); + g_signal_connect_object (model, "toolbar_changed", + G_CALLBACK (toolbar_changed_cb), t, 0); +} + +static void egg_editable_toolbar_set_merge (EggEditableToolbar *t, GtkUIManager *merge) { g_return_if_fail (GTK_IS_UI_MANAGER (merge)); g_return_if_fail (IS_EGG_EDITABLE_TOOLBAR (t)); - t->priv->merge = merge; + if (t->priv->merge != merge) + { + t->priv->merge = merge; - egg_editable_toolbar_construct (t); + if (t->priv->model != NULL) + { + egg_editable_toolbar_construct (t); + } + } } static void diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c index 85ed145ab..fc74aa174 100755 --- a/lib/egg/egg-toolbars-model.c +++ b/lib/egg/egg-toolbars-model.c @@ -410,12 +410,20 @@ parse_toolbars (EggToolbarsModel *t, if (xmlStrEqual (child->name, "toolbar")) { xmlChar *name; + xmlChar *style; int position; name = xmlGetProp (child, "name"); position = egg_toolbars_model_add_toolbar (t, -1, name); xmlFree (name); + style = xmlGetProp (child, "style"); + if (style && strcmp (style, "icons-only") == 0) + { + egg_toolbars_model_set_flags (t, EGG_TB_MODEL_ICONS_ONLY, 0); + } + xmlFree (style); + parse_item_list (t, child->children, position); } |