diff options
author | Thierry Vignaud <tv@mandriva.org> | 2006-09-18 08:38:19 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2006-09-18 08:38:19 +0000 |
commit | e48586621503fdf26c99257d5647fe6a6ec74c0a (patch) | |
tree | 300921afb9c888f717dbda665e42be4cf14c5230 | |
parent | 255c67d998576a4176cb88efa6dc42634564efc1 (diff) | |
download | rpmdrake-e48586621503fdf26c99257d5647fe6a6ec74c0a.tar rpmdrake-e48586621503fdf26c99257d5647fe6a6ec74c0a.tar.gz rpmdrake-e48586621503fdf26c99257d5647fe6a6ec74c0a.tar.bz2 rpmdrake-e48586621503fdf26c99257d5647fe6a6ec74c0a.tar.xz rpmdrake-e48586621503fdf26c99257d5647fe6a6ec74c0a.zip |
on "size_request" signals, resize embedded widgets (#25533)
-rwxr-xr-x | rpmdrake | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -593,6 +593,26 @@ sub format_field { '<b>' . escape_text_for_TextView_markup_format($str) . '</b>'; } +package Gtk2::Mdv::TextView; + +sub new { + my ($_class, $icon, $text, $o_options) = @_; + my $w = Gtk2::TextView->new; + $w->signal_connect(size_request => sub { + my ($w, $requisition) = @_; + return if !ref($w->{anchors}); + foreach my $anchor (@{$w->{anchors}}) { + $_->set_size_request($requisition->width-30, -1) foreach $anchor->get_widgets; + } + 1; + }); + $w; +} + +1; + +package main; + sub format_pkg_simplifiedinfo { my ($pkgs, $key, $urpm, $descriptions) = @_; my ($name, $version) = split_fullname($key); @@ -1139,7 +1159,7 @@ or you already installed all of them.")); ); } - my $info = Gtk2::TextView->new; + my $info = Gtk2::Mdv::TextView->new; $info->set_left_margin(2); $info->set_right_margin(15); #- workaround when right elevator of scrolled window appears |