From ab71025b490545b5d3f31787777965ec547ceeed Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 10 Aug 2007 23:12:27 +0000 Subject: (Gtk2::MDV::CellRendererPixWithLabel->RENDER) make it RTL aware (#32450) --- perl-install/ugtk2.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'perl-install') diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm index 3072aadaf..2d463648b 100644 --- a/perl-install/ugtk2.pm +++ b/perl-install/ugtk2.pm @@ -1504,14 +1504,18 @@ sub RENDER { # not that efficient... my $layout = $cell->get_layout($widget); $layout->set_text($cell->get('label')); + my $is_rtl = lang::text_direction_rtl(); + my $txt_width = ($layout->get_pixel_size)[0]; + my ($x_offset, $y_offset, $_width, $_height) = calc_size($cell, $layout); my $pixbuf = $cell->get('pixbuf'); my ($pwidth, $pheight) = pixbuf_size($cell); + my $txt_offset = $cell_area->x + $x_offset + $x_padding * 2 + $pwidth; if ($pixbuf) { $pixbuf->render_to_drawable($window, $widget->style->fg_gc('normal'), 0, 0, - $cell_area->x ,#+ $x_padding, + $is_rtl ? $cell_area->width - $cell_area->x - $pwidth : $cell_area->x ,#+ $x_padding, $cell_area->y, #+ $y_padding, $pwidth, $pheight, 'none', 0, 0); } @@ -1521,7 +1525,7 @@ sub RENDER { # not that efficient... $cell_area, $widget, "cellrenderertext", - $cell_area->x + $x_offset + $x_padding * 2 + $pwidth, + $is_rtl ? $cell_area->width - $txt_width - $txt_offset : $txt_offset, $cell_area->y + $y_offset + $y_padding, $layout); -- cgit v1.2.1