diff options
author | Thierry Vignaud <tv@mandriva.org> | 2009-01-27 14:57:17 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2009-01-27 14:57:17 +0000 |
commit | 224d8204ed5f0003f14dd1ddf67476946f5c12a4 (patch) | |
tree | 6b1b9ee3d07fa5ecea83652b2ea4245edc747904 /perl-install/ugtk2.pm | |
parent | d95a8ec330d6597b07e75adc3882c623a9290849 (diff) | |
download | drakx-224d8204ed5f0003f14dd1ddf67476946f5c12a4.tar drakx-224d8204ed5f0003f14dd1ddf67476946f5c12a4.tar.gz drakx-224d8204ed5f0003f14dd1ddf67476946f5c12a4.tar.bz2 drakx-224d8204ed5f0003f14dd1ddf67476946f5c12a4.tar.xz drakx-224d8204ed5f0003f14dd1ddf67476946f5c12a4.zip |
simplify through first()/second()
Diffstat (limited to 'perl-install/ugtk2.pm')
-rw-r--r-- | perl-install/ugtk2.pm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm index 200e7a188..279a8ea88 100644 --- a/perl-install/ugtk2.pm +++ b/perl-install/ugtk2.pm @@ -350,8 +350,8 @@ sub create_box_with_title { $scroll->signal_connect(realize => sub { my $layout = $wtext->create_pango_layout($text); $layout->set_width(($width - 10) * Gtk2::Pango->scale); - $wtext->set_size_request($width, min(200, ($layout->get_pixel_size)[1] + 10)); - $scroll->set_size_request($width, min(200, ($layout->get_pixel_size)[1] + 10)); + $wtext->set_size_request($width, min(200, second($layout->get_pixel_size) + 10)); + $scroll->set_size_request($width, min(200, second($layout->get_pixel_size) + 10)); $o->{rwindow}->queue_resize; }); gtkpack_($box, $o->{box_allow_grow} || 0, $scroll); @@ -1432,7 +1432,7 @@ sub set_pixmap { sub update_text { my ($darea) = @_; $darea->{layout} = $darea->create_pango_layout($darea->{text}); - $darea->{txt_width} = ($darea->{layout}->get_pixel_size)[0]; + $darea->{txt_width} = first($darea->{layout}->get_pixel_size); $darea->queue_draw; } @@ -1467,7 +1467,7 @@ sub new { my $x_icon = $is_rtl ? $d_width - 12 - $width : 12; # here: 48 is the amount of white background in the blue background we wish to ignore: my $x_text = $is_rtl ? $d_width - $blue_width + 48 - $darea->{txt_width} : $blue_width - 48; - $darea->{layout_height} ||= ($darea->{layout}->get_pixel_size)[1]; + $darea->{layout_height} ||= second($darea->{layout}->get_pixel_size); $blue_part->render_to_drawable($darea->window, $style->bg_gc('normal'), 0, 0, $x_blue, 0, -1, -1, 'none', 0, 0); $darea->{icon}->render_to_drawable($darea->window, $style->bg_gc('normal'), @@ -1543,7 +1543,7 @@ sub RENDER { # not that efficient... $layout->set_text($cell->get('label')); my $is_rtl = lang::text_direction_rtl(); - my $txt_width = ($layout->get_pixel_size)[0]; + my $txt_width = first($layout->get_pixel_size); my ($x_offset, $y_offset, $_width, $_height) = calc_size($cell, $layout); my $pixbuf = $cell->get('pixbuf'); |