diff options
-rwxr-xr-x | userdrake | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -260,8 +260,9 @@ sub GetFaceIcon { ); my $set = sub { my ($icon) = @_; - gtkdestroy($us->{o}{icon}); my $f = $icon =~ m,^/, ? $icon : any::face2png($icon); + $us->{o}{iconval} = $icon; + gtkdestroy($us->{o}{icon}); $us->{o}{icon} = -e $f ? gtkcreate_img($f) : Gtk2::Label->new("No Icon"); $bt->add($us->{o}{icon}); $us->{o}{icon}->show; @@ -270,7 +271,7 @@ sub GetFaceIcon { my $current_md5 = GetFileMd5($user_icon); eval { $i = find_index { GetFileMd5(any::face2png($_)) =~ /$current_md5/ } @icones }; if (!$@) { #- current icon found in @icones, select it - $current_icon = any::face2png($icones[$i]); + $current_icon = $icones[$i]; } else { #- add and select current icon in @icones push @icones, $user_icon; $current_icon = $user_icon; @@ -278,9 +279,9 @@ sub GetFaceIcon { } } else { #- no icon yet, select a random one - $current_icon = any::face2png($icones[$i = rand(@icones)]); + $current_icon = $icones[$i = rand(@icones)]; } - $set->($us->{o}{iconval} = $current_icon); + $set->($current_icon); my $leave = 0; $bt->signal_connect(enter => sub { $leave = 0 }); $bt->signal_connect(leave => sub { $leave = 1 }); @@ -291,8 +292,8 @@ sub GetFaceIcon { } else { $i = defined $icones[$i-1] ? $i-1 : @icones-1; } - $set->($us->{o}{iconval} = $icones[$i]); - }); + $set->($icones[$i]); + }); $hb; } sub AddUser { |