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.239 by root, Thu May 25 22:29:57 2006 UTC vs.
Revision 1.241 by root, Fri May 26 20:50:35 2006 UTC

5 5
6use Scalar::Util (); 6use Scalar::Util ();
7use List::Util (); 7use List::Util ();
8 8
9use CFClient; 9use CFClient;
10use CFClient::Texture;
10 11
11our ($FOCUS, $HOVER, $GRAB); # various widgets 12our ($FOCUS, $HOVER, $GRAB); # various widgets
12 13
13our $ROOT; 14our $ROOT;
14our $TOOLTIP; 15our $TOOLTIP;
228sub set_invisible { 229sub set_invisible {
229 my ($self) = @_; 230 my ($self) = @_;
230 231
231 # broken show/hide model 232 # broken show/hide model
232 233
234 delete $self->{root};
233 delete $self->{visible}; 235 delete $self->{visible};
234 236
235 undef $GRAB if $GRAB == $self; 237 undef $GRAB if $GRAB == $self;
236 undef $HOVER if $HOVER == $self; 238 undef $HOVER if $HOVER == $self;
237 239
459 my ($self, $parent) = @_; 461 my ($self, $parent) = @_;
460 462
461 Scalar::Util::weaken ($self->{parent} = $parent); 463 Scalar::Util::weaken ($self->{parent} = $parent);
462 464
463 $self->{root} = $parent->{root}; 465 $self->{root} = $parent->{root};
464 $self->{visible} = $parent->{visible}; 466 $self->{visible} = $parent->{visible} + 1;
465 467
466 # TODO: req_w _does_change after ->reconfigure 468 # TODO: req_w _does_change after ->reconfigure
467 $self->check_size 469 $self->check_size
468 unless exists $self->{req_w}; 470 unless exists $self->{req_w};
469 471
2963 2965
2964sub new { 2966sub new {
2965 my $class = shift; 2967 my $class = shift;
2966 2968
2967 $class->SUPER::new ( 2969 $class->SUPER::new (
2970 visible => 1,
2968 @_, 2971 @_,
2969 ) 2972 )
2970} 2973}
2971 2974
2972sub configure { 2975sub configure {
3030sub add { 3033sub add {
3031 my ($self, @children) = @_; 3034 my ($self, @children) = @_;
3032 3035
3033 for (my @widgets = @children; my $w = pop @widgets; ) { 3036 for (my @widgets = @children; my $w = pop @widgets; ) {
3034 push @widgets, $w->children; 3037 push @widgets, $w->children;
3035 $w->{root} = $self; 3038 $w->{root} = $self;
3036 $w->{visible} = 1; 3039 $w->{visible} = $self->{visible} + 1;
3037 } 3040 }
3038 3041
3039 for my $child (@children) { 3042 for my $child (@children) {
3040 $child->{is_toplevel} = 1; 3043 $child->{is_toplevel} = 1;
3041 3044

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines