diff options
Diffstat (limited to 'lib/widgets')
-rw-r--r-- | lib/widgets/ephy-location-entry.c | 22 | ||||
-rw-r--r-- | lib/widgets/ephy-node-view.c | 17 | ||||
-rw-r--r-- | lib/widgets/ephy-spinner.c | 26 |
3 files changed, 37 insertions, 28 deletions
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c index cbe3d065d..77826374e 100644 --- a/lib/widgets/ephy-location-entry.c +++ b/lib/widgets/ephy-location-entry.c @@ -128,7 +128,7 @@ ephy_location_entry_style_set (GtkWidget *widget, GTK_WIDGET_CLASS (ephy_location_entry_parent_class)->style_set (widget, previous_style); } - title_fg_colour = widget->style->text[GTK_STATE_INSENSITIVE]; + title_fg_colour = gtk_widget_get_style (widget)->text[GTK_STATE_INSENSITIVE]; settings = gtk_settings_get_for_screen (gtk_widget_get_screen (widget)); g_object_get (settings, "gtk-theme-name", &theme, NULL); @@ -458,7 +458,7 @@ entry_key_press_after_cb (GtkEntry *entry, (state == GDK_CONTROL_MASK || state == (GDK_CONTROL_MASK | GDK_SHIFT_MASK))) { - gtk_im_context_reset (entry->im_context); + //gtk_im_context_reset (entry->im_context); priv->needs_reset = TRUE; g_signal_emit_by_name (entry, "activate"); @@ -519,7 +519,7 @@ match_selected_cb (GtkEntryCompletion *completion, state == (GDK_CONTROL_MASK | GDK_SHIFT_MASK)); ephy_location_entry_set_location (entry, item, NULL); - gtk_im_context_reset (GTK_ENTRY (entry->priv->entry)->im_context); + //gtk_im_context_reset (GTK_ENTRY (entry->priv->entry)->im_context); g_signal_emit_by_name (priv->entry, "activate"); g_free (item); @@ -647,7 +647,7 @@ entry_populate_popup_cb (GtkEntry *entry, * menu, and insert this menu item before it. * It's a bit of a hack, but there seems to be no better way to do it :/ */ - children = GTK_MENU_SHELL (menu)->children; + children = gtk_container_get_children (GTK_CONTAINER (menu)); for (item = children; item != NULL && sep < 2; item = item->next, pos++) { if (GTK_IS_SEPARATOR_MENU_ITEM (item->data)) sep++; @@ -703,6 +703,7 @@ favicon_create_drag_pixmap (EphyLocationEntry *entry, EphyLocationEntryPrivate *priv = entry->priv; char *title = NULL, *address = NULL; GString *text; + GtkStyle *style; GdkDrawable *drawable; PangoContext *context; PangoLayout *layout; @@ -743,8 +744,9 @@ favicon_create_drag_pixmap (EphyLocationEntry *entry, layout = pango_layout_new (context); context = gtk_widget_get_pango_context (widget); + style = gtk_widget_get_style (widget); metrics = pango_context_get_metrics (context, - widget->style->font_desc, + style->font_desc, pango_context_get_language (context)); char_width = pango_font_metrics_get_approximate_digit_width (metrics); @@ -769,13 +771,13 @@ favicon_create_drag_pixmap (EphyLocationEntry *entry, pixmap_height = layout_height / PANGO_SCALE + DRAG_ICON_LAYOUT_BORDER * 2; } - drawable = gdk_pixmap_new (widget->window, + drawable = gdk_pixmap_new (gtk_widget_get_window (widget), pixmap_width + 2, pixmap_height + 2, -1); gdk_draw_rectangle (drawable, - widget->style->base_gc [GTK_WIDGET_STATE (widget)], + style->base_gc [gtk_widget_get_state (widget)], TRUE, 0, 0, pixmap_width + 1, @@ -785,7 +787,7 @@ favicon_create_drag_pixmap (EphyLocationEntry *entry, if (priv->favicon != NULL) { gdk_draw_pixbuf (drawable, - widget->style->fg_gc[GTK_WIDGET_STATE (widget)], + style->fg_gc[gtk_widget_get_state (widget)], priv->favicon, 0, 0, 1 + DRAG_ICON_LAYOUT_BORDER + DRAG_ICON_ICON_SPACING, @@ -795,13 +797,13 @@ favicon_create_drag_pixmap (EphyLocationEntry *entry, } gdk_draw_layout (drawable, - widget->style->text_gc [GTK_WIDGET_STATE (widget)], + style->text_gc [gtk_widget_get_state (widget)], 1 + DRAG_ICON_LAYOUT_BORDER + offset_x, 1 + DRAG_ICON_LAYOUT_BORDER, layout); gdk_draw_rectangle (drawable, - widget->style->black_gc, + style->black_gc, FALSE, 0, 0, pixmap_width + 1, diff --git a/lib/widgets/ephy-node-view.c b/lib/widgets/ephy-node-view.c index fcad5568e..d2ce5f351 100644 --- a/lib/widgets/ephy-node-view.c +++ b/lib/widgets/ephy-node-view.c @@ -187,7 +187,7 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view) gdk_window_get_pointer (window, NULL, &y, NULL); - y += vadjustment->value; + y += gtk_adjustment_get_value (vadjustment); gtk_tree_view_get_visible_rect (tree_view, &visible_rect); @@ -201,8 +201,8 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view) } } - value = CLAMP (vadjustment->value + offset, 0.0, - vadjustment->upper - vadjustment->page_size); + value = CLAMP (gtk_adjustment_get_value (vadjustment) + offset, 0.0, + gtk_adjustment_get_upper (vadjustment) - gtk_adjustment_get_page_size (vadjustment)); gtk_adjustment_set_value (vadjustment, value); } @@ -371,7 +371,8 @@ drag_data_received_cb (GtkWidget *widget, /* x and y here are valid only on drop ! */ - if (selection_data->length <= 0 || selection_data->data == NULL) + if ((gtk_selection_data_get_length (selection_data) <= 0) || + (gtk_selection_data_get_data (selection_data) == NULL)) { return; } @@ -474,23 +475,25 @@ filter_changed_cb (EphyNodeFilter *filter, EphyNodeView *view) { GtkWidget *window; + GdkWindow *gdk_window; g_return_if_fail (EPHY_IS_NODE_VIEW (view)); window = gtk_widget_get_toplevel (GTK_WIDGET (view)); + gdk_window = gtk_widget_get_window (window); - if (window != NULL && window->window != NULL) + if (window != NULL && gdk_window != NULL) { /* nice busy cursor */ GdkCursor *cursor; cursor = gdk_cursor_new (GDK_WATCH); - gdk_window_set_cursor (window->window, cursor); + gdk_window_set_cursor (gdk_window, cursor); gdk_cursor_unref (cursor); gdk_flush (); - gdk_window_set_cursor (window->window, NULL); + gdk_window_set_cursor (gdk_window, NULL); /* no flush: this will cause the cursor to be reset * only when the UI is free again */ diff --git a/lib/widgets/ephy-spinner.c b/lib/widgets/ephy-spinner.c index a210a156b..068a36a8e 100644 --- a/lib/widgets/ephy-spinner.c +++ b/lib/widgets/ephy-spinner.c @@ -598,7 +598,7 @@ ephy_spinner_init (EphySpinner *spinner) details = spinner->details = EPHY_SPINNER_GET_PRIVATE (spinner); - GTK_WIDGET_SET_FLAGS (GTK_WIDGET (spinner), GTK_NO_WINDOW); + gtk_widget_set_has_window (GTK_WIDGET (spinner), FALSE); details->cache = ephy_spinner_cache_ref (); details->size = GTK_ICON_SIZE_DIALOG; @@ -614,12 +614,14 @@ ephy_spinner_expose (GtkWidget *widget, EphySpinner *spinner = EPHY_SPINNER (widget); EphySpinnerDetails *details = spinner->details; EphySpinnerImages *images; + GtkAllocation allocation; GdkPixbuf *pixbuf; + GdkWindow *window; GdkGC *gc; int x_offset, y_offset, width, height; GdkRectangle pix_area, dest; - if (!GTK_WIDGET_DRAWABLE (spinner)) + if (!gtk_widget_is_drawable (GTK_WIDGET (spinner))) { return FALSE; } @@ -650,11 +652,12 @@ ephy_spinner_expose (GtkWidget *widget, height = gdk_pixbuf_get_height (pixbuf); /* Compute the offsets for the image centered on our allocation */ - x_offset = (widget->allocation.width - width) / 2; - y_offset = (widget->allocation.height - height) / 2; + gtk_widget_get_allocation (widget, &allocation); + x_offset = (allocation.width - width) / 2; + y_offset = (allocation.height - height) / 2; - pix_area.x = x_offset + widget->allocation.x; - pix_area.y = y_offset + widget->allocation.y; + pix_area.x = x_offset + allocation.x; + pix_area.y = y_offset + allocation.y; pix_area.width = width; pix_area.height = height; @@ -663,10 +666,11 @@ ephy_spinner_expose (GtkWidget *widget, return FALSE; } - gc = gdk_gc_new (widget->window); - gdk_draw_pixbuf (widget->window, gc, pixbuf, - dest.x - x_offset - widget->allocation.x, - dest.y - y_offset - widget->allocation.y, + window = gtk_widget_get_window (widget); + gc = gdk_gc_new (window); + gdk_draw_pixbuf (window, gc, pixbuf, + dest.x - x_offset - allocation.x, + dest.y - y_offset - allocation.y, dest.x, dest.y, dest.width, dest.height, GDK_RGB_DITHER_MAX, 0, 0); @@ -924,7 +928,7 @@ ephy_spinner_stop (EphySpinner *spinner) { ephy_spinner_remove_update_callback (spinner); - if (GTK_WIDGET_MAPPED (GTK_WIDGET (spinner))) + //if (GTK_WIDGET_MAPPED (GTK_WIDGET (spinner))) { gtk_widget_queue_draw (GTK_WIDGET (spinner)); } |