| | 162 | |
|---|
| | 163 | |
|---|
| | 164 | #pragma mark - |
|---|
| | 165 | |
|---|
| | 166 | - (void)_animateOrderFront:(id)sender { |
|---|
| | 167 | float alpha; |
|---|
| | 168 | |
|---|
| | 169 | alpha = [self alphaValue] + 0.1; |
|---|
| | 170 | |
|---|
| | 171 | [self setAlphaValue:alpha]; |
|---|
| | 172 | |
|---|
| | 173 | if(alpha < 1.0) |
|---|
| | 174 | [self performSelector:@selector(_animateOrderFront:) withObject:sender afterDelay:0.03]; |
|---|
| | 175 | } |
|---|
| | 176 | |
|---|
| | 177 | |
|---|
| | 178 | |
|---|
| | 179 | - (void)_animateOrderOut:(id)sender { |
|---|
| | 180 | float alpha; |
|---|
| | 181 | |
|---|
| | 182 | alpha = [self alphaValue] - 0.05; |
|---|
| | 183 | |
|---|
| | 184 | [self setAlphaValue:alpha]; |
|---|
| | 185 | |
|---|
| | 186 | if(alpha > 0.0) |
|---|
| | 187 | [self performSelector:@selector(_animateOrderOut:) withObject:sender afterDelay:0.03]; |
|---|
| | 188 | else |
|---|
| | 189 | [self orderOut:sender]; |
|---|
| | 190 | } |
|---|
| | 191 | |
|---|
| | 192 | |
|---|
| | 193 | |
|---|
| | 194 | - (void)orderFront:(id)sender animate:(BOOL)animate { |
|---|
| | 195 | if(!animate) { |
|---|
| | 196 | [self orderFront:sender]; |
|---|
| | 197 | |
|---|
| | 198 | return; |
|---|
| | 199 | } |
|---|
| | 200 | |
|---|
| | 201 | [self setAlphaValue:0.0]; |
|---|
| | 202 | [self orderFront:sender]; |
|---|
| | 203 | |
|---|
| | 204 | [self performSelector:@selector(_animateOrderFront:) withObject:sender afterDelay:0.03]; |
|---|
| | 205 | } |
|---|
| | 206 | |
|---|
| | 207 | |
|---|
| | 208 | |
|---|
| | 209 | - (void)orderOut:(id)sender animate:(BOOL)animate { |
|---|
| | 210 | if(!animate) { |
|---|
| | 211 | [self orderOut:sender]; |
|---|
| | 212 | |
|---|
| | 213 | return; |
|---|
| | 214 | } |
|---|
| | 215 | |
|---|
| | 216 | [self performSelector:@selector(_animateOrderOut:) withObject:sender afterDelay:0.03]; |
|---|
| | 217 | } |
|---|
| | 218 | |
|---|