--- deliantra/Deliantra-Client/DC/UI.pm 2006/06/23 20:28:20 1.310 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/06/23 22:35:16 1.311 @@ -337,6 +337,10 @@ Carp::confess "size_request is abstract"; } +sub baseline_shift { + 0 +} + sub configure { my ($self, $x, $y, $w, $h) = @_; @@ -1633,6 +1637,10 @@ @{ $self->{size_req} } } +sub baseline_shift { + $_[0]{layout}->descent +} + sub invoke_size_allocate { my ($self, $w, $h) = @_; @@ -2578,12 +2586,12 @@ sub invoke_size_allocate { my ($self, $w, $h) = @_; - my (undef, undef, @other) = @{ $self->{children} }; + my ($empty, $slider, @other) = @{ $self->{children} }; $_->configure (@$_{qw(x y req_w req_h)}) for @other; $self->{layout}->set_font ($self->{font}) if $self->{font}; $self->{layout}->set_height ($self->{fontsize} * $::FONTSIZE); - $self->{layout}->set_width ($self->{children}[0]{w}); + $self->{layout}->set_width ($empty->{w}); $self->{layout}->set_indent ($self->{fontsize} * $::FONTSIZE * $self->{indent}); $self->reflow; @@ -2597,11 +2605,17 @@ my $layout = $self->{layout}; $layout->set_font ($self->{font}) if $self->{font}; + $layout->set_foreground (@{$para->{fg}}); $layout->set_height ($self->{fontsize} * $::FONTSIZE); $layout->set_width ($self->{children}[0]{w} - $para->{indent}); $layout->set_indent ($self->{fontsize} * $::FONTSIZE * $self->{indent}); $layout->set_markup ($para->{markup}); - $layout->set_shapes (map +($_->{req_w}, $_->{req_h}), @{$para->{widget}}); + + $layout->set_shapes ( + map + +(0, $_->baseline_shift +$_->{padding_y} - $_->{h}, $_->{w}, $_->{h}), + @{$para->{widget}} + ); $layout } @@ -2679,8 +2693,8 @@ my $layout = $self->get_layout ($para); my ($w, $h) = $layout->size; - $para->{w} = $w + $para->{indent}; - $para->{h} = $h; + $para->{w} = $w + $para->{indent}; + $para->{h} = $h; $para->{wrapped} = $layout->has_wrapped; }