diff options
author | Thierry Vignaud <tv@mandriva.org> | 2009-09-17 10:07:36 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2009-09-17 10:07:36 +0000 |
commit | 83862af83ddce62bcf54b1d706e31780645c7fc4 (patch) | |
tree | 8fcdb94a1be1889f997abf4919c6e4819f0dfb92 | |
parent | e083677a5e3834d4857e8b80881fa157be139dde (diff) | |
download | drakx-83862af83ddce62bcf54b1d706e31780645c7fc4.tar drakx-83862af83ddce62bcf54b1d706e31780645c7fc4.tar.gz drakx-83862af83ddce62bcf54b1d706e31780645c7fc4.tar.bz2 drakx-83862af83ddce62bcf54b1d706e31780645c7fc4.tar.xz drakx-83862af83ddce62bcf54b1d706e31780645c7fc4.zip |
(create_widget) use stock icons for up & down buttons in order to pack
them horizontaly so that we fit in default sizing(#53703)
-rw-r--r-- | perl-install/NEWS | 3 | ||||
-rw-r--r-- | perl-install/interactive/gtk.pm | 18 |
2 files changed, 18 insertions, 3 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS index 8b0e3f2e8..e0bad5017 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,6 @@ +- drakboot: + o use stock icons for up & down buttons in order to pack them + horizontaly so that we fit in default sizing(#53703) - drakhelp o fix check for missing help diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm index ecdcf554c..971203960 100644 --- a/perl-install/interactive/gtk.pm +++ b/perl-install/interactive/gtk.pm @@ -453,10 +453,12 @@ sub create_widget { my @buttons = (N_("Add"), N_("Modify"), N_("Remove")); # Add Up/Down buttons if their actions are defined foreach (qw(Up Down)) { - push @buttons, $_ if $actions->{$_}; + push @buttons, 'gtk-go-' . lc($_) if $actions->{$_}; } @buttons = map { - { kind => lc $_, action => $actions->{$_}, button => Gtk2::Button->new(translate($_)) }; + my $button = /^gtk-/ ? gtknew('Button', image => gtknew('Image', stock => $_)) + : Gtk2::Button->new(translate($_)); + { kind => lc $_, action => $actions->{$_}, button => $button }; } @buttons; my $modify = find { $_->{kind} eq 'modify' } @buttons; @@ -473,9 +475,19 @@ sub create_widget { } add_modify_remove_sensitive(\@buttons, $e); + my ($images, $real_buttons) = partition { $_->{kind} =~ /^gtk-/ } @buttons; $real_w = gtkpack_(Gtk2::HBox->new(0,0), 1, create_scrolled_window($w), - 0, gtkpack__(Gtk2::VBox->new(0,0), map { $_->{button} } @buttons)); + 0, gtkpack__(Gtk2::VBox->new(0,0), + (map { $_->{button} } @$real_buttons), + if_($images, + gtknew('HButtonBox', + layout => 'spread', + children_loose => [ map { $_->{button} } @$images] + ) + ), + ), + ); $e->{grow} = 'expand'; } else { my $use_boxradio = exists $e->{gtk}{use_boxradio} ? $e->{gtk}{use_boxradio} : @{$e->{list}} <= 8; |