… | |
… | |
704 | |
704 | |
705 | $child->set_parent ($self); |
705 | $child->set_parent ($self); |
706 | $self->{children}[$y][$x] = $child; |
706 | $self->{children}[$y][$x] = $child; |
707 | |
707 | |
708 | $self->{w} = $self->{h} = -1; |
708 | $self->{w} = $self->{h} = -1; |
|
|
709 | $self->update; |
|
|
710 | } |
|
|
711 | |
|
|
712 | # TODO: move to container class maybe? send childs a signal on removal? |
|
|
713 | sub clear { |
|
|
714 | my ($self) = @_; |
|
|
715 | |
|
|
716 | delete $self->{children}; |
709 | $self->update; |
717 | $self->update; |
710 | } |
718 | } |
711 | |
719 | |
712 | sub get_wh { |
720 | sub get_wh { |
713 | my ($self) = @_; |
721 | my ($self) = @_; |
… | |
… | |
1960 | |
1968 | |
1961 | # TODO: use animation |
1969 | # TODO: use animation |
1962 | if ($self->{state} = !$self->{state}) { |
1970 | if ($self->{state} = !$self->{state}) { |
1963 | $CFClient::UI::ROOT->add ($self->{other}); |
1971 | $CFClient::UI::ROOT->add ($self->{other}); |
1964 | $self->{other}->move ($self->coord2global (0, $self->{h})); |
1972 | $self->{other}->move ($self->coord2global (0, $self->{h})); |
|
|
1973 | $self->emit ("open"); |
1965 | } else { |
1974 | } else { |
1966 | $CFClient::UI::ROOT->remove ($self->{other}); |
1975 | $CFClient::UI::ROOT->remove ($self->{other}); |
|
|
1976 | $self->emit ("close"); |
1967 | } |
1977 | } |
|
|
1978 | |
|
|
1979 | $self->emit (changed => $self->{state}); |
1968 | } |
1980 | } |
1969 | |
1981 | |
1970 | ############################################################################# |
1982 | ############################################################################# |
1971 | |
1983 | |
1972 | package CFClient::UI::Root; |
1984 | package CFClient::UI::Root; |