updates to mac enable method

This commit is contained in:
Shelley Vohr 2018-02-06 09:16:22 -05:00
parent 131aa38768
commit 80aa399f8a
No known key found for this signature in database
GPG key ID: F13993A75599653C
3 changed files with 9 additions and 3 deletions

View file

@ -38,6 +38,7 @@ class NativeWindowMac : public NativeWindow,
void Hide() override;
bool IsVisible() override;
bool IsEnabled() override;
void SetEnabled(bool enable) override;
void Maximize() override;
void Unmaximize() override;
bool IsMaximized() override;

View file

@ -1045,6 +1045,8 @@ NativeWindowMac::NativeWindowMac(
web_contents->GetWebContents()->GetRenderViewHost());
}
NSWindow* currentSheet;
NativeWindowMac::~NativeWindowMac() {
[NSEvent removeMonitor:wheel_event_monitor_];
Observe(nullptr);
@ -1137,9 +1139,12 @@ bool NativeWindowMac::IsEnabled() {
void NativeWindowMac::SetEnabled(bool enable) {
if (enable) {
// TODO(codebytere): figure out how to implement window enabling
[window_ beginSheet: window_ completionHandler:^(NSModalResponse returnCode) {
NSLog(@"modal enabled");
return;
}];
} else {
[window_ attachedSheet] = nil;
[window_ endSheet: [window_ attachedSheet]];
}
}

View file

@ -847,7 +847,7 @@ the supplied bounds.
Returns [`Rectangle`](structures/rectangle.md)
### `win.setEnabled(enable)`
#### `win.setEnabled(enable)`
* `enable` Boolean