mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Refactor: DEFINE_TYPE GncItemEditTb < GtkToggleButton
This commit is contained in:
@@ -62,11 +62,12 @@ enum
|
||||
|
||||
static QofLogModule log_module = G_LOG_DOMAIN;
|
||||
|
||||
static GtkToggleButtonClass *gnc_item_edit_tb_parent_class;
|
||||
static void gnc_item_edit_destroying (GtkWidget *this, gpointer data);
|
||||
|
||||
G_DEFINE_TYPE (GncItemEdit, gnc_item_edit, GTK_TYPE_BOX)
|
||||
|
||||
G_DEFINE_TYPE (GncItemEditTb, gnc_item_edit_tb, GTK_TYPE_TOGGLE_BUTTON)
|
||||
|
||||
static void
|
||||
gnc_item_edit_tb_init (GncItemEditTb *item_edit_tb)
|
||||
{
|
||||
@@ -153,8 +154,6 @@ gnc_item_edit_tb_class_init (GncItemEditTbClass *gnc_item_edit_tb_class)
|
||||
|
||||
gtk_widget_class_set_css_name (GTK_WIDGET_CLASS(gnc_item_edit_tb_class), "button");
|
||||
|
||||
gnc_item_edit_tb_parent_class = g_type_class_peek_parent (gnc_item_edit_tb_class);
|
||||
|
||||
object_class = G_OBJECT_CLASS(gnc_item_edit_tb_class);
|
||||
widget_class = GTK_WIDGET_CLASS(gnc_item_edit_tb_class);
|
||||
|
||||
@@ -174,34 +173,6 @@ gnc_item_edit_tb_class_init (GncItemEditTbClass *gnc_item_edit_tb_class)
|
||||
widget_class->get_preferred_height = gnc_item_edit_tb_get_preferred_height;
|
||||
}
|
||||
|
||||
GType
|
||||
gnc_item_edit_tb_get_type (void)
|
||||
{
|
||||
static GType gnc_item_edit_tb_type = 0;
|
||||
|
||||
if (!gnc_item_edit_tb_type)
|
||||
{
|
||||
static const GTypeInfo gnc_item_edit_tb_info =
|
||||
{
|
||||
sizeof (GncItemEditTbClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc)gnc_item_edit_tb_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GncItemEditTb),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc)gnc_item_edit_tb_init,
|
||||
NULL,
|
||||
};
|
||||
gnc_item_edit_tb_type =
|
||||
g_type_register_static (GTK_TYPE_TOGGLE_BUTTON,
|
||||
"GncItemEditTb",
|
||||
&gnc_item_edit_tb_info, 0);
|
||||
}
|
||||
return gnc_item_edit_tb_type;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gnc_item_edit_tb_new (GnucashSheet *sheet)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user