[epiphany/overview: 8/30] Add a boolean overview-mode property to EphyWindow
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/overview: 8/30] Add a boolean overview-mode property to EphyWindow
- Date: Wed, 13 Jun 2012 08:21:42 +0000 (UTC)
commit 736b3775d8d8515a398558e19bf0be0cebcccf6c
Author: Claudio Saavedra <csaavedra igalia com>
Date: Wed Jan 25 16:28:24 2012 +0200
Add a boolean overview-mode property to EphyWindow
With this, add the EphyOverview widget to the main_vbox, so that
it's visible instead of the notebook when the property is TRUE.
https://bugzilla.gnome.org/show_bug.cgi?id=455173
src/ephy-window.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
src/ephy-window.h | 4 +++
2 files changed, 63 insertions(+), 1 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 3f56666..dd2551c 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -46,6 +46,7 @@
#include "ephy-location-entry.h"
#include "ephy-navigation-history-action.h"
#include "ephy-notebook.h"
+#include "ephy-overview.h"
#include "ephy-page-menu-action.h"
#include "ephy-prefs.h"
#include "ephy-private.h"
@@ -344,6 +345,7 @@ struct _EphyWindowPrivate
EphyEmbedEvent *context_event;
guint idle_worker;
GtkWidget *downloads_box;
+ GtkWidget *overview;
EphyLocationController *location_controller;
@@ -357,6 +359,7 @@ struct _EphyWindowPrivate
guint key_theme_is_emacs : 1;
guint updating_address : 1;
guint show_lock : 1;
+ guint overview_mode : 1;
};
enum
@@ -364,7 +367,8 @@ enum
PROP_0,
PROP_ACTIVE_CHILD,
PROP_CHROME,
- PROP_SINGLE_TAB_MODE
+ PROP_SINGLE_TAB_MODE,
+ PROP_OVERVIEW_MODE
};
/* Make sure not to overlap with those in ephy-lockdown.c */
@@ -2978,6 +2982,9 @@ ephy_window_set_property (GObject *object,
case PROP_SINGLE_TAB_MODE:
ephy_window_set_is_popup (window, g_value_get_boolean (value));
break;
+ case PROP_OVERVIEW_MODE:
+ ephy_window_set_overview_mode (window, g_value_get_boolean (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -3003,6 +3010,9 @@ ephy_window_get_property (GObject *object,
case PROP_SINGLE_TAB_MODE:
g_value_set_boolean (value, window->priv->is_popup);
break;
+ case PROP_OVERVIEW_MODE:
+ g_value_set_boolean (value, ephy_window_get_overview_mode (EPHY_WINDOW (object)));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -3326,6 +3336,11 @@ ephy_window_constructor (GType type,
gtk_box_pack_start (GTK_BOX (priv->main_vbox),
GTK_WIDGET (priv->find_toolbar), FALSE, FALSE, 0);
+ priv->overview = ephy_overview_new (EPHY_WINDOW (window));
+ gtk_box_pack_start (GTK_BOX (priv->main_vbox),
+ priv->overview, TRUE, TRUE, 0);
+ gtk_widget_hide (GTK_WIDGET (priv->overview));
+
priv->downloads_box = setup_downloads_box (window);
gtk_box_pack_start (GTK_BOX (priv->main_vbox),
GTK_WIDGET (priv->downloads_box), FALSE, FALSE, 0);
@@ -3431,6 +3446,8 @@ ephy_window_constructor (GType type,
sync_chromes_visibility (window);
+ ephy_window_set_overview_mode (window, FALSE);
+
return object;
}
@@ -3496,6 +3513,14 @@ ephy_window_class_init (EphyWindowClass *klass)
PROP_CHROME,
"chrome");
+ g_object_class_install_property (object_class,
+ PROP_OVERVIEW_MODE,
+ g_param_spec_boolean ("overview-mode",
+ "Overview mode",
+ "Whether the window is showing the overview",
+ TRUE,
+ G_PARAM_READWRITE));
+
g_type_class_add_private (object_class, sizeof (EphyWindowPrivate));
}
@@ -3825,3 +3850,36 @@ ephy_window_get_location_controller (EphyWindow *window)
return window->priv->location_controller;
}
+
+gboolean
+ephy_window_get_overview_mode (EphyWindow *window)
+{
+ g_return_val_if_fail (EPHY_IS_WINDOW (window), FALSE);
+
+ return window->priv->overview_mode;
+}
+
+void
+ephy_window_set_overview_mode (EphyWindow *window, gboolean overview_mode)
+{
+ EphyWindowPrivate *priv;
+
+ g_return_if_fail (EPHY_IS_WINDOW (window));
+
+ priv = window->priv;
+
+ if (priv->overview_mode == overview_mode)
+ return;
+
+ if (overview_mode) {
+ gtk_widget_show (priv->overview);
+ gtk_widget_hide (GTK_WIDGET (priv->notebook));
+ } else {
+ gtk_widget_hide (priv->overview);
+ gtk_widget_show (GTK_WIDGET (priv->notebook));
+ }
+
+ priv->overview_mode = overview_mode;
+
+ g_object_notify (G_OBJECT (window), "overview-mode");
+}
diff --git a/src/ephy-window.h b/src/ephy-window.h
index 51e9c61..881274f 100644
--- a/src/ephy-window.h
+++ b/src/ephy-window.h
@@ -71,6 +71,10 @@ void ephy_window_load_url (EphyWindow *window,
void ephy_window_set_zoom (EphyWindow *window,
float zoom);
+gboolean ephy_window_get_overview_mode (EphyWindow *window);
+
+void ephy_window_set_overview_mode (EphyWindow *window, gboolean overview_mode);
+
void ephy_window_activate_location (EphyWindow *window);
const char *ephy_window_get_location (EphyWindow *window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]