--- deliantra/Deliantra-Client/DC/UI.pm 2006/05/30 01:42:16 1.256 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/05/30 02:22:02 1.257 @@ -1028,7 +1028,6 @@ bg => [1, 1, 1, 1], border_bg => [1, 1, 1, 1], border => 0.6, - is_toplevel => 1, can_events => 1, @_ ); @@ -2166,8 +2165,8 @@ bg => [0, 0, 0, 0.2], active_bg => [1, 1, 1, 0.5], range => [0, 0, 100, 10, 0], - req_w => $::WIDTH / 80, - req_h => $::WIDTH / 80, + min_w => $::WIDTH / 80, + min_h => $::WIDTH / 80, vertical => 0, can_hover => 1, inner_pad => 0.02, @@ -2217,10 +2216,7 @@ sub size_request { my ($self) = @_; - my $w = $self->{req_w}; - my $h = $self->{req_h}; - - $self->{vertical} ? ($h, $w) : ($w, $h) + ($self->{req_w}, $self->{req_h}) } sub button_down { @@ -3143,14 +3139,15 @@ $widget->{visible} or last; # do not resize invisible widgets - my ($w, $h) = exists $widget->{force_w} && exists $widget->{force_h} - ? @$widget{qw(force_w force_h)} - : $widget->size_request; + my ($w, $h) = $widget->size_request; my $min_size = $widget->{is_toplevel} ? 16 : 0; - $w = $min_size if $w < $min_size; - $h = $min_size if $h < $min_size; + $w = List::Util::max $widget->{min_w} || $widget->{is_toplevel} * 16, $w; + $h = List::Util::max $widget->{min_h} || $widget->{is_toplevel} * 16, $h; + + $w = $widget->{force_w} if exists $widget->{force_w}; + $h = $widget->{force_h} if exists $widget->{force_h}; $widget->{req_w} = $w; $widget->{req_h} = $h; @@ -3158,7 +3155,7 @@ $self->{size_alloc}{$widget} = [$widget, undef, undef]; push @queue, $widget->{parent} - if $widget->{parent}; + if ($self->{w} != $w || $self->{h} != $h) && $widget->{parent}; } }