mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
b95981e6af
commit
8c4a5adb43
@ -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)
|
||||
{
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user