summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-08-10 23:12:27 +0000
committerThierry Vignaud <tv@mandriva.org>2007-08-10 23:12:27 +0000
commitab71025b490545b5d3f31787777965ec547ceeed (patch)
tree98d738b8574953fe86b6cd8ef4984c34760ba360
parent4366c0830f5e6ae8185425f1ed73e9ac1ed3243d (diff)
downloaddrakx-ab71025b490545b5d3f31787777965ec547ceeed.tar
drakx-ab71025b490545b5d3f31787777965ec547ceeed.tar.gz
drakx-ab71025b490545b5d3f31787777965ec547ceeed.tar.bz2
drakx-ab71025b490545b5d3f31787777965ec547ceeed.tar.xz
drakx-ab71025b490545b5d3f31787777965ec547ceeed.zip
(Gtk2::MDV::CellRendererPixWithLabel->RENDER) make it RTL aware (#32450)
-rw-r--r--perl-install/ugtk2.pm8
1 files changed, 6 insertions, 2 deletions
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);