diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2003-07-09 17:43:35 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2003-07-09 17:43:35 +0000 |
commit | 9d2a6df44cf163e41a5baedf0b2ac86736cf3a49 (patch) | |
tree | 81b253eb7200b2b81f884a108eadeba1ff54fa0c | |
parent | 422435ce1d5281ebd86569dfdb4103e22e7f1747 (diff) | |
download | control-center-9d2a6df44cf163e41a5baedf0b2ac86736cf3a49.tar control-center-9d2a6df44cf163e41a5baedf0b2ac86736cf3a49.tar.gz control-center-9d2a6df44cf163e41a5baedf0b2ac86736cf3a49.tar.bz2 control-center-9d2a6df44cf163e41a5baedf0b2ac86736cf3a49.tar.xz control-center-9d2a6df44cf163e41a5baedf0b2ac86736cf3a49.zip |
flip images for rtl languages (aka hebrew)
-rw-r--r-- | Makefile | 1 | ||||
-rwxr-xr-x | control-center | 22 |
2 files changed, 19 insertions, 4 deletions
@@ -34,6 +34,7 @@ install: all for d in $(SUBDIRS); do ( cd $$d ; make $@ ) ; done dis: clean + for i in pixmaps/default/mcc-left*png; do convert -flop $i ${i%.png}_rtl.png;done rm -rf $(NAME)-$(VERSION) ../$(NAME)-$(VERSION).tar* mkdir -p $(NAME)-$(VERSION) find . -not -name "$(NAME)-$(VERSION)" | cpio -pd $(NAME)-$(VERSION)/ diff --git a/control-center b/control-center index b33eda42..27660a7b 100755 --- a/control-center +++ b/control-center @@ -346,8 +346,8 @@ gtkadd($window_global, 0, my $fixed_left = gtkset_name(Gtk2::Fixed->new, 'mcc'), # default left background 1, gtksignal_connect(gtkset_size_request(Gtk2::DrawingArea->new(), -1, -1), - realize => sub { set_back_pixbuf($_[0], gtkcreate_pixbuf('mcc-left-back-middle')) }), - 0, gtkcreate_img('mcc-left-back-bottom') + realize => sub { set_back_pixbuf($_[0], rtl_gtkcreate_pixbuf('mcc-left-back-middle')) }), + 0, rtl_gtkcreate_img('mcc-left-back-bottom') ), 1, gtkpack_(Gtk2::VBox->new(0, 0), 0, gtksignal_connect(gtkset_size_request(Gtk2::DrawingArea->new(), -1, 1), @@ -431,7 +431,7 @@ my (undef, $nodename, $release, undef, $machine) = POSIX::uname(); my @darea_left_list; my ($cursor_hand, $cursor_normal) = (Gtk2::Gdk::Cursor->new('hand2'), Gtk2::Gdk::Cursor->new('left-ptr')); -my $left_back_pixbuf = gtkcreate_pixbuf('mcc-left-back'); +my $left_back_pixbuf = rtl_gtkcreate_pixbuf('mcc-left-back'); my ($back_width, $back_height) = ($left_back_pixbuf->get_width, $left_back_pixbuf->get_height); # 0 => unselected, 1 => highlited, 2 => selected @@ -461,10 +461,12 @@ foreach (@tree) { # $lspacing = round_up(($d_height-$icon_height)/2, 1); $lspacing = ($d_height-$icon_height)/2; $left_txt_offset = $lspacing * 2 + $icon_width; + $icon_offset = 15 if lang::text_direction_rtl(); + $left_txt_offset += $icon_offset; $lspacing = round_up($lspacing, 1); } - my $left_back_pixbuf = $my_index ? $left_back_pixbuf : gtkcreate_pixbuf('mcc-left-back-top'); + my $left_back_pixbuf = $my_index ? $left_back_pixbuf : rtl_gtkcreate_pixbuf('mcc-left-back-top'); my @icon_pixbufs = ($icon_pixbuf, render_shiner($icon_pixbuf, 1.89), $icon_pixbuf); @@ -934,6 +936,18 @@ sub set_page { #------------------------------------------------------------- # mcc specific graphic functions: +sub rtl_gtkcreate_pixbuf { + my ($icon) = @_; + my $pixbuf; + eval { $pixbuf = ugtk2::gtkcreate_pixbuf($icon . "_rtl") } if lang::text_direction_rtl(); + $pixbuf ||= ugtk2::gtkcreate_pixbuf($icon); +} + +sub rtl_gtkcreate_img { + my ($icon) = @_; + ugtk2::gtkcreate_img($icon . "_rtl"); +} + sub new_pixbuf { my ($pixbuf) = @_; my ($height, $width) = ($pixbuf->get_height, $pixbuf->get_width); |