From ec477f05839e1850b8b8aea5f53189ce90b26e4f Mon Sep 17 00:00:00 2001
From: Aleksey Lim <alsroot@member.fsf.org>
Date: Sat, 3 Apr 2010 13:27:35 +0000
Subject: Do not use deprecated API #1899
diff --git a/gtk/engine/sugar-info.c b/gtk/engine/sugar-info.c
index b4bf9c5..8d7832f 100644
a
|
b
|
sugar_fill_range_info (SugarRangeInfo *range_info, gboolean trough) |
71 | 71 | gdouble line_width = info->rc_style->line_width; |
72 | 72 | |
73 | 73 | if (info->widget) { |
74 | | range_info->focused = GTK_WIDGET_HAS_FOCUS (info->widget); |
| 74 | range_info->focused = gtk_widget_has_focus (info->widget); |
75 | 75 | } else { |
76 | 76 | /* Fall back to unfocused and orientation from the width/height. */ |
77 | 77 | range_info->focused = FALSE; |
diff --git a/gtk/engine/sugar-style.c b/gtk/engine/sugar-style.c
index b81fe69..88a80a4 100644
a
|
b
|
sugar_style_draw_box (GtkStyle *style, |
415 | 415 | sugar_draw_button (cr, &info); |
416 | 416 | |
417 | 417 | /* Spinbutton focus hack. */ |
418 | | if (widget && GTK_WIDGET_HAS_FOCUS (widget)) { |
| 418 | if (widget && gtk_widget_has_focus (widget)) { |
419 | 419 | /* Draw a focus for the spinbutton */ |
420 | 420 | sugar_style_draw_focus (style, window, GTK_STATE_NORMAL, area, widget, detail, x, y, width, height); |
421 | 421 | } |
… |
… |
sugar_style_draw_box (GtkStyle *style, |
444 | 444 | |
445 | 445 | sugar_fill_generic_info (&info, style, state_type, shadow_type, widget, detail, x, y, width, height); |
446 | 446 | |
447 | | if (widget && !GTK_WIDGET_IS_SENSITIVE (widget)) |
| 447 | if (widget && !gtk_widget_is_sensitive (widget)) |
448 | 448 | info.state = GTK_STATE_INSENSITIVE; |
449 | 449 | |
450 | 450 | /* Needed because the trough and bar are cached in a buffer inside GtkProgress. */ |
… |
… |
sugar_style_draw_box (GtkStyle *style, |
458 | 458 | |
459 | 459 | sugar_fill_generic_info (&info, style, state_type, shadow_type, widget, detail, x, y, width, height); |
460 | 460 | |
461 | | if (widget && !GTK_WIDGET_IS_SENSITIVE (widget)) |
| 461 | if (widget && !gtk_widget_is_sensitive (widget)) |
462 | 462 | info.state = GTK_STATE_INSENSITIVE; |
463 | 463 | |
464 | 464 | if (widget && GTK_IS_PROGRESS_BAR (widget)) { |
… |
… |
sugar_style_draw_flat_box (GtkStyle *style, |
585 | 585 | { |
586 | 586 | /* Hack to change the entries background when it has the focus. */ |
587 | 587 | if (DETAIL ("entry_bg")) { |
588 | | if (widget && GTK_WIDGET_HAS_FOCUS (widget)) { |
| 588 | if (widget && gtk_widget_has_focus (widget)) { |
589 | 589 | state_type = GTK_STATE_ACTIVE; |
590 | 590 | } |
591 | 591 | } else if (DETAIL ("radiobutton") || DETAIL ("checkbutton")) { |
… |
… |
sugar_style_draw_shadow (GtkStyle *style, |
638 | 638 | /* XXX: This fakes an ACTIVE state for the focused entry. |
639 | 639 | * Getting this changed in GTK+ with a style property would be cleaner |
640 | 640 | * as that also works for the font colors. (see also draw_flat_box) */ |
641 | | if (widget && GTK_WIDGET_HAS_FOCUS (widget)) { |
| 641 | if (widget && gtk_widget_has_focus (widget)) { |
642 | 642 | info.state = GTK_STATE_ACTIVE; |
643 | 643 | } |
644 | | if (widget && !GTK_WIDGET_IS_SENSITIVE (widget)) { |
| 644 | if (widget && !gtk_widget_is_sensitive (widget)) { |
645 | 645 | info.state = GTK_STATE_INSENSITIVE; |
646 | 646 | } |
647 | 647 | |