[gnumeric] Fix the grid when a sheet change size.



commit d06ccc91b796d1a858eda63ff69ad2064aebcd1f
Author: Morten Welinder <terra gnome org>
Date:   Thu Apr 23 19:46:55 2009 -0400

    Fix the grid when a sheet change size.
---
 ChangeLog               |    5 +++++
 src/sheet-control-gui.c |   13 +++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ee38a85..dac0be3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-04-23  Morten Welinder  <terra gnome org>
 
+	* src/sheet-control-gui.c (cb_scg_sheet_resized): New function.
+	(sheet_control_gui_new): Connect cb_scg_sheet_resized to the
+	sheet's "rows" and "columns" properties.
+	(scg_finalize): Disconnect.
+
 	* src/expr-name.c (expr_name_validate): Take sheet argument for
 	checks.  All callers changed.
 
diff --git a/src/sheet-control-gui.c b/src/sheet-control-gui.c
index 04b21b4..8b17fd1 100644
--- a/src/sheet-control-gui.c
+++ b/src/sheet-control-gui.c
@@ -1214,6 +1214,16 @@ cb_scg_redraw_resize (Sheet *sheet,
 }
 
 static void
+cb_scg_sheet_resized (Sheet *sheet,
+		      GParamSpec *pspec,
+		      SheetControlGUI *scg)
+{
+	SheetControl *sc = &scg->sheet_control;
+	sc_set_panes (sc);
+	scg_redraw_all (sc, TRUE);
+}
+
+static void
 cb_scg_direction_changed (SheetControlGUI *scg)
 {
 	scg_resize (scg, TRUE);
@@ -1523,6 +1533,8 @@ sheet_control_gui_new (SheetView *sv, WBCGtk *wbcg)
 		 "signal::notify::display-outlines", cb_scg_redraw_resize, scg,
 		 "signal::notify::display-outlines-below", cb_scg_redraw_resize, scg,
 		 "signal::notify::display-outlines-right", cb_scg_redraw_resize, scg,
+		 "signal::notify::columns", cb_scg_sheet_resized, scg,
+		 "signal::notify::rows", cb_scg_sheet_resized, scg,
 		 NULL);
 
 	scg->label = editable_label_new
@@ -1574,6 +1586,7 @@ scg_finalize (GObject *object)
 		g_signal_handlers_disconnect_by_func (sheet, cb_scg_prefs, scg);
 		g_signal_handlers_disconnect_by_func (sheet, cb_scg_redraw, scg);
 		g_signal_handlers_disconnect_by_func (sheet, cb_scg_redraw_resize, scg);
+		g_signal_handlers_disconnect_by_func (sheet, cb_scg_sheet_resized, scg);
 		g_signal_handlers_disconnect_by_func (sheet, cb_scg_direction_changed, scg);
 		sv_detach_control (sc);
 	}



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