Animate popup window as if it were an NSMenu
This commit is contained in:
parent
9efa39e81e
commit
147268157c
1 changed files with 11 additions and 2 deletions
|
@ -475,11 +475,20 @@ impl Window {
|
||||||
native_window.center();
|
native_window.center();
|
||||||
}
|
}
|
||||||
|
|
||||||
native_window.makeKeyAndOrderFront_(nil);
|
|
||||||
match options.kind {
|
match options.kind {
|
||||||
WindowKind::Normal => native_window.setLevel_(NSNormalWindowLevel),
|
WindowKind::Normal => native_window.setLevel_(NSNormalWindowLevel),
|
||||||
WindowKind::PopUp => native_window.setLevel_(NSPopUpWindowLevel),
|
WindowKind::PopUp => {
|
||||||
|
#[allow(non_upper_case_globals)]
|
||||||
|
const NSWindowAnimationBehaviorUtilityWindow: NSInteger = 4;
|
||||||
|
|
||||||
|
native_window.setLevel_(NSPopUpWindowLevel);
|
||||||
|
let _: () = msg_send![
|
||||||
|
native_window,
|
||||||
|
setAnimationBehavior: NSWindowAnimationBehaviorUtilityWindow
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
native_window.makeKeyAndOrderFront_(nil);
|
||||||
|
|
||||||
window.0.borrow().move_traffic_light();
|
window.0.borrow().move_traffic_light();
|
||||||
pool.drain();
|
pool.drain();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue