[goffice] Fix item placement in linear & polynomial regression trend line dialog. [#678793]



commit 6064129d180e302d3d3670b95ba7b8ae9bc871fd
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Mon Jun 25 12:17:36 2012 -0600

    Fix item placement in linear & polynomial regression trend line dialog. [#678793]
    
    2012-25-19 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* plugins/reg_linear/gog-lin-reg.c (gog_lin_reg_curve_populate_editor):
    	fix item placement for pre-gtk-3.4.0
    	* plugins/reg_linear/gog-polynom-reg.c
    	(gog_polynom_reg_curve_populate_editor): ditto

 ChangeLog                            |    7 +++++++
 NEWS                                 |    2 ++
 plugins/reg_linear/gog-lin-reg.c     |   18 +++++++++++++++---
 plugins/reg_linear/gog-polynom-reg.c |    6 +++++-
 4 files changed, 29 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 70456e6..5ac562b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-25-19 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* plugins/reg_linear/gog-lin-reg.c (gog_lin_reg_curve_populate_editor):
+	fix item placement for pre-gtk-3.4.0
+	* plugins/reg_linear/gog-polynom-reg.c
+	(gog_polynom_reg_curve_populate_editor): ditto
+
 2012-05-24  Jean Brefort  <jean brefort normalesup org>
 
 	* goffice/graph/gog-reg-curve.c (gog_reg_curve_populate_editor): fix
diff --git a/NEWS b/NEWS
index 5fced83..7b5dedf 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ Andreas:
 	* Add go_pango_attrs_to_markup, partial inverse to pango_parse_markup.
 	* Handle underline tags as named tags in textbuffer.
 	* Add go_color_from_gdk_rgba
+	* Fix item placement in linear & polynomial regression trend line
+	dialog. [#678793]
 
 Jean:
 	* Fixed logfit equation typo. [#675560]
diff --git a/plugins/reg_linear/gog-lin-reg.c b/plugins/reg_linear/gog-lin-reg.c
index b8c53b0..14eb811 100644
--- a/plugins/reg_linear/gog-lin-reg.c
+++ b/plugins/reg_linear/gog-lin-reg.c
@@ -1,3 +1,5 @@
+/* vm: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
 /*
  * gog-lin-reg.c :
  *
@@ -156,11 +158,21 @@ gog_lin_reg_curve_populate_editor (GogRegCurve *reg_curve, gpointer table)
 	w = gtk_check_button_new_with_label (_("Affine"));
 	gtk_widget_set_tooltip_text (w, _("Uncheck to force zero intercept"));
 	gtk_widget_show (w);
-#if GTK_CHECK_VERSION(3,2,0)
+#if GTK_CHECK_VERSION(3,4,0)
 	gtk_grid_attach_next_to (table, w, NULL, GTK_POS_BOTTOM, 1, 3);
 #else
-	gtk_grid_attach_next_to (table, w, GTK_WIDGET (g_object_get_data (table, "last-label")), GTK_POS_BOTTOM, 1, 3);
-	g_object_set_data (G_OBJECT (table), "last-label", w);
+	{
+		GtkWidget *sibling = GTK_WIDGET (g_object_get_data (table, "last-label"));
+
+		if (sibling) {
+			gtk_grid_insert_next_to (table, sibling, GTK_POS_BOTTOM);
+			gtk_grid_attach_next_to (table, w, sibling, GTK_POS_BOTTOM, 1, 3);
+		} else {
+			gtk_grid_insert_row (table, 1);
+			gtk_grid_attach (table, w, 0, 1, 3, 1); 
+		}
+		g_object_set_data (G_OBJECT (table), "last-label", w);
+	}
 #endif
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), lin->affine);
 	g_signal_connect (G_OBJECT (w), "toggled", G_CALLBACK (affine_toggled_cb), lin);
diff --git a/plugins/reg_linear/gog-polynom-reg.c b/plugins/reg_linear/gog-polynom-reg.c
index 896f67e..adae422 100644
--- a/plugins/reg_linear/gog-polynom-reg.c
+++ b/plugins/reg_linear/gog-polynom-reg.c
@@ -1,3 +1,5 @@
+/* vm: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
 /*
  * gog-polynom-reg.c :
  *
@@ -201,10 +203,12 @@ gog_polynom_reg_curve_populate_editor (GogRegCurve *reg_curve, gpointer table)
 	gtk_misc_set_alignment (GTK_MISC (l), 0., 0.5);
 	gtk_label_set_justify (GTK_LABEL (l), GTK_JUSTIFY_LEFT);
 	gtk_widget_show (l);
-#if GTK_CHECK_VERSION(3,2,0)
+#if GTK_CHECK_VERSION(3,4,0)
 	gtk_grid_attach_next_to (table, l, NULL, GTK_POS_BOTTOM, 1, 1);
 #else
+	gtk_grid_insert_next_to (table, GTK_WIDGET (g_object_get_data (table, "last-label")), GTK_POS_BOTTOM);
 	gtk_grid_attach_next_to (table, l, GTK_WIDGET (g_object_get_data (table, "last-label")), GTK_POS_BOTTOM, 1, 1);
+	g_object_set_data (G_OBJECT (table), "last-label", l);
 #endif
 	w = gtk_spin_button_new_with_range (2, 10, 1);
 	gtk_spin_button_set_digits (GTK_SPIN_BUTTON (w), 0);



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