[gnumeric] GUI: Handle notebook tabs visibility too.



commit 3edc2024f190eb0ac2c0863da7ab11f044b40c15
Author: Morten Welinder <terra gnome org>
Date:   Mon May 18 10:48:18 2009 -0400

    GUI: Handle notebook tabs visibility too.
---
 ChangeLog          |    6 ++++--
 src/wbc-gtk-impl.h |    1 +
 src/wbc-gtk.c      |   19 +++++++++++++++++++
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 122f3f0..2044d5e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,9 @@
 2009-05-18  Morten Welinder  <terra gnome org>
 
-	* src/wbc-gtk.c (wbcg_scrollbar_visibility): New function.
-	(wbcg_view_changed): Hook up wbcg_scrollbar_visibility.
+	* src/wbc-gtk.c (wbcg_scrollbar_visibility,
+	wbcg_notebook_tabs_visibility): New functions.
+	(wbcg_view_changed): Hook up wbcg_scrollbar_visibility and
+	wbcg_notebook_tabs_visibility.
 
 	* src/workbook-view.c 	(workbook_view_class_init, wb_view_set_property,
 	wb_view_get_property): Add new properties:
diff --git a/src/wbc-gtk-impl.h b/src/wbc-gtk-impl.h
index 8722dea..57a89ed 100644
--- a/src/wbc-gtk-impl.h
+++ b/src/wbc-gtk-impl.h
@@ -104,6 +104,7 @@ struct _WBCGtk {
 	gulong sig_view_changed;
 	gulong sig_auto_expr_text;
 	gulong sig_show_horizontal_scrollbar, sig_show_vertical_scrollbar;
+	gulong sig_show_notebook_tabs;
 	gulong sig_sheet_order, sig_notify_uri, sig_notify_dirty;
 	gpointer sig_wbv;
 
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 1394d1f..7492602 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -1417,6 +1417,16 @@ wbcg_scrollbar_visibility (WorkbookView *wbv,
 }
 
 static void
+wbcg_notebook_tabs_visibility (WorkbookView *wbv,
+			       G_GNUC_UNUSED GParamSpec *pspec,
+			       WBCGtk *wbcg)
+{
+	(wbv->show_notebook_tabs ? gtk_widget_show : gtk_widget_hide)
+		(GTK_WIDGET (wbcg->bnotebook));
+}
+
+
+static void
 wbcg_menu_state_update (WorkbookControl *wbc, int flags)
 {
 	WBCGtk *wbcg = (WBCGtk *)wbc;
@@ -2372,6 +2382,7 @@ wbcg_view_changed (WBCGtk *wbcg,
 	DISCONNECT (wbcg->sig_wbv, sig_auto_expr_text);
 	DISCONNECT (wbcg->sig_wbv, sig_show_horizontal_scrollbar);
 	DISCONNECT (wbcg->sig_wbv, sig_show_vertical_scrollbar);
+	DISCONNECT (wbcg->sig_wbv, sig_show_notebook_tabs);
 	if (wbcg->sig_wbv)
 		g_object_remove_weak_pointer (wbcg->sig_wbv,
 					      &wbcg->sig_wbv);
@@ -2402,6 +2413,14 @@ wbcg_view_changed (WBCGtk *wbcg,
 			 G_CALLBACK (wbcg_scrollbar_visibility),
 			 wbcg,
 			 0);
+		wbcg->sig_show_notebook_tabs =
+			g_signal_connect_object
+			(G_OBJECT (wbv),
+			 "notify::show-notebook-tabs",
+			 G_CALLBACK (wbcg_notebook_tabs_visibility),
+			 wbcg,
+			 0);
+		wbcg_notebook_tabs_visibility (wbv, NULL, wbcg);
 	}
 
 	DISCONNECT (old_wb, sig_sheet_order);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]