diff options
-rwxr-xr-x | clock.pl | 21 | ||||
-rwxr-xr-x | control-center | 6 | ||||
-rw-r--r-- | pixmaps/default/mcc-left-back-middle.png | bin | 4658 -> 4629 bytes | |||
-rw-r--r-- | pixmaps/default/mcc-left-back-top.png | bin | 4983 -> 4955 bytes | |||
-rw-r--r-- | pixmaps/default/mcc-left-back.png | bin | 4602 -> 4570 bytes |
5 files changed, 13 insertions, 14 deletions
@@ -47,7 +47,7 @@ $button_time->signal_connect(clicked => sub { } }); -my $drawing_area = Gtk2::DrawingArea->new; +my $drawing_area; my $adj_h = Gtk2::Adjustment->new(0.0, 0.0, 23.0, 1.0, 5.0, 0.0); my $adj_m = Gtk2::Adjustment->new(0.0, 0.0, 59.0, 1.0, 5.0, 0.0); @@ -65,7 +65,7 @@ $my_win->{window}->add(gtkpack_(Gtk2::VBox->new(0,0), ), 1, gtkpack_(Gtk2::VBox->new(0,0), 0, gtkpack_(Gtk2::HBox->new(0,0), - 0, $drawing_area + 0, $drawing_area = gtkset_size_request(Gtk2::DrawingArea->new, 300, 300), ), 0, gtkpack_(Gtk2::HBox->new(1,0), 0, Gtk2::HBox->new(1,0), @@ -102,10 +102,10 @@ $my_win->{window}->add(gtkpack_(Gtk2::VBox->new(0,0), ); my $pressed; -$drawing_area->set_size_request(300,300); $drawing_area->set_events([ 'button_press_mask', 'button_release_mask', "pointer_motion_mask" ]); $drawing_area->signal_connect(expose_event => \&expose_event); -$drawing_area->signal_connect(realize => \&configure_event); +$drawing_area->signal_connect(realize => sub { print "REALIZE\n" }); +$drawing_area->signal_connect(configure => sub { print "CONFIGURE\n" }); $drawing_area->signal_connect(button_press_event => sub { $pressed = 1 }); $drawing_area->signal_connect(button_release_event => sub { $first = 1; $pressed = 0 }); $drawing_area->signal_connect(motion_notify_event => \&motion_event); @@ -201,13 +201,12 @@ sub determine_radian { sub expose_event { my ($widget, $event) = @_; my ($x, $y, $width, $height) = $event->area->values; + unless ($pixmap) { + my $window = $widget->window; + $pixmap = Gtk2::Gdk::Pixmap->new($window, $width, $height, $window->get_depth); + } $widget->window->draw_drawable($widget->style->fg_gc('normal'), $pixmap, $x, $y, $x, $y, $width, $height); -} - -sub configure_event { - my ($widget) = @_; - my $window = $widget->window; - $pixmap = Gtk2::Gdk::Pixmap->new($window, $widget->allocation->width, $widget->allocation->height, $window->get_depth); + 0; } sub rad_to_time { @@ -217,7 +216,7 @@ sub rad_to_time { } sub time_to_rad { - my ($sec, $min, $hour, undef, undef, undef, undef, undef, undef) = @_; + my ($sec, $min, $hour) = @_; $dRadians_hour = $hour % 12 * $PI / 6; $dRadians_min = $min * $PI / 30; $dRadians_sec = $sec * $PI / 30; diff --git a/control-center b/control-center index b1f4cf30..5d32dc30 100755 --- a/control-center +++ b/control-center @@ -485,7 +485,7 @@ foreach (@tree) { $darea_left->modify_font($fonts[$curr_state]); - (undef, undef, $lines, $widths, $heights) = get_text_coord($text, $darea_left, $d_width-$left_txt_offset-$right_text_offset, $d_height, 0, 0, 0, 0); + ($lines, $widths, $heights) = (get_text_coord($text, $darea_left, $d_width-$left_txt_offset-$right_text_offset, $d_height, 0, 0, 0, 0))[2..4]; my $offset = (listlength(@$lines) > 1 ? $heights->[0]/2 : 0) + 3; # multi line texts are offsetted; but +3 is pure black magic mapn { $dbl_area_left[$curr_state]->draw_layout($darea_left->style->black_gc, $_[1]+$left_txt_offset, $_[2]-$offset, $darea_left->create_pango_layout($_[0])); @@ -595,7 +595,7 @@ gtkflush(); $notebook_global->set_current_page(0); $notebook_global->signal_connect(switch_page => sub { - my (undef, undef, $tab_number) = @_; + my $tab_number = $_[2]; return unless $tab_number > 0; }); @@ -943,7 +943,7 @@ sub render_alpha { sub render_shiner { my ($pixbuf, $shine_value) = @_; - my (undef, undef, $new_pixbuf) = new_pixbuf($pixbuf); + my $new_pixbuf = (new_pixbuf($pixbuf))[2]; $pixbuf->saturate_and_pixelate($new_pixbuf, $shine_value, 0); $new_pixbuf; } diff --git a/pixmaps/default/mcc-left-back-middle.png b/pixmaps/default/mcc-left-back-middle.png Binary files differindex 5436b973..abf45513 100644 --- a/pixmaps/default/mcc-left-back-middle.png +++ b/pixmaps/default/mcc-left-back-middle.png diff --git a/pixmaps/default/mcc-left-back-top.png b/pixmaps/default/mcc-left-back-top.png Binary files differindex 71f93c64..f782b51e 100644 --- a/pixmaps/default/mcc-left-back-top.png +++ b/pixmaps/default/mcc-left-back-top.png diff --git a/pixmaps/default/mcc-left-back.png b/pixmaps/default/mcc-left-back.png Binary files differindex 0752278a..a0f7f07d 100644 --- a/pixmaps/default/mcc-left-back.png +++ b/pixmaps/default/mcc-left-back.png |