Ticket #1899: sugar-1899.patch

File sugar-1899.patch, 3.3 KB (added by alsroot, 14 years ago)
  • gtk/engine/sugar-info.c

    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) 
    7171    gdouble line_width = info->rc_style->line_width;
    7272
    7373    if (info->widget) {
    74         range_info->focused = GTK_WIDGET_HAS_FOCUS (info->widget);
     74        range_info->focused = gtk_widget_has_focus (info->widget);
    7575    } else {
    7676        /* Fall back to unfocused and orientation from the width/height. */
    7777        range_info->focused = FALSE;
  • gtk/engine/sugar-style.c

    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, 
    415415        sugar_draw_button (cr, &info);
    416416
    417417        /* Spinbutton focus hack. */
    418         if (widget && GTK_WIDGET_HAS_FOCUS (widget)) {
     418        if (widget && gtk_widget_has_focus (widget)) {
    419419            /* Draw a focus for the spinbutton */
    420420            sugar_style_draw_focus (style, window, GTK_STATE_NORMAL, area, widget, detail, x, y, width, height);
    421421        }
    sugar_style_draw_box (GtkStyle *style, 
    444444
    445445            sugar_fill_generic_info (&info, style, state_type, shadow_type, widget, detail, x, y, width, height);
    446446           
    447             if (widget && !GTK_WIDGET_IS_SENSITIVE (widget))
     447            if (widget && !gtk_widget_is_sensitive (widget))
    448448                info.state = GTK_STATE_INSENSITIVE;
    449449
    450450            /* Needed because the trough and bar are cached in a buffer inside GtkProgress. */
    sugar_style_draw_box (GtkStyle *style, 
    458458
    459459            sugar_fill_generic_info (&info, style, state_type, shadow_type, widget, detail, x, y, width, height);
    460460           
    461             if (widget && !GTK_WIDGET_IS_SENSITIVE (widget))
     461            if (widget && !gtk_widget_is_sensitive (widget))
    462462                info.state = GTK_STATE_INSENSITIVE;
    463463           
    464464            if (widget && GTK_IS_PROGRESS_BAR (widget)) {
    sugar_style_draw_flat_box (GtkStyle *style, 
    585585{
    586586    /* Hack to change the entries background when it has the focus. */
    587587    if (DETAIL ("entry_bg")) {
    588         if (widget && GTK_WIDGET_HAS_FOCUS (widget)) {
     588        if (widget && gtk_widget_has_focus (widget)) {
    589589            state_type = GTK_STATE_ACTIVE;
    590590        }
    591591    } else if (DETAIL ("radiobutton") || DETAIL ("checkbutton")) {
    sugar_style_draw_shadow (GtkStyle *style, 
    638638        /* XXX: This fakes an ACTIVE state for the focused entry.
    639639         *      Getting this changed in GTK+ with a style property would be cleaner
    640640         *      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)) {
    642642            info.state = GTK_STATE_ACTIVE;
    643643        }
    644         if (widget && !GTK_WIDGET_IS_SENSITIVE (widget)) {
     644        if (widget && !gtk_widget_is_sensitive (widget)) {
    645645            info.state = GTK_STATE_INSENSITIVE;
    646646        }
    647647