--- deliantra/Deliantra-Client/DC/UI.pm 2006/06/26 21:59:04 1.314 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/07/02 18:52:05 1.317 @@ -425,10 +425,9 @@ return if $FOCUS == $self; return unless $self->{can_focus}; - my $focus = $FOCUS; $FOCUS = $self; + $FOCUS = $self; - $focus->update if $focus; - $FOCUS->update; + $self->update; 0 } @@ -438,9 +437,9 @@ return unless $FOCUS == $self; - my $focus = $FOCUS; undef $FOCUS; + undef $FOCUS; - $focus->update if $focus; #? + $self->update; $::MAPWIDGET->grab_focus #d# focus mapwidget if no other widget has focus unless $FOCUS; @@ -451,6 +450,7 @@ sub grab_focus { my ($self) = @_; + $FOCUS->emit ("focus_out") if $FOCUS; $self->emit ("focus_in"); } @@ -1098,7 +1098,7 @@ $self->{close_button} = new CFClient::UI::ImageButton path => 'x1_close.png', - on_activate => sub { $self->hide }; + on_activate => sub { $self->emit ("delete") }; $self->CFClient::UI::Container::add ($self->{close_button}); } @@ -1157,6 +1157,14 @@ 1 } +sub invoke_delete { + my ($self) = @_; + + $self->hide; + + 1 +} + sub invoke_button_down { my ($self, $ev, $x, $y) = @_; @@ -1656,6 +1664,7 @@ my ($self, $fontsize) = @_; $self->{fontsize} = $fontsize; + delete $self->{size_req}; delete $self->{texture}; $self->realloc; @@ -2248,6 +2257,9 @@ my $h1 = $self->{h} * (1 - $ycut1); my $h2 = $self->{h} * (1 - $ycut2); + my $h3 = $self->{h}; + + $_ = $_ * (284-4)/288 + 4/288 for ($h1, $h2, $h3); glEnable GL_BLEND; glBlendFuncSeparate GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, @@ -2276,8 +2288,8 @@ glBindTexture GL_TEXTURE_2D, $t3->{name}; glBegin GL_QUADS; glTexCoord 0 , $t3->{t} * (1 - $ycut2); glVertex 0 , $h2; - glTexCoord 0 , $t3->{t}; glVertex 0 , $self->{h}; - glTexCoord $t3->{s}, $t3->{t}; glVertex $w, $self->{h}; + glTexCoord 0 , $t3->{t}; glVertex 0 , $h3; + glTexCoord $t3->{s}, $t3->{t}; glVertex $w, $h3; glTexCoord $t3->{s}, $t3->{t} * (1 - $ycut2); glVertex $w, $h2; glEnd; } @@ -3412,7 +3424,9 @@ }; } - $self->reorder; + $ROOT->on_refresh (reorder => sub { + $self->reorder; + }); } sub reconfigure { @@ -3459,7 +3473,7 @@ my @items = sort { ($a->{type} <=> $b->{type}) or ($a->{name} cmp $b->{name}) - } @$items; + } values %$items; $self->{real_items} = \@items;