summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2002-02-15 21:51:56 +0000
committerdamien <damien@mandriva.com>2002-02-15 21:51:56 +0000
commit6813f2da0cb7268d8dcdc16a4915d62a71068891 (patch)
tree4a62322d34a00834f2ec99b079d6f3ebde542a09
parent9245f500fba61582d928180192530459ade21811 (diff)
downloaddrakx-6813f2da0cb7268d8dcdc16a4915d62a71068891.tar
drakx-6813f2da0cb7268d8dcdc16a4915d62a71068891.tar.gz
drakx-6813f2da0cb7268d8dcdc16a4915d62a71068891.tar.bz2
drakx-6813f2da0cb7268d8dcdc16a4915d62a71068891.tar.xz
drakx-6813f2da0cb7268d8dcdc16a4915d62a71068891.zip
highlight in gtk icon widget
-rw-r--r--perl-install/my_gtk.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index 9d3636d03..6c5d54791 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -509,6 +509,7 @@ sub gtkicons_labels_widget {
my $dbl_area;
my $darea = new Gtk::DrawingArea;
my ($icon, undef) = gtkcreate_png($_->[1]);
+ my ($icon_h, undef) = gtkcreate_png("$_->[1]_highlight");
$darea->{state} = 0;
$darea->signal_connect(expose_event => sub {
my ($dx, $dy) = ($darea->allocation->[2], $darea->allocation->[3]);
@@ -522,7 +523,7 @@ sub gtkicons_labels_widget {
$dbl_area->{state} = $darea->{state};
fill_tiled($darea, $dbl_area, $background, $x_back2, $y_back2, $dx, $dy);
$dbl_area->draw_pixmap($darea->style->bg_gc('normal'),
- $icon, 0, 0, ($dx - $icon_width)/2, 0, $icon_width, $icon_height);
+ $darea->{state} ? $icon_h : $icon, 0, 0, ($dx - $icon_width)/2, 0, $icon_width, $icon_height);
$dbl_area->draw_pixmap($darea->style->bg_gc('normal'),
$pix, 0, 0, ($dx - $width)/2, $y_round, $width, $height);
# $dbl_area->draw_rectangle($darea->style->black_gc, 0,
@@ -549,6 +550,8 @@ sub gtkicons_labels_widget {
});
my $label_exec = $_->[0];
$darea->signal_connect( button_release_event => sub {
+ $darea->{state} = 0;
+ $darea->draw(undef);
$exec_func->($exec_hash->{$label_exec});
# $exec_hash->{$label_exec}{function}->($exec_hash->{$label_exec}{arg});
});