ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/UI.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.204 by root, Sun May 14 22:24:16 2006 UTC vs.
Revision 1.205 by root, Mon May 15 00:15:08 2006 UTC

375 glVertex $self->{w}, 0; 375 glVertex $self->{w}, 0;
376 glVertex $self->{w}, $self->{h}; 376 glVertex $self->{w}, $self->{h};
377 glVertex 0 , $self->{h}; 377 glVertex 0 , $self->{h};
378 glEnd; 378 glEnd;
379 glPopMatrix; 379 glPopMatrix;
380 CFClient::UI::Label->new (w => $self->{w}, h => $self->{h}, text => $self, fontsize => 0)->_draw; 380 #CFClient::UI::Label->new (w => $self->{w}, h => $self->{h}, text => $self, fontsize => 0)->_draw;
381 } 381 }
382} 382}
383 383
384sub _draw { 384sub _draw {
385 my ($self) = @_; 385 my ($self) = @_;
2689 ? "<b>$item->{count} ×</b> $item->{text}" 2689 ? "<b>$item->{count} ×</b> $item->{text}"
2690 : $item->{text}; 2690 : $item->{text};
2691 2691
2692 for ($short) { 2692 for ($short) {
2693 s/^\s+//; 2693 s/^\s+//;
2694 s/\012.*/…/s; 2694 s/\s+/ /g;
2695 my $len = int 40 / $item->{fontsize}; 2695 my $len = int 40 / $item->{fontsize};
2696 substr $_, $len, length, "…" if $len < length; 2696 substr $_, $len, length, "…" if $len < length;
2697 } 2697 }
2698 2698
2699 new CFClient::UI::Label 2699 new CFClient::UI::Label
2700 markup => $short, 2700 markup => $short,
2701 tooltip => $item->{tooltip}, 2701 tooltip => $item->{tooltip},
2702 tooltip_font => $::FONT_PROP, 2702 tooltip_font => $::FONT_PROP,
2703 tooltip_width => 0.67, 2703 tooltip_width => 0.67,
2704 fontsize => $item->{fontsize}, 2704 fontsize => $item->{fontsize},
2705 color => $item->{color}, 2705 fg => $item->{fg},
2706 can_events => 1, 2706 can_events => 1,
2707 can_hover => 1 2707 can_hover => 1
2708 }; 2708 };
2709 } 2709 }
2710 2710
2737 id => ++$self->{id}, 2737 id => ++$self->{id},
2738 text => $text, 2738 text => $text,
2739 timeout => $timeout, 2739 timeout => $timeout,
2740 tooltip => $text, 2740 tooltip => $text,
2741 fontsize => 0.8, 2741 fontsize => 0.8,
2742 color => [0.8, 0.8, 0.8, 0.8], 2742 fg => [0.8, 0.8, 0.8, 0.8],
2743 pri => 0, 2743 pri => 0,
2744 count => 1, 2744 count => 1,
2745 %arg, 2745 %arg,
2746 }; 2746 };
2747 } 2747 }
2795 if $old_w && $old_h && ($old_w != $w || $old_h != $h); 2795 if $old_w && $old_h && ($old_w != $w || $old_h != $h);
2796 2796
2797 for my $child ($self->children) { 2797 for my $child ($self->children) {
2798 my ($X, $Y, $W, $H) = @$child{qw(x y req_w req_h)}; 2798 my ($X, $Y, $W, $H) = @$child{qw(x y req_w req_h)};
2799 2799
2800 $X = $child->{req_x} > 0 ? $child->{req_x} : $w - $W - $child->{req_x} + 1
2801 if exists $child->{req_x};
2802
2803 $Y = $child->{req_y} > 0 ? $child->{req_y} : $h - $H - $child->{req_y} + 1
2804 if exists $child->{req_y};
2805
2800 $X = List::Util::max 0, List::Util::min $w - $W, $X; 2806 $X = List::Util::max 0, List::Util::min $w - $W, int $X + 0.5;
2801 $Y = List::Util::max 0, List::Util::min $h - $H, $Y; 2807 $Y = List::Util::max 0, List::Util::min $h - $H, int $Y + 0.5;
2808
2802 $child->configure ($X, $Y, $W, $H); 2809 $child->configure ($X, $Y, $W, $H);
2803 } 2810 }
2804} 2811}
2805 2812
2806sub coord2local { 2813sub coord2local {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines