summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-08-19 13:21:17 +0000
committerThierry Vignaud <tv@mandriva.org>2008-08-19 13:21:17 +0000
commit7b5ed359ef4437302c6f66193b3f8e97ac862753 (patch)
tree09f3846e34f8abf9ed927b054d68dcef21ca6d86
parente40d3f8508fa5028d4597790aefa66ac0ece20b6 (diff)
downloaddrakx-backup-do-not-use-7b5ed359ef4437302c6f66193b3f8e97ac862753.tar
drakx-backup-do-not-use-7b5ed359ef4437302c6f66193b3f8e97ac862753.tar.gz
drakx-backup-do-not-use-7b5ed359ef4437302c6f66193b3f8e97ac862753.tar.bz2
drakx-backup-do-not-use-7b5ed359ef4437302c6f66193b3f8e97ac862753.tar.xz
drakx-backup-do-not-use-7b5ed359ef4437302c6f66193b3f8e97ac862753.zip
(_gtk__Install_Button) factorize new installer style button for further reusage
-rw-r--r--perl-install/interactive/gtk.pm14
-rw-r--r--perl-install/mygtk2.pm13
2 files changed, 18 insertions, 9 deletions
diff --git a/perl-install/interactive/gtk.pm b/perl-install/interactive/gtk.pm
index 5df2d1c4d..2e7593660 100644
--- a/perl-install/interactive/gtk.pm
+++ b/perl-install/interactive/gtk.pm
@@ -409,15 +409,11 @@ sub create_widget {
$e->{grow} = 'fill';
my $children = [ if_($e->{message}, { type => 'only_label', no_indent => 1, val => \$e->{message} }), @{$e->{children}} ];
my $box = create_widgets_block($o, $children, $update, $ignore_ref);
- $w = gtknew('Button', child => gtknew('HBox', spacing => 5,
- children_tight => [
- gtknew('Image', file => 'advanced_expander'),
- gtknew('Label', text => $e->{text}),
- ],
- ),
- if_($::isInstall, relief => 'none'),
- clicked => sub { ask_fromW($o, { }, $e->{children}) }
- );
+ $w = gtknew('HBox', children_tight => [
+ gtknew('Install_Button', text => $e->{text},
+ clicked => sub { ask_fromW($o, { }, $e->{children}) }
+ )
+ ]);
} elsif ($e->{type} =~ /list/) {
$e->{formatted_list} = [ map { may_apply($e->{format}, $_) } @{$e->{list}} ];
diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm
index c13f3966c..cce8ebdb6 100644
--- a/perl-install/mygtk2.pm
+++ b/perl-install/mygtk2.pm
@@ -144,6 +144,19 @@ sub _gtk {
$w;
}
+sub _gtk__Install_Button {
+ my ($w, $opts, $class) = @_;
+ local $opts->{widget_name} = 'Banner';
+ local $opts->{padding} = [ 20, 0 ];
+ local $opts->{child} = gtknew('HBox', spacing => 5,
+ children_tight => [
+ gtknew('Image', file => 'advanced_expander'),
+ gtknew('Label', text => delete $opts->{text}),
+ ],
+ );
+ local $opts->{relief} = 'none' if $::isInstall;
+ _gtk__Button($w, $opts, 'Button');
+}
sub _gtk__Button { &_gtk_any_Button }
sub _gtk__ToggleButton { &_gtk_any_Button }