зеркало из https://github.com/electron/electron.git
Merge pull request #437 from avdg/maximize
Add BrowserWindow::isMaximized.
This commit is contained in:
Коммит
66ab127389
|
@ -148,6 +148,10 @@ void Window::Unmaximize() {
|
|||
window_->Unmaximize();
|
||||
}
|
||||
|
||||
bool Window::IsMaximized() {
|
||||
return window_->IsMaximized();
|
||||
}
|
||||
|
||||
void Window::Minimize() {
|
||||
window_->Minimize();
|
||||
}
|
||||
|
@ -340,6 +344,7 @@ void Window::BuildPrototype(v8::Isolate* isolate,
|
|||
.SetMethod("isVisible", &Window::IsVisible)
|
||||
.SetMethod("maximize", &Window::Maximize)
|
||||
.SetMethod("unmaximize", &Window::Unmaximize)
|
||||
.SetMethod("isMaximized", &Window::IsMaximized)
|
||||
.SetMethod("minimize", &Window::Minimize)
|
||||
.SetMethod("restore", &Window::Restore)
|
||||
.SetMethod("setFullScreen", &Window::SetFullscreen)
|
||||
|
|
|
@ -63,6 +63,7 @@ class Window : public mate::EventEmitter,
|
|||
bool IsVisible();
|
||||
void Maximize();
|
||||
void Unmaximize();
|
||||
bool IsMaximized();
|
||||
void Minimize();
|
||||
void Restore();
|
||||
void SetFullscreen(bool fullscreen);
|
||||
|
|
|
@ -99,6 +99,7 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate,
|
|||
virtual bool IsVisible() = 0;
|
||||
virtual void Maximize() = 0;
|
||||
virtual void Unmaximize() = 0;
|
||||
virtual bool IsMaximized() = 0;
|
||||
virtual void Minimize() = 0;
|
||||
virtual void Restore() = 0;
|
||||
virtual void SetFullscreen(bool fullscreen) = 0;
|
||||
|
|
|
@ -40,6 +40,7 @@ class NativeWindowGtk : public NativeWindow,
|
|||
virtual bool IsVisible() OVERRIDE;
|
||||
virtual void Maximize() OVERRIDE;
|
||||
virtual void Unmaximize() OVERRIDE;
|
||||
virtual bool IsMaximized() OVERRIDE;
|
||||
virtual void Minimize() OVERRIDE;
|
||||
virtual void Restore() OVERRIDE;
|
||||
virtual void SetFullscreen(bool fullscreen) OVERRIDE;
|
||||
|
@ -92,9 +93,6 @@ class NativeWindowGtk : public NativeWindow,
|
|||
// Set how font is renderered.
|
||||
void SetFontRenderering();
|
||||
|
||||
// Whether window is maximized.
|
||||
bool IsMaximized() const;
|
||||
|
||||
// If the point (|x|, |y|) is within the resize border area of the window,
|
||||
// returns true and sets |edge| to the appropriate GdkWindowEdge value.
|
||||
// Otherwise, returns false.
|
||||
|
|
|
@ -32,6 +32,7 @@ class NativeWindowMac : public NativeWindow {
|
|||
virtual bool IsVisible() OVERRIDE;
|
||||
virtual void Maximize() OVERRIDE;
|
||||
virtual void Unmaximize() OVERRIDE;
|
||||
virtual bool IsMaximized() OVERRIDE;
|
||||
virtual void Minimize() OVERRIDE;
|
||||
virtual void Restore() OVERRIDE;
|
||||
virtual void SetFullscreen(bool fullscreen) OVERRIDE;
|
||||
|
|
|
@ -279,6 +279,10 @@ void NativeWindowMac::Unmaximize() {
|
|||
[window_ zoom:nil];
|
||||
}
|
||||
|
||||
bool NativeWindowMac::IsMaximized() {
|
||||
return [window_ isZoomed];
|
||||
}
|
||||
|
||||
void NativeWindowMac::Minimize() {
|
||||
[window_ miniaturize:nil];
|
||||
}
|
||||
|
|
|
@ -294,6 +294,10 @@ void NativeWindowWin::Unmaximize() {
|
|||
window_->Restore();
|
||||
}
|
||||
|
||||
bool NativeWindowWin::IsMaximized() {
|
||||
return window_->IsMaximized();
|
||||
}
|
||||
|
||||
bool NativeWindowWin::IsVisible() {
|
||||
return window_->IsVisible();
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@ class NativeWindowWin : public NativeWindow,
|
|||
virtual bool IsVisible() OVERRIDE;
|
||||
virtual void Maximize() OVERRIDE;
|
||||
virtual void Unmaximize() OVERRIDE;
|
||||
virtual bool IsMaximized() OVERRIDE;
|
||||
virtual void Minimize() OVERRIDE;
|
||||
virtual void Restore() OVERRIDE;
|
||||
virtual void SetFullscreen(bool fullscreen) OVERRIDE;
|
||||
|
|
|
@ -239,6 +239,10 @@ Maximizes the window.
|
|||
|
||||
Unmaximizes the window.
|
||||
|
||||
### BrowserWindow.isMaximized()
|
||||
|
||||
Returns whether the window is maximized.
|
||||
|
||||
### BrowserWindow.minimize()
|
||||
|
||||
Minimizes the window. On some platforms the minimized window will be shown in
|
||||
|
|
Загрузка…
Ссылка в новой задаче