Enable setting the hexpand property for GNCAccountSel

Add a function to allow setting of the hexpand property of widget
GNCAccountSel and the combobox it is comprised off along with using
the function in various source files to set the hexpand property.
This commit is contained in:
Robert Fewell 2019-11-29 16:36:15 +00:00
parent fbb2ffb728
commit 6989864723
8 changed files with 17 additions and 2 deletions

View File

@ -351,6 +351,7 @@ void gnc_ui_close_book (QofBook* book, GtkWindow *parent)
equity_list = g_list_prepend(equity_list, GINT_TO_POINTER(ACCT_TYPE_EQUITY));
box = GTK_WIDGET(gtk_builder_get_object (builder, "income_acct_box"));
cbw->income_acct_widget = gnc_account_sel_new();
gnc_account_sel_set_hexpand (GNC_ACCOUNT_SEL(cbw->income_acct_widget), TRUE);
gnc_account_sel_set_acct_filters(GNC_ACCOUNT_SEL(cbw->income_acct_widget),
equity_list, NULL);
gnc_account_sel_set_new_account_ability(GNC_ACCOUNT_SEL(cbw->income_acct_widget), TRUE);
@ -359,6 +360,7 @@ void gnc_ui_close_book (QofBook* book, GtkWindow *parent)
/* expense acct */
box = GTK_WIDGET(gtk_builder_get_object (builder, "expense_acct_box"));
cbw->expense_acct_widget = gnc_account_sel_new();
gnc_account_sel_set_hexpand (GNC_ACCOUNT_SEL(cbw->expense_acct_widget), TRUE);
gnc_account_sel_set_acct_filters(GNC_ACCOUNT_SEL(cbw->expense_acct_widget),
equity_list, NULL);
gnc_account_sel_set_new_account_ability(GNC_ACCOUNT_SEL(cbw->expense_acct_widget), TRUE);

View File

@ -179,6 +179,13 @@ gnc_account_sel_init (GNCAccountSel *gas)
gas->initDone = TRUE;
}
void
gnc_account_sel_set_hexpand ( GNCAccountSel *gas, gboolean expand )
{
gtk_widget_set_hexpand( GTK_WIDGET(gas), expand );
gtk_widget_set_hexpand( GTK_WIDGET(gas->combo), expand );
}
typedef struct
{
GNCAccountSel *gas;

View File

@ -105,5 +105,6 @@ void gnc_account_sel_set_new_account_modal( GNCAccountSel *gas,
gint gnc_account_sel_get_num_account( GNCAccountSel *gas );
void gnc_account_sel_purge_account( GNCAccountSel *gas, Account *acc, gboolean recursive);
void gnc_account_sel_set_hexpand ( GNCAccountSel *gas, gboolean expand);
#endif /* GNC_ACCOUNT_SEL_H */

View File

@ -636,7 +636,7 @@ gnc_loan_assistant_create( LoanAssistantData *ldd )
gas_data[i].height);
gtk_widget_set_halign (GTK_WIDGET(gas), GTK_ALIGN_FILL);
gtk_widget_set_hexpand (GTK_WIDGET(gas), FALSE);
gnc_account_sel_set_hexpand (GNC_ACCOUNT_SEL(gas), true);
g_object_set (GTK_WIDGET(gas), "margin", 2, NULL);
*(gas_data[i].loc) = gas;
}
@ -729,6 +729,7 @@ gnc_loan_assistant_create( LoanAssistantData *ldd )
G_CALLBACK(loan_opt_escrow_toggle_cb), ldd );
gtk_widget_set_sensitive( GTK_WIDGET(ldd->optEscrowHBox), FALSE );
ldd->optEscrowGAS = GNC_ACCOUNT_SEL(gnc_account_sel_new());
gnc_account_sel_set_hexpand (GNC_ACCOUNT_SEL(ldd->optEscrowGAS), true);
gnc_account_sel_set_new_account_ability( ldd->optEscrowGAS, TRUE );
gtk_container_add( GTK_CONTAINER(ldd->optEscrowHBox),
GTK_WIDGET(ldd->optEscrowGAS) );

View File

@ -239,6 +239,7 @@ gnc_dialog_dates_acct_question_parented (GtkWidget *parent, const char *message,
acct_box = GTK_WIDGET(gtk_builder_get_object (builder, "acct_hbox"));
ddc->acct_combo = gnc_account_sel_new();
gnc_account_sel_set_hexpand (GNC_ACCOUNT_SEL(ddc->acct_combo), TRUE);
gtk_box_pack_start (GTK_BOX(acct_box), ddc->acct_combo, TRUE, TRUE, 0);
date_box = GTK_WIDGET(gtk_builder_get_object (builder, "date_hbox"));
@ -359,6 +360,7 @@ gnc_dialog_date_acct_parented (GtkWidget *parent, const char *message,
ddc->acct_combo = gnc_account_sel_new();
if (*acct)
gnc_account_sel_set_account (GNC_ACCOUNT_SEL(ddc->acct_combo), *acct, FALSE);
gnc_account_sel_set_hexpand (GNC_ACCOUNT_SEL(ddc->acct_combo), TRUE);
gtk_box_pack_start (GTK_BOX(acct_box), ddc->acct_combo, TRUE, TRUE, 0);
date_box = GTK_WIDGET(gtk_builder_get_object (builder, "date_hbox"));

View File

@ -476,6 +476,7 @@ gnc_employee_new_window (GtkWindow *parent,
edit = gnc_account_sel_new();
acct_types = g_list_prepend(NULL, (gpointer)ACCT_TYPE_CREDIT);
gnc_account_sel_set_acct_filters (GNC_ACCOUNT_SEL(edit), acct_types, NULL);
gnc_account_sel_set_hexpand (GNC_ACCOUNT_SEL(edit), TRUE);
g_list_free (acct_types);
ew->ccard_acct_sel = edit;

View File

@ -1327,6 +1327,7 @@ gppat_setup_account_selector (GtkBuilder *builder, GtkWidget *dialog,
GtkWidget *box = GTK_WIDGET(gtk_builder_get_object (builder, hbox));
gtk_box_pack_start (GTK_BOX(box), selector, TRUE, TRUE, 0);
gnc_account_sel_set_hexpand (GNC_ACCOUNT_SEL(selector), TRUE);
g_object_set_data(G_OBJECT(dialog), sel_name, selector);
gppat_populate_gas_list(dialog, GNC_ACCOUNT_SEL(selector), TRUE);

View File

@ -563,7 +563,7 @@ CsvImpTransAssist::CsvImpTransAssist ()
acct_selector = gnc_account_sel_new();
auto account_hbox = GTK_WIDGET(gtk_builder_get_object (builder, "account_hbox"));
gtk_box_pack_start (GTK_BOX(account_hbox), acct_selector, TRUE, TRUE, 6);
gtk_widget_set_hexpand (GTK_WIDGET(acct_selector), true);
gnc_account_sel_set_hexpand (GNC_ACCOUNT_SEL(acct_selector), true);
gtk_widget_show (acct_selector);
g_signal_connect(G_OBJECT(acct_selector), "account_sel_changed",