5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-08 13:40:02 +08:00

Add window to runtime

This commit is contained in:
Lea Anthony 2020-11-15 10:16:56 +11:00
parent ddb875f788
commit c45315d61d
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405
3 changed files with 107 additions and 1 deletions

View File

@ -16,6 +16,7 @@ const Events = require('./events');
const Init = require('./init');
const System = require('./system');
const Store = require('./store');
const Window = require('./window');
module.exports = {
Browser: Browser,
@ -25,4 +26,5 @@ module.exports = {
Log: Log,
System: System,
Store: Store,
Window: Window,
};

View File

@ -1,6 +1,6 @@
{
"name": "@wails/runtime",
"version": "1.1.0",
"version": "1.2.0",
"description": "Wails V2 Javascript runtime library",
"main": "main.js",
"types": "runtime.d.ts",

View File

@ -0,0 +1,104 @@
/*
_ __ _ __
| | / /___ _(_) /____
| | /| / / __ `/ / / ___/
| |/ |/ / /_/ / / (__ )
|__/|__/\__,_/_/_/____/
The lightweight framework for web-like apps
(c) Lea Anthony 2019-present
*/
/* jshint esversion: 6 */
/**
* Place the window in the center of the screen
*
* @export
*/
export function Center() {
window.wails.Window.Center();
}
/**
* Set the Size of the window
*
* @export
* @param {number} width
* @param {number} height
*/
export function SetSize(width, height) {
window.wails.Window.SetSize(width, height);
}
/**
* Set the Position of the window
*
* @export
* @param {number} x
* @param {number} y
*/
export function SetPosition(x, y) {
window.wails.Window.SetPosition(x, y);
}
/**
* Hide the Window
*
* @export
*/
export function Hide() {
window.wails.Window.Hide();
}
/**
* Show the Window
*
* @export
*/
export function Show() {
window.wails.Window.Show();
}
/**
* Maximise the Window
*
* @export
*/
export function Maximise() {
window.wails.Window.Maximise()
}
/**
* Unmaximise the Window
*
* @export
*/
export function Unmaximise() {
window.wails.Window.Unmaximise()
}
/**
* Minimise the Window
*
* @export
*/
export function Minimise() {
window.wails.Window.Minimise();
}
/**
* Unminimise the Window
*
* @export
*/
export function Unminimise() {
window.wails.Window.Unminimise();
}
/**
* Close the Window
*
* @export
*/
export function Close() {
window.wails.Window.Close();
}