From 202a7e40d82167151a89e6f08169e4aa2555baa9 Mon Sep 17 00:00:00 2001
From: Robert Fewell <14uBobIT@gmail.com>
Date: Fri, 29 Nov 2019 16:33:55 +0000
Subject: [PATCH] Remove label column for gnc_date_format_new_without_label
Currently the label is destroyed if not required but the grid column is
still present and as such uses the grid column spacing setting which
causes the date format to be offset, this can be seen in the print
cheque dialogue so instead remove the first column which has the label.
---
gnucash/gnome-utils/gnc-date-format.c | 17 +++++++++--------
gnucash/gtkbuilder/gnc-date-format.glade | 18 ++++++------------
2 files changed, 15 insertions(+), 20 deletions(-)
diff --git a/gnucash/gnome-utils/gnc-date-format.c b/gnucash/gnome-utils/gnc-date-format.c
index b678e5a370..6e4473bd17 100644
--- a/gnucash/gnome-utils/gnc-date-format.c
+++ b/gnucash/gnome-utils/gnc-date-format.c
@@ -60,6 +60,7 @@ struct _GNCDateFormatPrivate
GtkWidget* format_combobox;
GtkWidget* label;
+ GtkWidget* table;
GtkWidget* months_label;
GtkWidget* months_number;
@@ -118,7 +119,7 @@ gnc_date_format_init (GNCDateFormat *gdf)
{
GNCDateFormatPrivate *priv;
GtkBuilder *builder;
- GtkWidget *dialog, *table;
+ GtkWidget *dialog;
g_return_if_fail(gdf);
g_return_if_fail(GNC_IS_DATE_FORMAT(gdf));
@@ -159,11 +160,11 @@ gnc_date_format_init (GNCDateFormat *gdf)
/* pull in the dialog and table widgets and play the reconnect game */
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "gnc_date_format_window"));
- table = GTK_WIDGET(gtk_builder_get_object (builder, "date_format_table"));
- g_object_ref(G_OBJECT(table));
- gtk_container_remove(GTK_CONTAINER(dialog), table);
- gtk_container_add(GTK_CONTAINER(gdf), table);
- g_object_unref(G_OBJECT(table));
+ priv->table = GTK_WIDGET(gtk_builder_get_object (builder, "date_format_table"));
+ g_object_ref (G_OBJECT(priv->table));
+ gtk_container_remove (GTK_CONTAINER(dialog), priv->table);
+ gtk_container_add (GTK_CONTAINER(gdf), priv->table);
+ g_object_unref (G_OBJECT(priv->table));
g_object_unref(G_OBJECT(builder));
@@ -205,9 +206,9 @@ gnc_date_format_new_without_label (void)
GNCDateFormat *gdf = GNC_DATE_FORMAT(widget);
GNCDateFormatPrivate *priv = GNC_DATE_FORMAT_GET_PRIVATE(gdf);
- gtk_widget_destroy(priv->label);
+ // remove the first column which has the label
+ gtk_grid_remove_column (GTK_GRID(priv->table), 0);
priv->label = NULL;
-
return widget;
}
diff --git a/gnucash/gtkbuilder/gnc-date-format.glade b/gnucash/gtkbuilder/gnc-date-format.glade
index 96bc2dcaca..70ab5abbd8 100644
--- a/gnucash/gtkbuilder/gnc-date-format.glade
+++ b/gnucash/gtkbuilder/gnc-date-format.glade
@@ -45,16 +45,19 @@
1
- 5
+ 4
@@ -263,15 +266,6 @@
-
-
-
-
-
-
-
-
-