From 4e51a3864c6e4ddf9fb0f423d678e6fff3ea8aea Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 22 Sep 2008 13:12:49 +0000 Subject: (create_steps_window,update_steps_position) use the new widget in order to render the sidepanel --- perl-install/install/gtk.pm | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) (limited to 'perl-install/install/gtk.pm') diff --git a/perl-install/install/gtk.pm b/perl-install/install/gtk.pm index 6447076b0..8f2a74785 100644 --- a/perl-install/install/gtk.pm +++ b/perl-install/install/gtk.pm @@ -135,26 +135,11 @@ sub create_steps_window { } my $offset = 10; - my $height = 600; $o->{steps_widget} = - gtknew('Fixed', widget_name => 'Steps', pixbuf_file => 'left-background', - has_window => 1, x => 0, y => 145, height => $height, width => $::stepswidth, # -1 - child => gtknew('VBox', spacing => 6, width => ($::stepswidth - $offset), children_tight => \@l)); - - # prevent logo to be tiled (do mosazic style rendering): - $o->{steps_widget}->put(gtknew('Image', file => 'left-background-filler.png'), 0, $height); - - $o->{steps_widget}->put( - # FIXME: not RTL compliant (lang::text_direction_rtl() ? ...) - gtknew('VBox', height => $::rootheight, - children => [ - 0, gtknew('Image', file => 'left-top-corner'), - (map { (1, gtknew('Image', file => 'left-border')) } 1 .. $::rootheight), - 0, gtknew('Image', file => 'left-bottom-corner'), - ]), - $::stepswidth - 21, 0); - - $o->{steps_widget}->show; + gtknew('MDV_Notebook', widget_name => 'Steps', children => [ + # 145 is the vertical offset in order to be below the actual logo: + [ gtknew('VBox', spacing => 6, width => ($::stepswidth - $offset), children_tight => \@l), 0, 145 ] + ]); $root_window->add( $o->{steps_window} = @@ -168,6 +153,9 @@ sub create_steps_window { ); $root_window->show_all; + + # hide default selection since its position is bogus: + $o->{steps_widget}->hide_selection; } sub update_steps_position { @@ -177,7 +165,10 @@ sub update_steps_position { foreach (@{$o->{orderedSteps}}) { exists $steps{steps}{$_} or next; if ($o->{steps}{$_}{entered} && !$o->{steps}{$_}{done}) { - $steps{steps}{$_}{img}->set_from_pixbuf($steps{on}); + # we need to flush the X queue since else we got a temporary Y position of -1 when switching locales: + mygtk2::flush(); #- for auto_installs which never go through the Gtk2 main loop + $o->{steps_widget}->move_selection($steps{steps}{$_}{text}->allocation->y); + if ($last_step) { $steps{steps}{$last_step}{img}->set_from_pixbuf($steps{done}); } -- cgit v1.2.1