ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/UI.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.281 by root, Mon Jun 5 01:59:59 2006 UTC vs.
Revision 1.282 by root, Mon Jun 5 02:25:10 2006 UTC

1538 1538
1539 delete $self->{texture}; 1539 delete $self->{texture};
1540 $self->SUPER::update; 1540 $self->SUPER::update;
1541} 1541}
1542 1542
1543sub realloc {
1544 my ($self) = @_;
1545
1546 delete $self->{ox};
1547 delete $self->{req_h};
1548 $self->SUPER::realloc;
1549}
1550
1543sub set_text { 1551sub set_text {
1544 my ($self, $text) = @_; 1552 my ($self, $text) = @_;
1545 1553
1546 return if $self->{text} eq "T$text"; 1554 return if $self->{text} eq "T$text";
1547 $self->{text} = "T$text"; 1555 $self->{text} = "T$text";
1569} 1577}
1570 1578
1571sub size_request { 1579sub size_request {
1572 my ($self) = @_; 1580 my ($self) = @_;
1573 1581
1582 if (exists $self->{req_h}) {
1583 @$self{qw(req_w req_h)}
1584 } else {
1574 $self->{layout}->set_font ($self->{font}) if $self->{font}; 1585 $self->{layout}->set_font ($self->{font}) if $self->{font};
1575 $self->{layout}->set_width ($self->{max_w} || -1); 1586 $self->{layout}->set_width ($self->{max_w} || -1);
1576 $self->{layout}->set_ellipsise ($self->{ellipsise}); 1587 $self->{layout}->set_ellipsise ($self->{ellipsise});
1577 $self->{layout}->set_single_paragraph_mode ($self->{ellipsise}); 1588 $self->{layout}->set_single_paragraph_mode ($self->{ellipsise});
1578 $self->{layout}->set_height ($self->{fontsize} * $::FONTSIZE); 1589 $self->{layout}->set_height ($self->{fontsize} * $::FONTSIZE);
1579 1590
1580 my ($w, $h) = $self->{layout}->size; 1591 my ($w, $h) = $self->{layout}->size;
1581 1592
1582 if (exists $self->{template}) { 1593 if (exists $self->{template}) {
1583 $self->{template}->set_font ($self->{font}) if $self->{font}; 1594 $self->{template}->set_font ($self->{font}) if $self->{font};
1584 $self->{template}->set_height ($self->{fontsize} * $::FONTSIZE); 1595 $self->{template}->set_height ($self->{fontsize} * $::FONTSIZE);
1585 1596
1586 my ($w2, $h2) = $self->{template}->size; 1597 my ($w2, $h2) = $self->{template}->size;
1587 1598
1588 $w = List::Util::max $w, $w2; 1599 $w = List::Util::max $w, $w2;
1589 $h = List::Util::max $h, $h2; 1600 $h = List::Util::max $h, $h2;
1590 } 1601 }
1591 1602
1592 ($w, $h) 1603 ($w, $h)
1604 }
1593} 1605}
1594 1606
1595sub size_allocate { 1607sub size_allocate {
1596 my ($self, $w, $h) = @_; 1608 my ($self, $w, $h) = @_;
1597 1609

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines