--- deliantra/Deliantra-Client/DC/UI.pm 2006/05/27 20:46:54 1.243 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/05/27 21:06:09 1.244 @@ -255,6 +255,8 @@ sub set_invisible { my ($self) = @_; + return unless $self->{visible}; + # broken show/hide model delete $self->{root}; @@ -267,6 +269,8 @@ if $CFClient::UI::TOOLTIP->{owner} == $self; $self->focus_out; + + $self->emit (visibility_change => 0); } sub hide { @@ -488,8 +492,13 @@ Scalar::Util::weaken ($self->{parent} = $parent); - $self->{root} = $parent->{root}; - $self->{visible} = $parent->{visible} + 1; + if ($parent->{visible} || 1) { + $self->{root} = $parent->{root}; + $self->{visible} = $parent->{visible} + 1; + + $self->emit (visibility_change => 1) + unless $self->{parent}{visible}; + } # TODO: req_w _does_change after ->reconfigure $self->check_size @@ -531,6 +540,10 @@ || $self->$signal (@args); } +sub visibility_change { + #my ($self, $visible) = @_; +} + sub DESTROY { my ($self) = @_; @@ -3034,6 +3047,9 @@ $Y = $child->{req_y} > 0 ? $child->{req_y} : $h - $H - $child->{req_y} + 1 if exists $child->{req_y}; + $X = $self->{user_x} if exists $self->{user_x}; + $Y = $self->{user_y} if exists $self->{user_y}; + $X = List::Util::max 0, List::Util::min $w - $W, int $X + 0.5; $Y = List::Util::max 0, List::Util::min $h - $H, int $Y + 0.5;