diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2004-01-06 17:56:52 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2004-01-06 17:56:52 +0000 |
commit | f5126e2d18a189a806d80e9f53c9ac9776708df6 (patch) | |
tree | d7fc717a1854ce4ee2a6fb50db73711bc7bd86b9 | |
parent | 3a768271cf438f74147eec4d4d5857e8438eec43 (diff) | |
download | control-center-f5126e2d18a189a806d80e9f53c9ac9776708df6.tar control-center-f5126e2d18a189a806d80e9f53c9ac9776708df6.tar.gz control-center-f5126e2d18a189a806d80e9f53c9ac9776708df6.tar.bz2 control-center-f5126e2d18a189a806d80e9f53c9ac9776708df6.tar.xz control-center-f5126e2d18a189a806d80e9f53c9ac9776708df6.zip |
add banners
-rwxr-xr-x | control-center | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/control-center b/control-center index 2f67ac4e..95b4eccf 100755 --- a/control-center +++ b/control-center @@ -528,6 +528,7 @@ gtkadd($window_global, ), ), 'mcc'), + 0, my $banner_notebook = gtkset_size_request(Gtk2::Notebook->new, -1, 75), 1, my $notebook_global = gtkset_name(Gtk2::Notebook->new, 'mcc'), 0, gtkset_name(my $w_exp = create_scrolled_window(gtkset_shadow_type(gtkset_size_request(gtkset_border_width($exp_frame = Gtk2::Frame->new(N("Logs")), 5), -1, 120), 'etched_in'), [ 'never', 'never' ], 'none'), 'mcc'), ), @@ -543,30 +544,24 @@ $window_global->signal_connect(delete_event => \&quit_global); $window_global->set_title(N("Mandrake Control Center %s", $version) . " [" . chomp_(`hostname`) . "]"); $window_global->set_position('center'); -$notebook_global->set_property('show-border', 0); -$notebook_global->set_property('show-tabs', 0); +foreach my $notebook ($notebook_global, $banner_notebook) { + $notebook->set_property('show-border', 0); + $notebook->set_property('show-tabs', 0); +} + # banner : -my $pixbuf_icon = gtkcreate_pixbuf('mcc-title-icon'); +my $font = N("_banner font: Sans 20"); +add2notebook($banner_notebook, "", Gtk2::Banner->new("title-back", "/usr/share/icons/large/drakconf.png", + N("Welcome to the Mandrake Control Center"), $font)); # main page (summary) : -my $margin = 40; -my $summary = gtktext_insert(Gtk2::TextView->new, [ - [ N("Welcome to the Mandrake Control Center")."\n\n", - {'size-points' => 15, justification => 'center', pixels_above_lines => $margin-10, - 'weight-set' => 1, weight => 1000 } ], - [ "\n ", { justification => 'GTK_JUSTIFY_RIGHT' } ], - [ gtkcreate_pixbuf('mcc-welcome-logo'), { justification => 'GTK_JUSTIFY_RIGHT' } ] - ]); -$summary->set_left_margin($margin); -$summary->set_right_margin($margin); - add2notebook($notebook_global, "", create_scrolled_window(gtkset_size_request(my $main_page = Gtk2::HBox->new, 50, 50), - [ 'never', 'automatic' ] + [ 'never', 'automatic' ], ), ); @@ -668,11 +663,13 @@ foreach (@tree) { add2notebook($notebook_global, "", my $_w_ret = create_scrolled_window(gtkset_border_width($tbl, 5), - [ 'never', 'automatic' ], 'none' + [ 'never', 'automatic' ], ), ); # $w_ret->vscrollbar->set_size_request(19, undef); push @main_icons, $box; + + add2notebook($banner_notebook, "", Gtk2::Banner->new("title-back", "/usr/share/icons/large/drakconf.png", $text, $font)); } gtkadd($main_page, create_packtable({ col_spacings => $spacing, row_spacings => $spacing, homogeneous => 1, mcc => 1 }, group_by3(@main_icons))); @@ -706,7 +703,7 @@ $run_darea->signal_connect(expose_event => sub { gtkflush(); -$notebook_global->set_current_page(0); +set_page_raw(0); show_hide_previous(0); $notebook_global->signal_connect(switch_page => sub { my $tab_number = $_[2]; @@ -751,7 +748,10 @@ sub child_just_exited() { undef $emb_socket; } gtkset_mousecursor_normal(); - $notebook_global->show; + foreach my $notebook ($notebook_global, $banner_notebook) { + $notebook->show; + } + Glib::Source->remove($timeout) if $timeout; } @@ -823,7 +823,9 @@ sub compute_exec_string { $exec .= " --summary" if $option_values{expert_wizard} && $exec_ =~ /drakwizard/; my $embedded = $option_values{embedded} && $gtkplug != -1; # globally embedded and not "explicitely not embedded" if ($embedded) { - $notebook_global->hide; + foreach my $notebook ($notebook_global, $banner_notebook) { + $notebook->hide; + } create_hidden_socket(); $emb_frame->show; $emb_socket->realize; @@ -1034,11 +1036,18 @@ sub about_mdk_cc() { #------------------------------------------------------------- # mcc specific graphic functions: +sub set_page_raw { + my ($bool) = @_; + foreach my $notebook ($notebook_global, $banner_notebook) { + $notebook->set_current_page($bool); + } +} + sub set_page { my ($index) = @_; start_logdrake(); update_exp(); - $notebook_global->set_current_page($index); + set_page_raw($index); $still_not_in_a_section = 0; $help_on_context = $ctx[$index]; show_hide_previous($index); @@ -1101,14 +1110,14 @@ use ugtk2 qw(:helpers :wrappers); #use common; sub new { - my ($_class, $background, $icon, $text) = @_; + my ($_class, $background, $icon, $text, $font) = @_; my $hbox_spacing = 10; my $fixed = gtkput(gtksignal_connect(Gtk2::Fixed->new, "configure-event" => sub {}, ), gtkpack_(Gtk2::HBox->new, 0, my $img = gtkcreate_img($icon), - 0, 1, Gtk2::WrappedLabel->new($text), + 1, gtkmodify_font(gtkset_size_request(Gtk2::WrappedLabel->new($text), $h{WIDTH} - 100, 75), $font) ), ); |