diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2004-02-13 11:21:16 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2004-02-13 11:21:16 +0000 |
commit | 0363c52b9cea4a4562f15ea5a92f646e8b33182f (patch) | |
tree | 678b76866ab6aff14842a09cc6c98e0729fe202e | |
parent | 671abc3808c06a37b59e75ba91d9e68127f935d6 (diff) | |
download | control-center-0363c52b9cea4a4562f15ea5a92f646e8b33182f.tar control-center-0363c52b9cea4a4562f15ea5a92f646e8b33182f.tar.gz control-center-0363c52b9cea4a4562f15ea5a92f646e8b33182f.tar.bz2 control-center-0363c52b9cea4a4562f15ea5a92f646e8b33182f.tar.xz control-center-0363c52b9cea4a4562f15ea5a92f646e8b33182f.zip |
- move Gtk2::Banner into ugtk2
- drop useless font argument
-rwxr-xr-x | control-center | 46 |
1 files changed, 2 insertions, 44 deletions
diff --git a/control-center b/control-center index 1c6f214c..d9a3fcd8 100755 --- a/control-center +++ b/control-center @@ -560,9 +560,8 @@ foreach my $notebook ($notebook_global, $banner_notebook) { # banner : -my $font = N("_banner font:\nSans 15"); add2notebook($banner_notebook, "", Gtk2::Banner->new("/usr/share/icons/large/drakconf.png", - N("Welcome to the Mandrake Control Center"), $font)); + N("Welcome to the Mandrake Control Center"))); # main page (summary) : @@ -641,7 +640,7 @@ foreach (@tree) { # $w_ret->vscrollbar->set_size_request(19, undef); push @main_icons, $box; - add2notebook($banner_notebook, "", Gtk2::Banner->new($icon, $text, $font)); + add2notebook($banner_notebook, "", Gtk2::Banner->new($icon, $text)); } gtkadd($main_page, @@ -1087,47 +1086,6 @@ sub scale { } - -package Gtk2::Banner; - -use ugtk2 qw(:helpers :wrappers); - -sub set_pixmap { - my ($darea) = @_; - return if !$darea->realized; - my $window = $darea->window; - my $pixmap = $darea->{back_pixmap} ||= Gtk2::Gdk::Pixmap->new($window, 1, 2, $window->get_depth); - - my $style = $darea->get_style; - $pixmap->draw_points($style->bg_gc('normal'), 0, 0); - $pixmap->draw_points($style->base_gc('normal'), 0, 1); - $darea->window->set_back_pixmap($pixmap); - - $darea->{layout} = $darea->create_pango_layout($darea->{text}); - $darea->signal_connect(expose_event => sub { - my $height = $darea->{icon}->get_height; - $darea->{icon}->render_to_drawable($window, $darea->style->bg_gc('normal'), - 0, 0, 10, 10, -1, -1, 'none', 0, 0); - $darea->window->draw_layout($style->text_gc('normal'), $height + 20, 25, $darea->{layout}); - }); -} - - -sub new { - my ($_class, $icon, $text, $font) = @_; - - my $darea = Gtk2::DrawingArea->new; - $darea->set_size_request(-1, 100); - $darea->modify_font(Gtk2::Pango::FontDescription->from_string(common::N("Sans 14"))); - $darea->{icon} = ugtk2::gtkcreate_pixbuf($icon); - $darea->{text} = $text; - - $darea->signal_connect(realize => \&set_pixmap); - $darea->signal_connect("style-set" => \&set_pixmap); - - return $darea; -} - package Gtk2::WebIcon; use ugtk2 qw(:helpers :wrappers); |