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.437 by root, Wed Aug 22 22:36:26 2007 UTC vs.
Revision 1.439 by root, Sun Sep 16 13:04:36 2007 UTC

269 $self->emit ("destroy"); 269 $self->emit ("destroy");
270 %$self = (); 270 %$self = ();
271} 271}
272 272
273sub TO_JSON { 273sub TO_JSON {
274 { __w_ => $_[0]{s_id} } 274 { "\fw" => $_[0]{s_id} }
275} 275}
276 276
277sub show { 277sub show {
278 my ($self) = @_; 278 my ($self) = @_;
279 279
358 358
359 $self->{force_w} = $w; 359 $self->{force_w} = $w;
360 $self->{force_h} = $h; 360 $self->{force_h} = $h;
361 361
362 $self->realloc; 362 $self->realloc;
363}
364
365# travsle the widget chain up to find the maximum "physical" size constraints
366sub get_max_wh {
367 my ($self) = @_;
368
369 return ($self->{alloc_w}, $self->{alloc_h})
370 if $self->{alloc_w} && !$self->{root}{realloc}{$self+0};
371
372 return $self->{parent}->get_max_wh
373 if $self->{parent};
374
375 ($::WIDTH, $::HEIGHT)
363} 376}
364 377
365sub size_request { 378sub size_request {
366 require Carp; 379 require Carp;
367 Carp::confess "size_request is abstract"; 380 Carp::confess "size_request is abstract";
817 830
818 1 831 1
819} 832}
820 833
821############################################################################# 834#############################################################################
822
823# back-buffered drawing area 835# back-buffered drawing area
824 836
825package CFPlus::UI::Window; 837package CFPlus::UI::Window;
826 838
827our @ISA = CFPlus::UI::Bin::; 839our @ISA = CFPlus::UI::Bin::;
1942 1954
1943sub size_request { 1955sub size_request {
1944 my ($self) = @_; 1956 my ($self) = @_;
1945 1957
1946 $self->{size_req} ||= do { 1958 $self->{size_req} ||= do {
1959 my ($max_w, $max_h) = $self->get_max_wh;
1960
1947 $self->{layout}->set_font ($self->{font}) if $self->{font}; 1961 $self->{layout}->set_font ($self->{font}) if $self->{font};
1948 $self->{layout}->set_width ($self->{max_w} || -1); 1962 $self->{layout}->set_width ($self->{max_w} || $max_w || -1);
1949 $self->{layout}->set_ellipsise ($self->{ellipsise}); 1963 $self->{layout}->set_ellipsise ($self->{ellipsise});
1950 $self->{layout}->set_single_paragraph_mode ($self->{ellipsise}); 1964 $self->{layout}->set_single_paragraph_mode ($self->{ellipsise});
1951 $self->{layout}->set_height ($self->{fontsize} * $::FONTSIZE); 1965 $self->{layout}->set_height ($self->{fontsize} * $::FONTSIZE);
1952 1966
1953 my ($w, $h) = $self->{layout}->size; 1967 my ($w, $h) = $self->{layout}->size;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines