aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2004-04-18 18:35:44 +0800
committerChristian Persch <chpe@src.gnome.org>2004-04-18 18:35:44 +0800
commit253cdd5d4d4969687f0c739cc751fa9a96c42600 (patch)
tree752d5711617ce980cefd5532fd996a18e954cc80
parent4d702bd73bf61dd1b8df432da802adcc3785fd0a (diff)
downloadgsoc2013-epiphany-253cdd5d4d4969687f0c739cc751fa9a96c42600.tar
gsoc2013-epiphany-253cdd5d4d4969687f0c739cc751fa9a96c42600.tar.gz
gsoc2013-epiphany-253cdd5d4d4969687f0c739cc751fa9a96c42600.tar.bz2
gsoc2013-epiphany-253cdd5d4d4969687f0c739cc751fa9a96c42600.tar.lz
gsoc2013-epiphany-253cdd5d4d4969687f0c739cc751fa9a96c42600.tar.xz
gsoc2013-epiphany-253cdd5d4d4969687f0c739cc751fa9a96c42600.tar.zst
gsoc2013-epiphany-253cdd5d4d4969687f0c739cc751fa9a96c42600.zip
Fix chrome for new windows opened from _blank target. Fixes bug #139512.
2004-04-18 Marco Pesenti Gritti <marco@gnome.org> * embed/ephy-embed.c: (ephy_embed_chrome_get_type): * embed/ephy-embed.h: * embed/mozilla/mozilla-embed.cpp: * src/ephy-window.c: (ephy_window_set_chrome), (ephy_window_set_property), (ephy_window_class_init): Fix chrome for new windows opened from _blank target. Fixes bug #139512.
-rw-r--r--ChangeLog13
-rw-r--r--embed/ephy-embed.c1
-rw-r--r--embed/ephy-embed.h14
-rw-r--r--embed/mozilla/mozilla-embed.cpp1
-rw-r--r--src/ephy-window.c43
5 files changed, 43 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index 74697ae90..ab8649101 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,19 @@
+2004-04-18 Marco Pesenti Gritti <marco@gnome.org>
+
+ * embed/ephy-embed.c: (ephy_embed_chrome_get_type):
+ * embed/ephy-embed.h:
+ * embed/mozilla/mozilla-embed.cpp:
+ * src/ephy-window.c: (ephy_window_set_chrome),
+ (ephy_window_set_property), (ephy_window_class_init):
+
+ Fix chrome for new windows opened from _blank target.
+ Fixes bug #139512.
+
2004-04-17 Marco Pesenti Gritti <marco@gnome.org>
* embed/mozilla/MozDownload.cpp:
- Do not uncompress when the type is not html.
+ Do not uncompress when the type is not html. Fixes bug #131778.
2004-04-17 Marco Pesenti Gritti <marco@gnome.org>
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index 9f1686840..c38d8b5ce 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -39,7 +39,6 @@ ephy_embed_chrome_get_type (void)
{
static const GFlagsValue values[] =
{
- { EPHY_EMBED_CHROME_DEFAULT, "EPHY_EMBED_CHROME_DEFAULT", "default" },
{ EPHY_EMBED_CHROME_MENUBAR, "EPHY_EMBED_CHROME_MENUBAR", "menubar" },
{ EPHY_EMBED_CHROME_TOOLBAR, "EPHY_EMBED_CHROME_TOOLBAR", "toolbar" },
{ EPHY_EMBED_CHROME_STATUSBAR, "EPHY_EMBED_CHROME_STATUSBAR", "statusbar" },
diff --git a/embed/ephy-embed.h b/embed/ephy-embed.h
index c2fcb2e91..809a21a56 100644
--- a/embed/ephy-embed.h
+++ b/embed/ephy-embed.h
@@ -59,13 +59,17 @@ typedef enum
typedef enum
{
- EPHY_EMBED_CHROME_DEFAULT = 1 << 0,
- EPHY_EMBED_CHROME_MENUBAR = 1 << 1,
- EPHY_EMBED_CHROME_TOOLBAR = 1 << 2,
- EPHY_EMBED_CHROME_STATUSBAR = 1 << 3,
- EPHY_EMBED_CHROME_BOOKMARKSBAR = 1 << 4
+ EPHY_EMBED_CHROME_MENUBAR = 1 << 0,
+ EPHY_EMBED_CHROME_TOOLBAR = 1 << 1,
+ EPHY_EMBED_CHROME_STATUSBAR = 1 << 2,
+ EPHY_EMBED_CHROME_BOOKMARKSBAR = 1 << 3
} EphyEmbedChrome;
+#define EPHY_EMBED_CHROME_ALL (EPHY_EMBED_CHROME_MENUBAR | \
+ EPHY_EMBED_CHROME_TOOLBAR | \
+ EPHY_EMBED_CHROME_STATUSBAR | \
+ EPHY_EMBED_CHROME_BOOKMARKSBAR)
+
typedef enum
{
EMBED_RELOAD_NORMAL = 1 << 0,
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index 8f0fe578b..3ab68b9ab 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -997,7 +997,6 @@ mozilla_embed_new_window_cb (GtkMozEmbed *embed,
}
conversion_map [] =
{
- { GTK_MOZ_EMBED_FLAG_DEFAULTCHROME, EPHY_EMBED_CHROME_DEFAULT },
{ GTK_MOZ_EMBED_FLAG_MENUBARON, EPHY_EMBED_CHROME_MENUBAR },
{ GTK_MOZ_EMBED_FLAG_TOOLBARON, EPHY_EMBED_CHROME_TOOLBAR },
{ GTK_MOZ_EMBED_FLAG_STATUSBARON, EPHY_EMBED_CHROME_STATUSBAR },
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 9a785e974..87a293a5c 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1724,32 +1724,40 @@ setup_notebook (EphyWindow *window)
return notebook;
}
-static EphyEmbedChrome
-get_default_chrome (void)
+static void
+ephy_window_set_chrome (EphyWindow *window, EphyEmbedChrome mask)
{
- EphyEmbedChrome chrome_mask = 0;
+ EphyEmbedChrome chrome_mask = mask;
+
+ if (mask == EPHY_EMBED_CHROME_ALL)
+ {
+ window->priv->should_save_chrome = TRUE;
+ }
- if (eel_gconf_get_boolean (CONF_WINDOWS_SHOW_TOOLBARS))
+ if (!eel_gconf_get_boolean (CONF_WINDOWS_SHOW_TOOLBARS))
{
- chrome_mask |= EPHY_EMBED_CHROME_TOOLBAR;
+ chrome_mask &= ~EPHY_EMBED_CHROME_TOOLBAR;
}
- if (eel_gconf_get_boolean (CONF_WINDOWS_SHOW_STATUSBAR))
+ if (!eel_gconf_get_boolean (CONF_WINDOWS_SHOW_STATUSBAR))
{
- chrome_mask |= EPHY_EMBED_CHROME_STATUSBAR;
+ chrome_mask &= ~EPHY_EMBED_CHROME_STATUSBAR;
}
- if (!eel_gconf_get_boolean (CONF_LOCKDOWN_HIDE_MENUBAR))
+ if (!eel_gconf_get_boolean (CONF_WINDOWS_SHOW_BOOKMARKS_BAR))
{
- chrome_mask |= EPHY_EMBED_CHROME_MENUBAR;
+ chrome_mask &= ~EPHY_EMBED_CHROME_BOOKMARKSBAR;
}
- if (eel_gconf_get_boolean (CONF_WINDOWS_SHOW_BOOKMARKS_BAR))
+ if (eel_gconf_get_boolean (CONF_LOCKDOWN_HIDE_MENUBAR))
{
- chrome_mask |= EPHY_EMBED_CHROME_BOOKMARKSBAR;
+ chrome_mask &= ~EPHY_EMBED_CHROME_MENUBAR;
}
- return chrome_mask;
+ window->priv->chrome = chrome_mask;
+
+ sync_chromes_visibility (window);
+ update_chromes_actions (window);
}
static void
@@ -1766,14 +1774,7 @@ ephy_window_set_property (GObject *object,
ephy_window_set_active_tab (window, g_value_get_object (value));
break;
case PROP_CHROME:
- window->priv->chrome = g_value_get_flags (value);
- if (window->priv->chrome == EPHY_EMBED_CHROME_DEFAULT)
- {
- window->priv->chrome = get_default_chrome ();
- window->priv->should_save_chrome = TRUE;
- }
- sync_chromes_visibility (window);
- update_chromes_actions (window);
+ ephy_window_set_chrome (window, g_value_get_flags (value));
break;
}
}
@@ -1825,7 +1826,7 @@ ephy_window_class_init (EphyWindowClass *klass)
"chrome",
"Window chrome",
EPHY_TYPE_EMBED_CHROME_MASK,
- EPHY_EMBED_CHROME_DEFAULT,
+ EPHY_EMBED_CHROME_ALL,
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_READWRITE));