diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-10-06 01:40:59 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-10-06 01:40:59 +0800 |
commit | f0fea37fe86cc429e9c1f1c3aa5ada69d6a54b58 (patch) | |
tree | 5f5866841adabee52a013539a67154fdef1709a9 /src | |
parent | 99b962d53d73d599f27730078bb58e96db26e68e (diff) | |
download | gsoc2013-epiphany-f0fea37fe86cc429e9c1f1c3aa5ada69d6a54b58.tar gsoc2013-epiphany-f0fea37fe86cc429e9c1f1c3aa5ada69d6a54b58.tar.gz gsoc2013-epiphany-f0fea37fe86cc429e9c1f1c3aa5ada69d6a54b58.tar.bz2 gsoc2013-epiphany-f0fea37fe86cc429e9c1f1c3aa5ada69d6a54b58.tar.lz gsoc2013-epiphany-f0fea37fe86cc429e9c1f1c3aa5ada69d6a54b58.tar.xz gsoc2013-epiphany-f0fea37fe86cc429e9c1f1c3aa5ada69d6a54b58.tar.zst gsoc2013-epiphany-f0fea37fe86cc429e9c1f1c3aa5ada69d6a54b58.zip |
Fix print preview and fullscreen mode interaction. Fixes bug #154456.
2004-10-05 Christian Persch <chpe@cvs.gnome.org>
* src/ephy-window.c: (get_chromes_visibility),
(ephy_window_fullscreen), (ephy_window_unfullscreen),
(ephy_window_delete_event_cb), (show_embed_popup),
(ephy_window_init), (ephy_window_set_print_preview):
Fix print preview and fullscreen mode interaction. Fixes bug #154456.
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-window.c | 65 |
1 files changed, 28 insertions, 37 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c index 74c33ef1f..93abb01ec 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -321,16 +321,8 @@ static guint ephy_popups_n_entries = G_N_ELEMENTS (ephy_popups_entries); #define EPHY_WINDOW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_WINDOW, EphyWindowPrivate)) -typedef enum -{ - EPHY_WINDOW_MODE_NORMAL, - EPHY_WINDOW_MODE_FULLSCREEN, - EPHY_WINDOW_MODE_PRINT_PREVIEW -} EphyWindowMode; - struct EphyWindowPrivate { - EphyWindowMode mode; GtkWidget *main_vbox; GtkWidget *menu_dock; GtkWidget *exit_fullscreen_popup; @@ -347,14 +339,10 @@ struct EphyWindowPrivate GtkNotebook *notebook; EphyTab *active_tab; EphyDialog *find_dialog; - gboolean closing; - gboolean has_size; guint num_tabs; guint tab_message_cid; guint help_message_cid; - EphyEmbedChrome chrome; - gboolean should_save_chrome; guint disable_arbitrary_url_notifier_id; guint disable_bookmark_editing_notifier_id; @@ -366,6 +354,12 @@ struct EphyWindowPrivate guint disable_command_line_notifier_id; guint browse_with_caret_notifier_id; guint allow_popups_notifier_id; + + gboolean closing : 1; + gboolean has_size : 1; + gboolean fullscreen_mode : 1; + gboolean ppv_mode : 1; + gboolean should_save_chrome : 1; }; enum @@ -506,21 +500,21 @@ get_chromes_visibility (EphyWindow *window, gboolean *show_menubar, { EphyEmbedChrome flags = window->priv->chrome; - switch (window->priv->mode) + if (window->priv->ppv_mode) { - case EPHY_WINDOW_MODE_NORMAL: - *show_menubar = (flags & EPHY_EMBED_CHROME_MENUBAR) != 0; - *show_statusbar = (flags & EPHY_EMBED_CHROME_STATUSBAR) != 0; - *show_toolbar = (flags & EPHY_EMBED_CHROME_TOOLBAR) != 0; - *show_bookmarksbar = (flags & EPHY_EMBED_CHROME_BOOKMARKSBAR) != 0; - break; - case EPHY_WINDOW_MODE_FULLSCREEN: - *show_toolbar = (flags & EPHY_EMBED_CHROME_TOOLBAR) != 0; - *show_menubar = *show_statusbar = *show_bookmarksbar = FALSE; - break; - default: - *show_menubar = *show_statusbar = *show_toolbar = *show_bookmarksbar = FALSE; - break; + *show_menubar = *show_statusbar = *show_toolbar = *show_bookmarksbar = FALSE; + } + else if (window->priv->fullscreen_mode) + { + *show_toolbar = (flags & EPHY_EMBED_CHROME_TOOLBAR) != 0; + *show_menubar = *show_statusbar = *show_bookmarksbar = FALSE; + } + else + { + *show_menubar = (flags & EPHY_EMBED_CHROME_MENUBAR) != 0; + *show_statusbar = (flags & EPHY_EMBED_CHROME_STATUSBAR) != 0; + *show_toolbar = (flags & EPHY_EMBED_CHROME_TOOLBAR) != 0; + *show_bookmarksbar = (flags & EPHY_EMBED_CHROME_BOOKMARKSBAR) != 0; } } @@ -549,7 +543,7 @@ ephy_window_fullscreen (EphyWindow *window) { GtkWidget *popup, *button, *icon, *label, *hbox; - window->priv->mode = EPHY_WINDOW_MODE_FULLSCREEN; + window->priv->fullscreen_mode = TRUE; sync_chromes_visibility (window); @@ -600,7 +594,7 @@ ephy_window_fullscreen (EphyWindow *window) static void ephy_window_unfullscreen (EphyWindow *window) { - window->priv->mode = EPHY_WINDOW_MODE_NORMAL; + window->priv->fullscreen_mode = FALSE; destroy_exit_fullscreen_popup (window); @@ -757,7 +751,7 @@ ephy_window_delete_event_cb (GtkWidget *widget, GdkEvent *event, EphyWindow *win /* Workaround a crash when closing a window while in print preview mode. See * mozilla bug #241809 */ - if (window->priv->mode == EPHY_WINDOW_MODE_PRINT_PREVIEW) + if (window->priv->ppv_mode) { EphyEmbed *embed; @@ -1560,7 +1554,7 @@ show_embed_popup (EphyWindow *window, EphyTab *tab, EphyEmbedEvent *event) EphyEmbedEventType type; /* Do not show the menu in print preview mode */ - if (window->priv->mode == EPHY_WINDOW_MODE_PRINT_PREVIEW) + if (window->priv->ppv_mode) { return; } @@ -2164,7 +2158,8 @@ ephy_window_init (EphyWindow *window) window->priv->has_size = FALSE; window->priv->chrome = EPHY_EMBED_CHROME_ALL; window->priv->should_save_chrome = FALSE; - window->priv->mode = EPHY_WINDOW_MODE_NORMAL; + window->priv->fullscreen_mode = FALSE; + window->priv->ppv_mode = FALSE; ensure_default_icon (); @@ -2389,16 +2384,12 @@ void ephy_window_set_print_preview (EphyWindow *window, gboolean enabled) { GtkAccelGroup *accel_group; - EphyWindowMode mode; accel_group = gtk_ui_manager_get_accel_group (GTK_UI_MANAGER (window->ui_merge)); - mode = enabled ? EPHY_WINDOW_MODE_PRINT_PREVIEW : - EPHY_WINDOW_MODE_NORMAL; - - if (mode == window->priv->mode) return; + if (window->priv->ppv_mode == enabled) return; - window->priv->mode = mode; + window->priv->ppv_mode = enabled; sync_chromes_visibility (window); ephy_notebook_set_show_tabs (EPHY_NOTEBOOK (window->priv->notebook), !enabled); |