Merge pull request #9108 from yuya-oc/add-macos-sheet-events
Add sheet-begin and sheet-end events to macOS BrowserWindow
This commit is contained in:
commit
dc8b43901b
8 changed files with 88 additions and 0 deletions
|
@ -263,6 +263,14 @@ void Window::OnWindowSwipe(const std::string& direction) {
|
|||
Emit("swipe", direction);
|
||||
}
|
||||
|
||||
void Window::OnWindowSheetBegin() {
|
||||
Emit("sheet-begin");
|
||||
}
|
||||
|
||||
void Window::OnWindowSheetEnd() {
|
||||
Emit("sheet-end");
|
||||
}
|
||||
|
||||
void Window::OnWindowEnterHtmlFullScreen() {
|
||||
Emit("enter-html-full-screen");
|
||||
}
|
||||
|
|
|
@ -79,6 +79,8 @@ class Window : public mate::TrackableObject<Window>,
|
|||
void OnWindowScrollTouchEnd() override;
|
||||
void OnWindowScrollTouchEdge() override;
|
||||
void OnWindowSwipe(const std::string& direction) override;
|
||||
void OnWindowSheetBegin() override;
|
||||
void OnWindowSheetEnd() override;
|
||||
void OnWindowEnterFullScreen() override;
|
||||
void OnWindowLeaveFullScreen() override;
|
||||
void OnWindowEnterHtmlFullScreen() override;
|
||||
|
|
|
@ -554,6 +554,16 @@ void NativeWindow::NotifyWindowSwipe(const std::string& direction) {
|
|||
observer.OnWindowSwipe(direction);
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowSheetBegin() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowSheetBegin();
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowSheetEnd() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowSheetEnd();
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyWindowLeaveFullScreen() {
|
||||
for (NativeWindowObserver& observer : observers_)
|
||||
observer.OnWindowLeaveFullScreen();
|
||||
|
|
|
@ -233,6 +233,8 @@ class NativeWindow : public base::SupportsUserData,
|
|||
void NotifyWindowScrollTouchEnd();
|
||||
void NotifyWindowScrollTouchEdge();
|
||||
void NotifyWindowSwipe(const std::string& direction);
|
||||
void NotifyWindowSheetBegin();
|
||||
void NotifyWindowSheetEnd();
|
||||
void NotifyWindowEnterFullScreen();
|
||||
void NotifyWindowLeaveFullScreen();
|
||||
void NotifyWindowEnterHtmlFullScreen();
|
||||
|
|
|
@ -313,6 +313,14 @@ bool ScopedDisableResize::disable_resize_ = false;
|
|||
return rect;
|
||||
}
|
||||
|
||||
- (void)windowWillBeginSheet:(NSNotification *)notification {
|
||||
shell_->NotifyWindowSheetBegin();
|
||||
}
|
||||
|
||||
- (void)windowDidEndSheet:(NSNotification *)notification {
|
||||
shell_->NotifyWindowSheetEnd();
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@interface AtomPreviewItem : NSObject <QLPreviewItem>
|
||||
|
|
|
@ -67,6 +67,8 @@ class NativeWindowObserver {
|
|||
virtual void OnWindowScrollTouchEnd() {}
|
||||
virtual void OnWindowScrollTouchEdge() {}
|
||||
virtual void OnWindowSwipe(const std::string& direction) {}
|
||||
virtual void OnWindowSheetBegin() {}
|
||||
virtual void OnWindowSheetEnd() {}
|
||||
virtual void OnWindowEnterFullScreen() {}
|
||||
virtual void OnWindowLeaveFullScreen() {}
|
||||
virtual void OnWindowEnterHtmlFullScreen() {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue