Replace some deprecated widgets in the register.

This commit is contained in:
Robert Fewell 2017-06-15 19:45:39 +01:00
parent 0abc3e32a1
commit 78f28887a6
6 changed files with 19 additions and 22 deletions

View File

@ -819,13 +819,6 @@ static void
popup_post_show (GtkWidget *widget,
G_GNUC_UNUSED gpointer user_data)
{
/* What the hell is this doing here? Well, under gtk+ 1.2.9,
* the scrollbars never appear without it. Why does it work?
* Why are you asking so many questions? There's nothing to
* see here. These aren't the droids you're looking for.
* Move along. */
gtk_widget_size_request (widget, NULL);
gnc_item_list_autosize (GNC_ITEM_LIST (widget));
gnc_item_list_show_selected (GNC_ITEM_LIST (widget));
}

View File

@ -643,7 +643,7 @@ get_popup_height (GtkWidget *widget,
req.height = 0;
req.width = 0;
gtk_widget_size_request (cal, &req);
gtk_widget_get_preferred_size (cal, &req, NULL);
return req.height;
}

View File

@ -225,11 +225,11 @@ gnc_header_unrealize (GtkWidget *widget)
header->surface = NULL;
if (header->resize_cursor)
gdk_cursor_unref (header->resize_cursor);
g_object_unref (header->resize_cursor);
header->resize_cursor = NULL;
if (header->normal_cursor)
gdk_cursor_unref (header->normal_cursor);
g_object_unref (header->normal_cursor);
header->normal_cursor = NULL;
if (GTK_WIDGET_CLASS (parent_class)->unrealize)
@ -556,7 +556,8 @@ gnc_header_set_property (GObject *object,
{
case PROP_SHEET:
header->sheet = GNUCASH_SHEET (g_value_get_object (value));
gtk_layout_set_hadjustment (layout, header->sheet->hadj);
gtk_scrollable_set_hadjustment (GTK_SCROLLABLE(layout), header->sheet->hadj);
needs_update = TRUE;
break;
case PROP_CURSOR_NAME:

View File

@ -150,6 +150,8 @@ gnc_item_edit_init (GncItemEdit *item_edit)
{
/* Set invalid values so that we know when we have been fully
initialized */
gtk_orientable_set_orientation (GTK_ORIENTABLE(item_edit), GTK_ORIENTATION_HORIZONTAL);
item_edit->sheet = NULL;
item_edit->editor = NULL;
@ -480,7 +482,7 @@ gnc_item_edit_get_type (void)
};
gnc_item_edit_type =
g_type_register_static(GTK_TYPE_HBOX,
g_type_register_static(GTK_TYPE_BOX,
"GncItemEdit",
&gnc_item_edit_info, 0);
}
@ -589,7 +591,8 @@ gnc_item_edit_show_popup (GncItemEdit *item_edit)
view_height = alloc.height;
view_width = alloc.width;
vadj = gtk_layout_get_vadjustment(GTK_LAYOUT(sheet));
vadj = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(sheet));
y_offset = gtk_adjustment_get_value(vadj);
gnc_item_edit_get_pixel_coords (item_edit, &x, &y, &w, &h);

View File

@ -68,7 +68,7 @@ struct _PopupToggle
typedef struct
{
GtkHBox hbox;
GtkBox hbox;
GnucashSheet *sheet;
/* The editor whose status we reflect on the sheet */
@ -94,7 +94,7 @@ typedef struct
typedef struct
{
GtkHBoxClass parent_class;
GtkBoxClass parent_class;
} GncItemEditClass;

View File

@ -411,7 +411,7 @@ gnucash_sheet_compute_visible_range (GnucashSheet *sheet)
gtk_widget_get_allocation (GTK_WIDGET(sheet), &alloc);
height = alloc.height;
adj = gtk_layout_get_vadjustment(GTK_LAYOUT(sheet));
adj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE(sheet));
cy = gtk_adjustment_get_value(adj);
top_block = gnucash_sheet_y_pixel_to_block (sheet, cy);
@ -461,9 +461,9 @@ gnucash_sheet_show_row (GnucashSheet *sheet, gint virt_row)
vcell_loc.virt_row = MIN (vcell_loc.virt_row,
sheet->num_virt_rows - 1);
adj = gtk_layout_get_hadjustment(GTK_LAYOUT(sheet));
adj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE(sheet));
cx = gtk_adjustment_get_value(adj);
adj = gtk_layout_get_vadjustment(GTK_LAYOUT(sheet));
adj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE(sheet));
cy = gtk_adjustment_get_value(adj);
x = cx;
@ -540,9 +540,9 @@ gnucash_sheet_show_range (GnucashSheet *sheet,
end_loc.virt_row = MIN (end_loc.virt_row,
sheet->num_virt_rows - 1);
adj = gtk_layout_get_hadjustment(GTK_LAYOUT(sheet));
adj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE(sheet));
cx = gtk_adjustment_get_value(adj);
adj = gtk_layout_get_vadjustment(GTK_LAYOUT(sheet));
adj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE(sheet));
cy = gtk_adjustment_get_value(adj);
x = cx;
@ -689,8 +689,8 @@ gnucash_sheet_create (Table *table)
sheet = g_object_new (GNUCASH_TYPE_SHEET, NULL);
sheet->table = table;
sheet->entry = NULL;
sheet->vadj = gtk_layout_get_vadjustment (GTK_LAYOUT(sheet));
sheet->hadj = gtk_layout_get_hadjustment (GTK_LAYOUT(sheet));
sheet->vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE(sheet));
sheet->hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE(sheet));
g_signal_connect (G_OBJECT (sheet->vadj), "value_changed",
G_CALLBACK (gnucash_sheet_vadjustment_value_changed), sheet);