From 9982ba2abd0ebdd8072ea8a67ed9c75ca6235ee4 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 10 Jan 2005 17:30:30 +0000 Subject: move some now common things in _create_window() --- perl-install/ugtk2.pm | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'perl-install') diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm index a182a7539..fd800fb25 100644 --- a/perl-install/ugtk2.pm +++ b/perl-install/ugtk2.pm @@ -839,9 +839,7 @@ sub new { if ($o->{pop_it}) { $o->{rwindow} = _create_window( title => $title, - position_policy => !$::isInstall && !$::isStandalone ? 'center_always' : 'center-on-parent', modal => $grab || $o->{grab} || $o->{modal}, - if_(!$::isInstall, icon_no_error => wm_icon()), if_($o->{transient} && $o->{transient} =~ /Gtk2::Window/, transient_for => $o->{transient}), ); @@ -855,7 +853,13 @@ sub new { } } else { if (!$::WizardWindow) { - $::WizardTable = gtknew('VBox'); + my $banner; + if (!$::isEmbedded && !$::isInstall) { + $banner = Gtk2::Banner->new(wm_icon(), $::Wizard_title) or log::l("ERROR: missing wizard banner"); + } + $::WizardTable = gtknew('VBox', + if_($banner, children_tight => $banner), + ); if ($::isEmbedded) { $::Plug = $::WizardWindow = gtknew('Plug', @@ -869,14 +873,7 @@ sub new { $::WizardWindow = _create_window( title => $title, child => gtknew('Frame', shadow_type => 'out', child => $::WizardTable), - if_(!$::isInstall, icon_no_error => wm_icon()), - if_(!$::isInstall && !$::isStandalone, position_policy => 'center_always'), - ); - - if (!$::isInstall) { - eval { gtkpack__($::WizardTable, Gtk2::Banner->new(wm_icon(), $::Wizard_title)) }; - $@ and log::l("ERROR: missing wizard banner"); - } + ); $::WizardWindow->show; } } @@ -944,6 +941,8 @@ sub _create_window { my $w = gtknew('Window', if_(!$::isInstall && !$::isWizard, border_width => 5), widget_name => 'Title', + position_policy => !$::isInstall && !$::isStandalone ? 'center_always' : 'center-on-parent', + if_(!$::isInstall, icon_no_error => wm_icon()), %options); if ($force_focus) { -- cgit v1.2.1