diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-09-28 23:38:56 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-09-28 23:38:56 +0000 |
commit | c8554f78f6b71349290d633809d4eaf4a0047b76 (patch) | |
tree | 809ac47526227f2fe6a5417e2ed6da7c489bd2e7 /perl-install/mygtk2.pm | |
parent | bebae48c37edaddaa485f165976ca18e91a3b9a2 (diff) | |
download | drakx-c8554f78f6b71349290d633809d4eaf4a0047b76.tar drakx-c8554f78f6b71349290d633809d4eaf4a0047b76.tar.gz drakx-c8554f78f6b71349290d633809d4eaf4a0047b76.tar.bz2 drakx-c8554f78f6b71349290d633809d4eaf4a0047b76.tar.xz drakx-c8554f78f6b71349290d633809d4eaf4a0047b76.zip |
(move_selection) better positionning of sidepanel's selection bar
instead of using hardcoded offset (mainly visible in MCC)
rationale: we pass the whole label widget as parameter so that we got
more control on how to compute the Y coordinate instead of requiring
callers to extract label's position from the widget
Diffstat (limited to 'perl-install/mygtk2.pm')
-rw-r--r-- | perl-install/mygtk2.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm index 96c153d2c..f218778bf 100644 --- a/perl-install/mygtk2.pm +++ b/perl-install/mygtk2.pm @@ -1478,11 +1478,11 @@ sub hide_selection { } sub move_selection { - my ($w, $y) = @_; + my ($w, $label) = @_; my $layout = $w->{layout}; $layout->{arrow_ydiff} ||= ($w->{selection_arrow}->get_pixbuf->get_height - $w->{selection_bar}->get_pixbuf->get_height)/2; - my $bar_y = $y -3; # text's pos_y -3 + my $bar_y = $label->allocation->y - ($w->{selection_bar}->get_pixbuf->get_height - $label->allocation->height)/2; $layout->move($w->{selection_bar}, 0, $bar_y); $layout->move($w->{selection_arrow}, $w->{arrow_x}, $bar_y - $layout->{arrow_ydiff}); # arrow is higer $_->show foreach $w->{selection_bar}, $w->{selection_arrow}; |