mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-11 22:49:29 +08:00
Add window to runtime
This commit is contained in:
parent
ddb875f788
commit
c45315d61d
@ -16,6 +16,7 @@ const Events = require('./events');
|
|||||||
const Init = require('./init');
|
const Init = require('./init');
|
||||||
const System = require('./system');
|
const System = require('./system');
|
||||||
const Store = require('./store');
|
const Store = require('./store');
|
||||||
|
const Window = require('./window');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
Browser: Browser,
|
Browser: Browser,
|
||||||
@ -25,4 +26,5 @@ module.exports = {
|
|||||||
Log: Log,
|
Log: Log,
|
||||||
System: System,
|
System: System,
|
||||||
Store: Store,
|
Store: Store,
|
||||||
|
Window: Window,
|
||||||
};
|
};
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wails/runtime",
|
"name": "@wails/runtime",
|
||||||
"version": "1.1.0",
|
"version": "1.2.0",
|
||||||
"description": "Wails V2 Javascript runtime library",
|
"description": "Wails V2 Javascript runtime library",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"types": "runtime.d.ts",
|
"types": "runtime.d.ts",
|
||||||
|
104
v2/internal/runtime/js/runtime/window.js
Normal file
104
v2/internal/runtime/js/runtime/window.js
Normal 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();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user