AppWindow class
class AppWindow extends ChromeObject { AppWindow({Window contentWindow}) { if (contentWindow != null) this.contentWindow = contentWindow; } AppWindow.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy); Window get contentWindow => _createWindow(jsProxy['contentWindow']); set contentWindow(Window value) => jsProxy['contentWindow'] = jsify(value); /** * Focus the window. */ void focus() { jsProxy.callMethod('focus'); } /** * Fullscreens the window. */ void fullscreen() { jsProxy.callMethod('fullscreen'); } /** * Is the window fullscreen? */ bool isFullscreen() { return jsProxy.callMethod('isFullscreen'); } /** * Minimize the window. */ void minimize() { jsProxy.callMethod('minimize'); } /** * Is the window minimized? */ bool isMinimized() { return jsProxy.callMethod('isMinimized'); } /** * Maximize the window. */ void maximize() { jsProxy.callMethod('maximize'); } /** * Is the window maximized? */ bool isMaximized() { return jsProxy.callMethod('isMaximized'); } /** * Restore the window, exiting a maximized, minimized, or fullscreen state. */ void restore() { jsProxy.callMethod('restore'); } /** * Move the window to the position ([left], [top]). */ void moveTo(int left, int top) { jsProxy.callMethod('moveTo', [left, top]); } /** * Resize the window to [width]x[height] pixels in size. */ void resizeTo(int width, int height) { jsProxy.callMethod('resizeTo', [width, height]); } /** * Draw attention to the window. */ void drawAttention() { jsProxy.callMethod('drawAttention'); } /** * Clear attention to the window. */ void clearAttention() { jsProxy.callMethod('clearAttention'); } /** * Close the window. */ void close() { jsProxy.callMethod('close'); } /** * Show the window. Does nothing if the window is already visible. */ void show() { jsProxy.callMethod('show'); } /** * Hide the window. Does nothing if the window is already hidden. */ void hide() { jsProxy.callMethod('hide'); } /** * Get the window's bounds as a [Bounds] object. */ Bounds getBounds() { return _createBounds(jsProxy.callMethod('getBounds')); } /** * Set the window's bounds. */ void setBounds(Bounds bounds) { jsProxy.callMethod('setBounds', [jsify(bounds)]); } /** * Set the app icon for the window (experimental). Currently this is only * being implemented on Ash. todo(stevenjb): Investigate implementing this on * Windows and OSX. */ void setIcon(String icon_url) { jsProxy.callMethod('setIcon', [icon_url]); } /** * Is the window always on top? Currently available in the Dev channel only. */ bool isAlwaysOnTop() { return jsProxy.callMethod('isAlwaysOnTop'); } /** * Set whether the window should stay above most other windows. Currently * available in the Dev channel only. */ void setAlwaysOnTop(bool always_on_top) { jsProxy.callMethod('setAlwaysOnTop', [always_on_top]); } }
Extends
ChromeObject > AppWindow
Constructors
new AppWindow({Window contentWindow}) #
Create a new instance of a ChromeObject
, which creates and delegates to
a JsObject proxy.
AppWindow({Window contentWindow}) { if (contentWindow != null) this.contentWindow = contentWindow; }
new AppWindow.fromProxy(JsObject jsProxy) #
Create a new instance of a ChromeObject
, which delegates to the given
JsObject proxy.
AppWindow.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);
Properties
Methods
void clearAttention() #
Clear attention to the window.
void clearAttention() { jsProxy.callMethod('clearAttention'); }
void close() #
Close the window.
void close() { jsProxy.callMethod('close'); }
void drawAttention() #
Draw attention to the window.
void drawAttention() { jsProxy.callMethod('drawAttention'); }
void focus() #
Focus the window.
void focus() { jsProxy.callMethod('focus'); }
void fullscreen() #
Fullscreens the window.
void fullscreen() { jsProxy.callMethod('fullscreen'); }
Bounds getBounds() #
Get the window's bounds as a Bounds object.
Bounds getBounds() { return _createBounds(jsProxy.callMethod('getBounds')); }
void hide() #
Hide the window. Does nothing if the window is already hidden.
void hide() { jsProxy.callMethod('hide'); }
bool isAlwaysOnTop() #
Is the window always on top? Currently available in the Dev channel only.
bool isAlwaysOnTop() { return jsProxy.callMethod('isAlwaysOnTop'); }
bool isFullscreen() #
Is the window fullscreen?
bool isFullscreen() { return jsProxy.callMethod('isFullscreen'); }
bool isMaximized() #
Is the window maximized?
bool isMaximized() { return jsProxy.callMethod('isMaximized'); }
bool isMinimized() #
Is the window minimized?
bool isMinimized() { return jsProxy.callMethod('isMinimized'); }
void maximize() #
Maximize the window.
void maximize() { jsProxy.callMethod('maximize'); }
void minimize() #
Minimize the window.
void minimize() { jsProxy.callMethod('minimize'); }
void moveTo(int left, int top) #
Move the window to the position ( left, top).
void moveTo(int left, int top) { jsProxy.callMethod('moveTo', [left, top]); }
void resizeTo(int width, int height) #
Resize the window to widthx height pixels in size.
void resizeTo(int width, int height) { jsProxy.callMethod('resizeTo', [width, height]); }
void restore() #
Restore the window, exiting a maximized, minimized, or fullscreen state.
void restore() { jsProxy.callMethod('restore'); }
void setAlwaysOnTop(bool always_on_top) #
Set whether the window should stay above most other windows. Currently available in the Dev channel only.
void setAlwaysOnTop(bool always_on_top) { jsProxy.callMethod('setAlwaysOnTop', [always_on_top]); }
void setBounds(Bounds bounds) #
Set the window's bounds.
void setBounds(Bounds bounds) { jsProxy.callMethod('setBounds', [jsify(bounds)]); }
void setIcon(String icon_url) #
Set the app icon for the window (experimental). Currently this is only being implemented on Ash. todo(stevenjb): Investigate implementing this on Windows and OSX.
void setIcon(String icon_url) { jsProxy.callMethod('setIcon', [icon_url]); }
void show() #
Show the window. Does nothing if the window is already visible.
void show() { jsProxy.callMethod('show'); }
String toString() #
Returns a string representation of this object.
String toString() => jsProxy.toString();