Align the Reconcile totals in the Reconcile Window.

This change aligns the totals with the account column by obtaining the
reconcile column width and adjusting the label padding. This is done at
initial display so it does not track column resizing or the use of the
scrollbar.
This commit is contained in:
Robert Fewell 2018-07-15 16:42:24 +01:00 committed by John Ralls
parent b95981e6af
commit 8c4a5adb43
3 changed files with 26 additions and 0 deletions

View File

@ -233,6 +233,18 @@ gnc_reconcile_view_tooltip_cb (GNCQueryView *qview, gint x, gint y,
}
gint
gnc_reconcile_view_get_column_width (GNCReconcileView *view, gint column)
{
GNCQueryView *qview = GNC_QUERY_VIEW (view);
GtkTreeViewColumn *col;
//allow for pointer model column at column 0
col = gtk_tree_view_get_column (GTK_TREE_VIEW (qview), (column - 1));
return gtk_tree_view_column_get_width (col);
}
void
gnc_reconcile_view_add_padding (GNCReconcileView *view, gint column, gint xpadding)
{

View File

@ -112,6 +112,8 @@ gboolean gnc_reconcile_view_changed (GNCReconcileView *view);
void gnc_reconcile_view_add_padding (GNCReconcileView *view, gint column, gint xpadding);
gint gnc_reconcile_view_get_column_width (GNCReconcileView *view, gint column);
G_END_DECLS
#endif /* GNC_RECONCILE_VIEW_H */

View File

@ -2001,6 +2001,18 @@ recnWindowWithBalance (Account *account, gnc_numeric new_ending,
gtk_widget_grab_focus (recnData->debit);
{ // align the Totals value with that of the amount column
gint recn_widthc = gnc_reconcile_view_get_column_width (GNC_RECONCILE_VIEW(recnData->credit), REC_RECN);
gint recn_widthd = gnc_reconcile_view_get_column_width (GNC_RECONCILE_VIEW(recnData->debit), REC_RECN);
#if GTK_CHECK_VERSION(3,12,0)
gtk_widget_set_margin_end (GTK_WIDGET(recnData->total_credit), 10 + recn_widthc);
gtk_widget_set_margin_end (GTK_WIDGET(recnData->total_debit), 10 + recn_widthd);
#else
gtk_widget_set_margin_right (GTK_WIDGET(recnData->total_credit), 10 + recn_widthc);
gtk_widget_set_margin_right (GTK_WIDGET(recnData->total_debit), 10 + recn_widthd);
#endif
}
return recnData;
}