Ignore:
Timestamp:
Feb 16, 2008, 7:14:25 PM (14 years ago)
Author:
charles
Message:

(gtk) #703: better handling of rtl locales

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/torrent-cell-renderer.c

    r5033 r5048  
    404404                const GdkRectangle  * area )
    405405{
     406    const gboolean rtl = gtk_widget_get_direction( widget ) == GTK_TEXT_DIR_RTL;
    406407#if 1
    407408    const double verified = torStat->haveValid / (double)info->totalSize;
     
    430431                             || torStat->status == TR_STATUS_CHECK_WAIT;
    431432
    432     int x = area->x;
     433    int x = rtl ? area->x + area->width : area->x;
    433434    int w = 0;
    434435    GdkGC * gc = gdk_gc_new( drawable );
     
    443444        else
    444445            colors = self->priv->color_seeding;
    445         rect.x = x;
    446446        rect.width = w;
     447        rect.x = rtl ? x-w : x;
    447448        fillRect( self, gc, drawable, &rect, colors, 2 );
    448         x += w;
     449        x += rtl ? -w : w;
    449450    }
    450451
     
    452453        const GdkColor * colors = isActive ? self->priv->color_verifying
    453454                                           : self->priv->color_paused;
    454         rect.x = x;
    455455        rect.width = w;
     456        rect.x = rtl ? x-w : x;
    456457        fillRect( self, gc, drawable, &rect, colors, 2 );
    457         x += w;
     458        x += rtl ? -w : w;
    458459    }
    459460
    460461    if(( w = missingWidth )) {
    461         rect.x = x;
    462462        rect.width = w;
     463        rect.x = rtl ? x-w : x;
    463464        fillRect( self, gc, drawable, &rect, self->priv->color_missing, 2 );
    464         x += w;
     465        x += rtl ? -w : w;
    465466    }
    466467
    467468    if(( w = unwantedWidth )) {
    468         rect.x = x;
    469469        rect.width = w;
     470        rect.x = rtl ? x-w : x;
    470471        fillRect( self, gc, drawable, &rect, self->priv->color_unwanted, 2 );
    471         x += w;
     472        x += rtl ? -w : w;
    472473    }
    473474
     
    476477                                ? self->priv->color_unavailable
    477478                                : self->priv->color_missing;
    478         rect.x = x;
    479479        rect.width = w;
     480        rect.x = rtl ? x-w : x;
    480481        fillRect( self, gc, drawable, &rect, colors, 2 );
    481         x += w;
     482        x += rtl ? -w : w;
    482483    }
    483484
Note: See TracChangeset for help on using the changeset viewer.