… | |
… | |
1639 | my ($c, $w, $cs) = @$widget{qw(c_col req_w c_colspan)}; |
1639 | my ($c, $w, $cs) = @$widget{qw(c_col req_w c_colspan)}; |
1640 | |
1640 | |
1641 | my $sw = sum @w[$c .. $c + $cs - 1]; |
1641 | my $sw = sum @w[$c .. $c + $cs - 1]; |
1642 | |
1642 | |
1643 | if ($w > $sw) { |
1643 | if ($w > $sw) { |
1644 | $_ += ($w - $sw) / ($sw ? $sw / $_ : $cs) for @w[$c .. $c + $cs - 1]; |
1644 | $_ += ($w - $sw) / ($_ ? $sw / $_ : $cs) for @w[$c .. $c + $cs - 1]; |
1645 | } |
1645 | } |
1646 | } |
1646 | } |
1647 | |
1647 | |
1648 | # second pass, rows |
1648 | # second pass, rows |
1649 | for my $widget (sort { $a->{c_rowspan} <=> $b->{c_rowspan} } @children) { |
1649 | for my $widget (sort { $a->{c_rowspan} <=> $b->{c_rowspan} } @children) { |
1650 | my ($r, $h, $rs) = @$widget{qw(c_row req_h c_rowspan)}; |
1650 | my ($r, $h, $rs) = @$widget{qw(c_row req_h c_rowspan)}; |
1651 | |
1651 | |
1652 | my $sh = sum @h[$r .. $r + $rs - 1]; |
1652 | my $sh = sum @h[$r .. $r + $rs - 1]; |
1653 | |
1653 | |
1654 | if ($h > $sh) { |
1654 | if ($h > $sh) { |
1655 | $_ += ($h - $sh) / ($sh ? $sh / $_ : $rs) for @h[$r .. $r + $rs - 1]; |
1655 | $_ += ($h - $sh) / ($_ ? $sh / $_ : $rs) for @h[$r .. $r + $rs - 1]; |
1656 | } |
1656 | } |
1657 | } |
1657 | } |
1658 | |
1658 | |
1659 | (\@w, \@h) |
1659 | (\@w, \@h) |
1660 | } |
1660 | } |
… | |
… | |
2096 | can_hover => 1, |
2096 | can_hover => 1, |
2097 | can_focus => 1, |
2097 | can_focus => 1, |
2098 | valign => 0, |
2098 | valign => 0, |
2099 | can_events => 1, |
2099 | can_events => 1, |
2100 | ellipsise => 0, |
2100 | ellipsise => 0, |
|
|
2101 | padding_x => 4, |
|
|
2102 | padding_y => 2, |
2101 | #text => ... |
2103 | #text => ... |
2102 | #hidden => "*", |
2104 | #hidden => "*", |
2103 | @_ |
2105 | @_ |
2104 | ) |
2106 | ) |
2105 | } |
2107 | } |
… | |
… | |
2336 | |
2338 | |
2337 | our @ISA = DC::UI::EntryBase::; |
2339 | our @ISA = DC::UI::EntryBase::; |
2338 | |
2340 | |
2339 | use DC::OpenGL; |
2341 | use DC::OpenGL; |
2340 | |
2342 | |
|
|
2343 | sub new { |
|
|
2344 | my $class = shift; |
|
|
2345 | |
|
|
2346 | $class->SUPER::new ( |
|
|
2347 | padding_y => 4, |
|
|
2348 | |
|
|
2349 | @_ |
|
|
2350 | ) |
|
|
2351 | } |
|
|
2352 | |
2341 | sub move_cursor_ver { |
2353 | sub move_cursor_ver { |
2342 | my ($self, $dy) = @_; |
2354 | my ($self, $dy) = @_; |
2343 | |
2355 | |
2344 | my ($y, $x) = $self->{layout}->index_to_line_x ($self->{cursor}); |
2356 | my ($y, $x) = $self->{layout}->index_to_line_x ($self->{cursor}); |
2345 | |
2357 | |