[dialog-employee] toggle sensitivity instead of visibility of GncAccountSel

This commit is contained in:
Christopher Lam 2023-02-19 13:37:49 +08:00
parent f170d1d54c
commit 03871c55cf

View File

@ -26,6 +26,8 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <stdbool.h>
#include "dialog-utils.h" #include "dialog-utils.h"
#include "gnc-amount-edit.h" #include "gnc-amount-edit.h"
#include "gnc-currency-edit.h" #include "gnc-currency-edit.h"
@ -311,16 +313,8 @@ gnc_employee_ccard_acct_toggled_cb (GtkToggleButton *button, gpointer data)
if (!ew) if (!ew)
return; return;
if (gtk_toggle_button_get_active (button)) bool active = gtk_toggle_button_get_active (button);
{ gtk_widget_set_sensitive (ew->ccard_acct_sel, active);
gtk_widget_set_sensitive (ew->ccard_acct_sel, TRUE);
gtk_widget_show (ew->ccard_acct_sel);
}
else
{
gtk_widget_set_sensitive (ew->ccard_acct_sel, TRUE);
gtk_widget_hide (ew->ccard_acct_sel);
}
} }
static void static void
@ -568,9 +562,6 @@ gnc_employee_new_window (GtkWindow *parent,
gtk_widget_show_all (ew->dialog); gtk_widget_show_all (ew->dialog);
if (ccard_acct == NULL)
gtk_widget_hide (ew->ccard_acct_sel);
g_object_unref(G_OBJECT(builder)); g_object_unref(G_OBJECT(builder));
return ew; return ew;