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 /src/toolbar.c | |
parent | 3d4cc4657225dcd214857e2c6d9798d881d00623 (diff) | |
download | gsoc2013-epiphany-e886e958845ad243debf35139ffa81be9aad3088.tar.gz 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 'src/toolbar.c')
-rwxr-xr-x | src/toolbar.c | 77 |
1 files changed, 61 insertions, 16 deletions
diff --git a/src/toolbar.c b/src/toolbar.c index dc905c427..326a47f71 100755 --- a/src/toolbar.c +++ b/src/toolbar.c @@ -144,7 +144,7 @@ bookmark_destroy_cb (EphyNode *node, long id; model = EPHY_TOOLBARS_MODEL - (ephy_shell_get_toolbars_model (ephy_shell)); + (ephy_shell_get_toolbars_model (ephy_shell, FALSE)); id = ephy_node_get_id (node); name = ephy_toolbars_model_get_action_name (model, id); @@ -167,7 +167,7 @@ toolbar_ensure_action (Toolbar *t, EphyNode *bmks, *topics; model = EPHY_TOOLBARS_MODEL - (ephy_shell_get_toolbars_model (ephy_shell)); + (ephy_shell_get_toolbars_model (ephy_shell, FALSE)); bookmarks = ephy_shell_get_bookmarks (ephy_shell); bmks = ephy_bookmarks_get_bookmarks (bookmarks); topics = ephy_bookmarks_get_keywords (bookmarks); @@ -373,7 +373,7 @@ init_bookmarks_toolbar (Toolbar *t) int i, n_toolbars; model = EPHY_TOOLBARS_MODEL - (ephy_shell_get_toolbars_model (ephy_shell)); + (ephy_shell_get_toolbars_model (ephy_shell, FALSE)); n_toolbars = egg_toolbars_model_n_toolbars (EGG_TOOLBARS_MODEL (model)); @@ -461,10 +461,61 @@ location_user_changed_cb (GtkWidget *entry, Toolbar *t) } static void -toolbar_set_window (Toolbar *t, EphyWindow *window) +init_normal_mode (Toolbar *t) { EphyToolbarsModel *model; + model = EPHY_TOOLBARS_MODEL + (ephy_shell_get_toolbars_model (ephy_shell, FALSE)); + g_signal_connect (EGG_TOOLBARS_MODEL (model), "toolbar_added", + G_CALLBACK (update_toolbar_remove_flag), + NULL); + g_signal_connect (EGG_TOOLBARS_MODEL (model), "toolbar_removed", + G_CALLBACK (update_toolbar_remove_flag), + NULL); + g_object_set (G_OBJECT (t), + "ToolbarsModel", model, + NULL); + init_bookmarks_toolbar (t); +} + +static void +init_fullscreen_mode (Toolbar *t) +{ + EggToolbarsModel *model; + + model = EGG_TOOLBARS_MODEL + (ephy_shell_get_toolbars_model (ephy_shell, TRUE)); + + g_object_set (G_OBJECT (t), + "ToolbarsModel", model, + NULL); +} + +static gboolean +window_state_event_cb (GtkWidget *widget, GdkEventWindowState *event, Toolbar *t) +{ + if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) + { + gboolean fullscreen; + + fullscreen = event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN; + if (fullscreen) + { + init_fullscreen_mode (t); + } + else + { + init_normal_mode (t); + } + } + + return FALSE; +} + +static void +toolbar_set_window (Toolbar *t, EphyWindow *window) +{ g_return_if_fail (t->priv->window == NULL); t->priv->window = window; @@ -473,24 +524,18 @@ toolbar_set_window (Toolbar *t, EphyWindow *window) toolbar_setup_actions (t); gtk_ui_manager_insert_action_group (t->priv->ui_merge, t->priv->action_group, 1); - g_signal_connect (t, "action_request", G_CALLBACK (action_request_cb), NULL); + g_signal_connect_object (window, "window-state-event", + G_CALLBACK (window_state_event_cb), + t, 0); - model = EPHY_TOOLBARS_MODEL - (ephy_shell_get_toolbars_model (ephy_shell)); - g_signal_connect (EGG_TOOLBARS_MODEL (model), "toolbar_added", - G_CALLBACK (update_toolbar_remove_flag), - NULL); - g_signal_connect (EGG_TOOLBARS_MODEL (model), "toolbar_removed", - G_CALLBACK (update_toolbar_remove_flag), - NULL); g_object_set (G_OBJECT (t), - "ToolbarsModel", model, "MenuMerge", t->priv->ui_merge, NULL); - init_bookmarks_toolbar (t); + + init_normal_mode (t); g_signal_connect_object (get_location_entry (t), "user_changed", G_CALLBACK (location_user_changed_cb), @@ -673,7 +718,7 @@ toolbar_set_visibility (Toolbar *t, int i, n_toolbars; model = EPHY_TOOLBARS_MODEL - (ephy_shell_get_toolbars_model (ephy_shell)); + (ephy_shell_get_toolbars_model (ephy_shell, FALSE)); n_toolbars = egg_toolbars_model_n_toolbars (EGG_TOOLBARS_MODEL (model)); |