1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-10 06:02:57 +00:00

(gtk) #703: better handling of rtl locales

This commit is contained in:
Charles Kerr 2008-02-16 19:14:25 +00:00
parent f8786b6df0
commit 93b8b40e92

View file

@ -403,6 +403,7 @@ drawRegularBar( TorrentCellRenderer * self,
GtkWidget * widget, GtkWidget * widget,
const GdkRectangle * area ) const GdkRectangle * area )
{ {
const gboolean rtl = gtk_widget_get_direction( widget ) == GTK_TEXT_DIR_RTL;
#if 1 #if 1
const double verified = torStat->haveValid / (double)info->totalSize; const double verified = torStat->haveValid / (double)info->totalSize;
const double unverified = torStat->haveUnchecked / (double)info->totalSize; const double unverified = torStat->haveUnchecked / (double)info->totalSize;
@ -429,7 +430,7 @@ drawRegularBar( TorrentCellRenderer * self,
const gboolean isChecking = torStat->status == TR_STATUS_CHECK const gboolean isChecking = torStat->status == TR_STATUS_CHECK
|| torStat->status == TR_STATUS_CHECK_WAIT; || torStat->status == TR_STATUS_CHECK_WAIT;
int x = area->x; int x = rtl ? area->x + area->width : area->x;
int w = 0; int w = 0;
GdkGC * gc = gdk_gc_new( drawable ); GdkGC * gc = gdk_gc_new( drawable );
GdkRectangle rect = *area; GdkRectangle rect = *area;
@ -442,43 +443,43 @@ drawRegularBar( TorrentCellRenderer * self,
colors = self->priv->color_verified; colors = self->priv->color_verified;
else else
colors = self->priv->color_seeding; colors = self->priv->color_seeding;
rect.x = x;
rect.width = w; rect.width = w;
rect.x = rtl ? x-w : x;
fillRect( self, gc, drawable, &rect, colors, 2 ); fillRect( self, gc, drawable, &rect, colors, 2 );
x += w; x += rtl ? -w : w;
} }
if(( w = unverifiedWidth )) { if(( w = unverifiedWidth )) {
const GdkColor * colors = isActive ? self->priv->color_verifying const GdkColor * colors = isActive ? self->priv->color_verifying
: self->priv->color_paused; : self->priv->color_paused;
rect.x = x;
rect.width = w; rect.width = w;
rect.x = rtl ? x-w : x;
fillRect( self, gc, drawable, &rect, colors, 2 ); fillRect( self, gc, drawable, &rect, colors, 2 );
x += w; x += rtl ? -w : w;
} }
if(( w = missingWidth )) { if(( w = missingWidth )) {
rect.x = x;
rect.width = w; rect.width = w;
rect.x = rtl ? x-w : x;
fillRect( self, gc, drawable, &rect, self->priv->color_missing, 2 ); fillRect( self, gc, drawable, &rect, self->priv->color_missing, 2 );
x += w; x += rtl ? -w : w;
} }
if(( w = unwantedWidth )) { if(( w = unwantedWidth )) {
rect.x = x;
rect.width = w; rect.width = w;
rect.x = rtl ? x-w : x;
fillRect( self, gc, drawable, &rect, self->priv->color_unwanted, 2 ); fillRect( self, gc, drawable, &rect, self->priv->color_unwanted, 2 );
x += w; x += rtl ? -w : w;
} }
if(( w = unavailableWidth )) { if(( w = unavailableWidth )) {
const GdkColor * colors = isActive && self->priv->show_unavailable const GdkColor * colors = isActive && self->priv->show_unavailable
? self->priv->color_unavailable ? self->priv->color_unavailable
: self->priv->color_missing; : self->priv->color_missing;
rect.x = x;
rect.width = w; rect.width = w;
rect.x = rtl ? x-w : x;
fillRect( self, gc, drawable, &rect, colors, 2 ); fillRect( self, gc, drawable, &rect, colors, 2 );
x += w; x += rtl ? -w : w;
} }
if( isChecking ) { if( isChecking ) {