--- deliantra/Deliantra-Client/DC/UI.pm 2006/05/28 22:24:24 1.251 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/05/28 23:21:28 1.252 @@ -49,7 +49,6 @@ $tip = $tip->($widget) if CODE:: eq ref $tip; $TOOLTIP->set_tooltip_from ($widget); - $TOOLTIP->show; my ($x, $y) = $widget->coord2global ($widget->{w}, 0); @@ -57,7 +56,7 @@ if $x + $TOOLTIP->{w} > $::WIDTH; $TOOLTIP->move ($x, $y); - $TOOLTIP->realloc; + $TOOLTIP->show; } return; @@ -259,7 +258,7 @@ $self->emit (visibility_change => 1); - $self->realloc unless exists $self->{req_w}; + $self->realloc if !exists $self->{req_w}; $_->set_visible for $self->children; } @@ -471,8 +470,6 @@ Scalar::Util::weaken ($self->{parent} = $parent); $self->set_visible if $parent->{visible}; - - $self->realloc; } sub connect { @@ -501,12 +498,14 @@ sub realloc { my ($self) = @_; - return unless $self->{visible}; - - return if $self->{root}{realloc}{$self}; + if ($self->{visible}) { + return if $self->{root}{realloc}{$self}; - $self->{root}{realloc}{$self} = $self; - $self->{root}->update; + $self->{root}{realloc}{$self} = $self; + $self->{root}->update; + } else { + delete $self->{req_w}; + } } sub update { @@ -1471,6 +1470,7 @@ $self->{layout}->set_text ($text); $self->realloc; + $self->update; } sub set_markup { @@ -1485,6 +1485,7 @@ $self->{layout}->set_markup ($markup); $self->realloc; + $self->update; } sub size_request { @@ -2666,6 +2667,7 @@ glEnd; glTranslate 2 - 0.375, 2 - 0.375; + $self->SUPER::_draw; } @@ -3125,7 +3127,7 @@ $widget->{req_w} = $w; $widget->{req_h} = $h; - $self->{size_alloc}{$widget} = [$widget, $widget->{w}, $widget->{h}]; + $self->{size_alloc}{$widget} = [$widget, $widget->{w} || $w, $widget->{h} || $h]; push @queue, $widget->{parent} if $widget->{parent}; @@ -3142,9 +3144,12 @@ $w = 0 if $w < 0; $h = 0 if $h < 0; + my $changed = $widget->{w} != $w || $widget->{h} != $h; + $widget->{w} = $w; $widget->{h} = $h; - $widget->emit (size_allocate => $w, $h, 1); + + $widget->emit (size_allocate => $w, $h, $changed); } }