mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 20:03:01 +08:00
Add Environment
and WindowReloadApp
calls to runtime. Updated default templates.
This commit is contained in:
parent
2e3c90c096
commit
f6257d3d31
@ -18,6 +18,12 @@ export interface Size {
|
||||
h: number;
|
||||
}
|
||||
|
||||
// Environment information such as platform, buildtype, ...
|
||||
export interface EnvironmentInfo {
|
||||
buildType: string;
|
||||
platform: string;
|
||||
arch: string;
|
||||
}
|
||||
|
||||
// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit)
|
||||
// emits the given event. Optional data may be passed with the event.
|
||||
@ -72,6 +78,10 @@ export function LogWarning(message: string): void;
|
||||
// Forces a reload by the main application as well as connected browsers.
|
||||
export function WindowReload(): void;
|
||||
|
||||
// [WindowReloadApp](https://wails.io/docs/reference/runtime/window#windowreloadapp)
|
||||
// Reloads the application frontend.
|
||||
export function WindowReloadApp(): void;
|
||||
|
||||
// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme)
|
||||
// *Windows only*
|
||||
// Sets window theme to system default (dark/light).
|
||||
@ -161,10 +171,18 @@ export function WindowUnminimise(): void;
|
||||
// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels.
|
||||
export function WindowSetRGBA(R: number, G: number, B: number, A: number): void;
|
||||
|
||||
// Navigates back to the application after navigating away
|
||||
export function NavigateBackToApp(): void;
|
||||
|
||||
// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl)
|
||||
// Opens the given URL in the system browser.
|
||||
export function BrowserOpenURL(url: string): void;
|
||||
|
||||
// []()
|
||||
//
|
||||
export function Environment(): EnvironmentInfo;
|
||||
|
||||
|
||||
// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit)
|
||||
// Quits the application.
|
||||
export function Quit(): void;
|
||||
|
@ -61,6 +61,10 @@ export function WindowReload() {
|
||||
window.runtime.WindowReload();
|
||||
}
|
||||
|
||||
export function WindowReloadApp() {
|
||||
window.runtime.WindowReloadApp();
|
||||
}
|
||||
|
||||
export function WindowSetSystemDefaultTheme() {
|
||||
window.runtime.WindowSetSystemDefaultTheme();
|
||||
}
|
||||
@ -90,7 +94,7 @@ export function WindowUnfullscreen() {
|
||||
}
|
||||
|
||||
export function WindowGetSize() {
|
||||
window.runtime.WindowGetSize();
|
||||
return window.runtime.WindowGetSize();
|
||||
}
|
||||
|
||||
export function WindowSetSize(width, height) {
|
||||
@ -110,7 +114,7 @@ export function WindowSetPosition(x, y) {
|
||||
}
|
||||
|
||||
export function WindowGetPosition() {
|
||||
window.runtime.WindowGetPosition();
|
||||
return window.runtime.WindowGetPosition();
|
||||
}
|
||||
|
||||
export function WindowHide() {
|
||||
@ -149,6 +153,10 @@ export function BrowserOpenURL(url) {
|
||||
window.runtime.BrowserOpenURL(url);
|
||||
}
|
||||
|
||||
export function Environment() {
|
||||
return window.runtime.Environment();
|
||||
}
|
||||
|
||||
export function Quit() {
|
||||
window.runtime.Quit();
|
||||
}
|
||||
|
@ -18,6 +18,12 @@ export interface Size {
|
||||
h: number;
|
||||
}
|
||||
|
||||
// Environment information such as platform, buildtype, ...
|
||||
export interface EnvironmentInfo {
|
||||
buildType: string;
|
||||
platform: string;
|
||||
arch: string;
|
||||
}
|
||||
|
||||
// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit)
|
||||
// emits the given event. Optional data may be passed with the event.
|
||||
@ -72,6 +78,10 @@ export function LogWarning(message: string): void;
|
||||
// Forces a reload by the main application as well as connected browsers.
|
||||
export function WindowReload(): void;
|
||||
|
||||
// [WindowReloadApp](https://wails.io/docs/reference/runtime/window#windowreloadapp)
|
||||
// Reloads the application frontend.
|
||||
export function WindowReloadApp(): void;
|
||||
|
||||
// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme)
|
||||
// *Windows only*
|
||||
// Sets window theme to system default (dark/light).
|
||||
@ -161,10 +171,18 @@ export function WindowUnminimise(): void;
|
||||
// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels.
|
||||
export function WindowSetRGBA(R: number, G: number, B: number, A: number): void;
|
||||
|
||||
// Navigates back to the application after navigating away
|
||||
export function NavigateBackToApp(): void;
|
||||
|
||||
// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl)
|
||||
// Opens the given URL in the system browser.
|
||||
export function BrowserOpenURL(url: string): void;
|
||||
|
||||
// []()
|
||||
//
|
||||
export function Environment(): EnvironmentInfo;
|
||||
|
||||
|
||||
// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit)
|
||||
// Quits the application.
|
||||
export function Quit(): void;
|
||||
|
@ -61,6 +61,10 @@ export function WindowReload() {
|
||||
window.runtime.WindowReload();
|
||||
}
|
||||
|
||||
export function WindowReloadApp() {
|
||||
window.runtime.WindowReloadApp();
|
||||
}
|
||||
|
||||
export function WindowSetSystemDefaultTheme() {
|
||||
window.runtime.WindowSetSystemDefaultTheme();
|
||||
}
|
||||
@ -90,7 +94,7 @@ export function WindowUnfullscreen() {
|
||||
}
|
||||
|
||||
export function WindowGetSize() {
|
||||
window.runtime.WindowGetSize();
|
||||
return window.runtime.WindowGetSize();
|
||||
}
|
||||
|
||||
export function WindowSetSize(width, height) {
|
||||
@ -110,7 +114,7 @@ export function WindowSetPosition(x, y) {
|
||||
}
|
||||
|
||||
export function WindowGetPosition() {
|
||||
window.runtime.WindowGetPosition();
|
||||
return window.runtime.WindowGetPosition();
|
||||
}
|
||||
|
||||
export function WindowHide() {
|
||||
@ -149,6 +153,10 @@ export function BrowserOpenURL(url) {
|
||||
window.runtime.BrowserOpenURL(url);
|
||||
}
|
||||
|
||||
export function Environment() {
|
||||
return window.runtime.Environment();
|
||||
}
|
||||
|
||||
export function Quit() {
|
||||
window.runtime.Quit();
|
||||
}
|
||||
|
@ -18,6 +18,12 @@ export interface Size {
|
||||
h: number;
|
||||
}
|
||||
|
||||
// Environment information such as platform, buildtype, ...
|
||||
export interface EnvironmentInfo {
|
||||
buildType: string;
|
||||
platform: string;
|
||||
arch: string;
|
||||
}
|
||||
|
||||
// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit)
|
||||
// emits the given event. Optional data may be passed with the event.
|
||||
@ -72,6 +78,10 @@ export function LogWarning(message: string): void;
|
||||
// Forces a reload by the main application as well as connected browsers.
|
||||
export function WindowReload(): void;
|
||||
|
||||
// [WindowReloadApp](https://wails.io/docs/reference/runtime/window#windowreloadapp)
|
||||
// Reloads the application frontend.
|
||||
export function WindowReloadApp(): void;
|
||||
|
||||
// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme)
|
||||
// *Windows only*
|
||||
// Sets window theme to system default (dark/light).
|
||||
@ -161,10 +171,18 @@ export function WindowUnminimise(): void;
|
||||
// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels.
|
||||
export function WindowSetRGBA(R: number, G: number, B: number, A: number): void;
|
||||
|
||||
// Navigates back to the application after navigating away
|
||||
export function NavigateBackToApp(): void;
|
||||
|
||||
// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl)
|
||||
// Opens the given URL in the system browser.
|
||||
export function BrowserOpenURL(url: string): void;
|
||||
|
||||
// []()
|
||||
//
|
||||
export function Environment(): EnvironmentInfo;
|
||||
|
||||
|
||||
// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit)
|
||||
// Quits the application.
|
||||
export function Quit(): void;
|
||||
|
@ -61,6 +61,10 @@ export function WindowReload() {
|
||||
window.runtime.WindowReload();
|
||||
}
|
||||
|
||||
export function WindowReloadApp() {
|
||||
window.runtime.WindowReloadApp();
|
||||
}
|
||||
|
||||
export function WindowSetSystemDefaultTheme() {
|
||||
window.runtime.WindowSetSystemDefaultTheme();
|
||||
}
|
||||
@ -90,7 +94,7 @@ export function WindowUnfullscreen() {
|
||||
}
|
||||
|
||||
export function WindowGetSize() {
|
||||
window.runtime.WindowGetSize();
|
||||
return window.runtime.WindowGetSize();
|
||||
}
|
||||
|
||||
export function WindowSetSize(width, height) {
|
||||
@ -110,7 +114,7 @@ export function WindowSetPosition(x, y) {
|
||||
}
|
||||
|
||||
export function WindowGetPosition() {
|
||||
window.runtime.WindowGetPosition();
|
||||
return window.runtime.WindowGetPosition();
|
||||
}
|
||||
|
||||
export function WindowHide() {
|
||||
@ -149,6 +153,10 @@ export function BrowserOpenURL(url) {
|
||||
window.runtime.BrowserOpenURL(url);
|
||||
}
|
||||
|
||||
export function Environment() {
|
||||
return window.runtime.Environment();
|
||||
}
|
||||
|
||||
export function Quit() {
|
||||
window.runtime.Quit();
|
||||
}
|
||||
|
@ -18,6 +18,12 @@ export interface Size {
|
||||
h: number;
|
||||
}
|
||||
|
||||
// Environment information such as platform, buildtype, ...
|
||||
export interface EnvironmentInfo {
|
||||
buildType: string;
|
||||
platform: string;
|
||||
arch: string;
|
||||
}
|
||||
|
||||
// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit)
|
||||
// emits the given event. Optional data may be passed with the event.
|
||||
@ -72,6 +78,10 @@ export function LogWarning(message: string): void;
|
||||
// Forces a reload by the main application as well as connected browsers.
|
||||
export function WindowReload(): void;
|
||||
|
||||
// [WindowReloadApp](https://wails.io/docs/reference/runtime/window#windowreloadapp)
|
||||
// Reloads the application frontend.
|
||||
export function WindowReloadApp(): void;
|
||||
|
||||
// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme)
|
||||
// *Windows only*
|
||||
// Sets window theme to system default (dark/light).
|
||||
@ -161,10 +171,18 @@ export function WindowUnminimise(): void;
|
||||
// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels.
|
||||
export function WindowSetRGBA(R: number, G: number, B: number, A: number): void;
|
||||
|
||||
// Navigates back to the application after navigating away
|
||||
export function NavigateBackToApp(): void;
|
||||
|
||||
// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl)
|
||||
// Opens the given URL in the system browser.
|
||||
export function BrowserOpenURL(url: string): void;
|
||||
|
||||
// []()
|
||||
//
|
||||
export function Environment(): EnvironmentInfo;
|
||||
|
||||
|
||||
// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit)
|
||||
// Quits the application.
|
||||
export function Quit(): void;
|
||||
|
@ -61,6 +61,10 @@ export function WindowReload() {
|
||||
window.runtime.WindowReload();
|
||||
}
|
||||
|
||||
export function WindowReloadApp() {
|
||||
window.runtime.WindowReloadApp();
|
||||
}
|
||||
|
||||
export function WindowSetSystemDefaultTheme() {
|
||||
window.runtime.WindowSetSystemDefaultTheme();
|
||||
}
|
||||
@ -90,7 +94,7 @@ export function WindowUnfullscreen() {
|
||||
}
|
||||
|
||||
export function WindowGetSize() {
|
||||
window.runtime.WindowGetSize();
|
||||
return window.runtime.WindowGetSize();
|
||||
}
|
||||
|
||||
export function WindowSetSize(width, height) {
|
||||
@ -110,7 +114,7 @@ export function WindowSetPosition(x, y) {
|
||||
}
|
||||
|
||||
export function WindowGetPosition() {
|
||||
window.runtime.WindowGetPosition();
|
||||
return window.runtime.WindowGetPosition();
|
||||
}
|
||||
|
||||
export function WindowHide() {
|
||||
@ -149,6 +153,10 @@ export function BrowserOpenURL(url) {
|
||||
window.runtime.BrowserOpenURL(url);
|
||||
}
|
||||
|
||||
export function Environment() {
|
||||
return window.runtime.Environment();
|
||||
}
|
||||
|
||||
export function Quit() {
|
||||
window.runtime.Quit();
|
||||
}
|
||||
|
@ -18,6 +18,12 @@ export interface Size {
|
||||
h: number;
|
||||
}
|
||||
|
||||
// Environment information such as platform, buildtype, ...
|
||||
export interface EnvironmentInfo {
|
||||
buildType: string;
|
||||
platform: string;
|
||||
arch: string;
|
||||
}
|
||||
|
||||
// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit)
|
||||
// emits the given event. Optional data may be passed with the event.
|
||||
@ -72,6 +78,10 @@ export function LogWarning(message: string): void;
|
||||
// Forces a reload by the main application as well as connected browsers.
|
||||
export function WindowReload(): void;
|
||||
|
||||
// [WindowReloadApp](https://wails.io/docs/reference/runtime/window#windowreloadapp)
|
||||
// Reloads the application frontend.
|
||||
export function WindowReloadApp(): void;
|
||||
|
||||
// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme)
|
||||
// *Windows only*
|
||||
// Sets window theme to system default (dark/light).
|
||||
@ -161,10 +171,18 @@ export function WindowUnminimise(): void;
|
||||
// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels.
|
||||
export function WindowSetRGBA(R: number, G: number, B: number, A: number): void;
|
||||
|
||||
// Navigates back to the application after navigating away
|
||||
export function NavigateBackToApp(): void;
|
||||
|
||||
// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl)
|
||||
// Opens the given URL in the system browser.
|
||||
export function BrowserOpenURL(url: string): void;
|
||||
|
||||
// []()
|
||||
//
|
||||
export function Environment(): EnvironmentInfo;
|
||||
|
||||
|
||||
// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit)
|
||||
// Quits the application.
|
||||
export function Quit(): void;
|
||||
|
@ -61,6 +61,10 @@ export function WindowReload() {
|
||||
window.runtime.WindowReload();
|
||||
}
|
||||
|
||||
export function WindowReloadApp() {
|
||||
window.runtime.WindowReloadApp();
|
||||
}
|
||||
|
||||
export function WindowSetSystemDefaultTheme() {
|
||||
window.runtime.WindowSetSystemDefaultTheme();
|
||||
}
|
||||
@ -90,7 +94,7 @@ export function WindowUnfullscreen() {
|
||||
}
|
||||
|
||||
export function WindowGetSize() {
|
||||
window.runtime.WindowGetSize();
|
||||
return window.runtime.WindowGetSize();
|
||||
}
|
||||
|
||||
export function WindowSetSize(width, height) {
|
||||
@ -110,7 +114,7 @@ export function WindowSetPosition(x, y) {
|
||||
}
|
||||
|
||||
export function WindowGetPosition() {
|
||||
window.runtime.WindowGetPosition();
|
||||
return window.runtime.WindowGetPosition();
|
||||
}
|
||||
|
||||
export function WindowHide() {
|
||||
@ -149,6 +153,10 @@ export function BrowserOpenURL(url) {
|
||||
window.runtime.BrowserOpenURL(url);
|
||||
}
|
||||
|
||||
export function Environment() {
|
||||
return window.runtime.Environment();
|
||||
}
|
||||
|
||||
export function Quit() {
|
||||
window.runtime.Quit();
|
||||
}
|
||||
|
@ -18,6 +18,12 @@ export interface Size {
|
||||
h: number;
|
||||
}
|
||||
|
||||
// Environment information such as platform, buildtype, ...
|
||||
export interface EnvironmentInfo {
|
||||
buildType: string;
|
||||
platform: string;
|
||||
arch: string;
|
||||
}
|
||||
|
||||
// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit)
|
||||
// emits the given event. Optional data may be passed with the event.
|
||||
@ -72,6 +78,10 @@ export function LogWarning(message: string): void;
|
||||
// Forces a reload by the main application as well as connected browsers.
|
||||
export function WindowReload(): void;
|
||||
|
||||
// [WindowReloadApp](https://wails.io/docs/reference/runtime/window#windowreloadapp)
|
||||
// Reloads the application frontend.
|
||||
export function WindowReloadApp(): void;
|
||||
|
||||
// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme)
|
||||
// *Windows only*
|
||||
// Sets window theme to system default (dark/light).
|
||||
@ -161,10 +171,18 @@ export function WindowUnminimise(): void;
|
||||
// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels.
|
||||
export function WindowSetRGBA(R: number, G: number, B: number, A: number): void;
|
||||
|
||||
// Navigates back to the application after navigating away
|
||||
export function NavigateBackToApp(): void;
|
||||
|
||||
// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl)
|
||||
// Opens the given URL in the system browser.
|
||||
export function BrowserOpenURL(url: string): void;
|
||||
|
||||
// []()
|
||||
//
|
||||
export function Environment(): EnvironmentInfo;
|
||||
|
||||
|
||||
// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit)
|
||||
// Quits the application.
|
||||
export function Quit(): void;
|
||||
|
@ -61,6 +61,10 @@ export function WindowReload() {
|
||||
window.runtime.WindowReload();
|
||||
}
|
||||
|
||||
export function WindowReloadApp() {
|
||||
window.runtime.WindowReloadApp();
|
||||
}
|
||||
|
||||
export function WindowSetSystemDefaultTheme() {
|
||||
window.runtime.WindowSetSystemDefaultTheme();
|
||||
}
|
||||
@ -90,7 +94,7 @@ export function WindowUnfullscreen() {
|
||||
}
|
||||
|
||||
export function WindowGetSize() {
|
||||
window.runtime.WindowGetSize();
|
||||
return window.runtime.WindowGetSize();
|
||||
}
|
||||
|
||||
export function WindowSetSize(width, height) {
|
||||
@ -110,7 +114,7 @@ export function WindowSetPosition(x, y) {
|
||||
}
|
||||
|
||||
export function WindowGetPosition() {
|
||||
window.runtime.WindowGetPosition();
|
||||
return window.runtime.WindowGetPosition();
|
||||
}
|
||||
|
||||
export function WindowHide() {
|
||||
@ -149,6 +153,10 @@ export function BrowserOpenURL(url) {
|
||||
window.runtime.BrowserOpenURL(url);
|
||||
}
|
||||
|
||||
export function Environment() {
|
||||
return window.runtime.Environment();
|
||||
}
|
||||
|
||||
export function Quit() {
|
||||
window.runtime.Quit();
|
||||
}
|
||||
|
@ -18,6 +18,12 @@ export interface Size {
|
||||
h: number;
|
||||
}
|
||||
|
||||
// Environment information such as platform, buildtype, ...
|
||||
export interface EnvironmentInfo {
|
||||
buildType: string;
|
||||
platform: string;
|
||||
arch: string;
|
||||
}
|
||||
|
||||
// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit)
|
||||
// emits the given event. Optional data may be passed with the event.
|
||||
@ -72,6 +78,10 @@ export function LogWarning(message: string): void;
|
||||
// Forces a reload by the main application as well as connected browsers.
|
||||
export function WindowReload(): void;
|
||||
|
||||
// [WindowReloadApp](https://wails.io/docs/reference/runtime/window#windowreloadapp)
|
||||
// Reloads the application frontend.
|
||||
export function WindowReloadApp(): void;
|
||||
|
||||
// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme)
|
||||
// *Windows only*
|
||||
// Sets window theme to system default (dark/light).
|
||||
@ -161,10 +171,18 @@ export function WindowUnminimise(): void;
|
||||
// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels.
|
||||
export function WindowSetRGBA(R: number, G: number, B: number, A: number): void;
|
||||
|
||||
// Navigates back to the application after navigating away
|
||||
export function NavigateBackToApp(): void;
|
||||
|
||||
// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl)
|
||||
// Opens the given URL in the system browser.
|
||||
export function BrowserOpenURL(url: string): void;
|
||||
|
||||
// []()
|
||||
//
|
||||
export function Environment(): EnvironmentInfo;
|
||||
|
||||
|
||||
// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit)
|
||||
// Quits the application.
|
||||
export function Quit(): void;
|
||||
|
@ -61,6 +61,10 @@ export function WindowReload() {
|
||||
window.runtime.WindowReload();
|
||||
}
|
||||
|
||||
export function WindowReloadApp() {
|
||||
window.runtime.WindowReloadApp();
|
||||
}
|
||||
|
||||
export function WindowSetSystemDefaultTheme() {
|
||||
window.runtime.WindowSetSystemDefaultTheme();
|
||||
}
|
||||
@ -90,7 +94,7 @@ export function WindowUnfullscreen() {
|
||||
}
|
||||
|
||||
export function WindowGetSize() {
|
||||
window.runtime.WindowGetSize();
|
||||
return window.runtime.WindowGetSize();
|
||||
}
|
||||
|
||||
export function WindowSetSize(width, height) {
|
||||
@ -110,7 +114,7 @@ export function WindowSetPosition(x, y) {
|
||||
}
|
||||
|
||||
export function WindowGetPosition() {
|
||||
window.runtime.WindowGetPosition();
|
||||
return window.runtime.WindowGetPosition();
|
||||
}
|
||||
|
||||
export function WindowHide() {
|
||||
@ -149,6 +153,10 @@ export function BrowserOpenURL(url) {
|
||||
window.runtime.BrowserOpenURL(url);
|
||||
}
|
||||
|
||||
export function Environment() {
|
||||
return window.runtime.Environment();
|
||||
}
|
||||
|
||||
export function Quit() {
|
||||
window.runtime.Quit();
|
||||
}
|
||||
|
@ -18,6 +18,12 @@ export interface Size {
|
||||
h: number;
|
||||
}
|
||||
|
||||
// Environment information such as platform, buildtype, ...
|
||||
export interface EnvironmentInfo {
|
||||
buildType: string;
|
||||
platform: string;
|
||||
arch: string;
|
||||
}
|
||||
|
||||
// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit)
|
||||
// emits the given event. Optional data may be passed with the event.
|
||||
@ -72,6 +78,10 @@ export function LogWarning(message: string): void;
|
||||
// Forces a reload by the main application as well as connected browsers.
|
||||
export function WindowReload(): void;
|
||||
|
||||
// [WindowReloadApp](https://wails.io/docs/reference/runtime/window#windowreloadapp)
|
||||
// Reloads the application frontend.
|
||||
export function WindowReloadApp(): void;
|
||||
|
||||
// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme)
|
||||
// *Windows only*
|
||||
// Sets window theme to system default (dark/light).
|
||||
@ -161,10 +171,18 @@ export function WindowUnminimise(): void;
|
||||
// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels.
|
||||
export function WindowSetRGBA(R: number, G: number, B: number, A: number): void;
|
||||
|
||||
// Navigates back to the application after navigating away
|
||||
export function NavigateBackToApp(): void;
|
||||
|
||||
// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl)
|
||||
// Opens the given URL in the system browser.
|
||||
export function BrowserOpenURL(url: string): void;
|
||||
|
||||
// []()
|
||||
//
|
||||
export function Environment(): EnvironmentInfo;
|
||||
|
||||
|
||||
// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit)
|
||||
// Quits the application.
|
||||
export function Quit(): void;
|
||||
|
@ -61,6 +61,10 @@ export function WindowReload() {
|
||||
window.runtime.WindowReload();
|
||||
}
|
||||
|
||||
export function WindowReloadApp() {
|
||||
window.runtime.WindowReloadApp();
|
||||
}
|
||||
|
||||
export function WindowSetSystemDefaultTheme() {
|
||||
window.runtime.WindowSetSystemDefaultTheme();
|
||||
}
|
||||
@ -90,7 +94,7 @@ export function WindowUnfullscreen() {
|
||||
}
|
||||
|
||||
export function WindowGetSize() {
|
||||
window.runtime.WindowGetSize();
|
||||
return window.runtime.WindowGetSize();
|
||||
}
|
||||
|
||||
export function WindowSetSize(width, height) {
|
||||
@ -110,7 +114,7 @@ export function WindowSetPosition(x, y) {
|
||||
}
|
||||
|
||||
export function WindowGetPosition() {
|
||||
window.runtime.WindowGetPosition();
|
||||
return window.runtime.WindowGetPosition();
|
||||
}
|
||||
|
||||
export function WindowHide() {
|
||||
@ -149,6 +153,10 @@ export function BrowserOpenURL(url) {
|
||||
window.runtime.BrowserOpenURL(url);
|
||||
}
|
||||
|
||||
export function Environment() {
|
||||
return window.runtime.Environment();
|
||||
}
|
||||
|
||||
export function Quit() {
|
||||
window.runtime.Quit();
|
||||
}
|
||||
|
@ -18,6 +18,12 @@ export interface Size {
|
||||
h: number;
|
||||
}
|
||||
|
||||
// Environment information such as platform, buildtype, ...
|
||||
export interface EnvironmentInfo {
|
||||
buildType: string;
|
||||
platform: string;
|
||||
arch: string;
|
||||
}
|
||||
|
||||
// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit)
|
||||
// emits the given event. Optional data may be passed with the event.
|
||||
@ -72,6 +78,10 @@ export function LogWarning(message: string): void;
|
||||
// Forces a reload by the main application as well as connected browsers.
|
||||
export function WindowReload(): void;
|
||||
|
||||
// [WindowReloadApp](https://wails.io/docs/reference/runtime/window#windowreloadapp)
|
||||
// Reloads the application frontend.
|
||||
export function WindowReloadApp(): void;
|
||||
|
||||
// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme)
|
||||
// *Windows only*
|
||||
// Sets window theme to system default (dark/light).
|
||||
@ -161,10 +171,18 @@ export function WindowUnminimise(): void;
|
||||
// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels.
|
||||
export function WindowSetRGBA(R: number, G: number, B: number, A: number): void;
|
||||
|
||||
// Navigates back to the application after navigating away
|
||||
export function NavigateBackToApp(): void;
|
||||
|
||||
// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl)
|
||||
// Opens the given URL in the system browser.
|
||||
export function BrowserOpenURL(url: string): void;
|
||||
|
||||
// []()
|
||||
//
|
||||
export function Environment(): EnvironmentInfo;
|
||||
|
||||
|
||||
// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit)
|
||||
// Quits the application.
|
||||
export function Quit(): void;
|
||||
|
@ -61,6 +61,10 @@ export function WindowReload() {
|
||||
window.runtime.WindowReload();
|
||||
}
|
||||
|
||||
export function WindowReloadApp() {
|
||||
window.runtime.WindowReloadApp();
|
||||
}
|
||||
|
||||
export function WindowSetSystemDefaultTheme() {
|
||||
window.runtime.WindowSetSystemDefaultTheme();
|
||||
}
|
||||
@ -90,7 +94,7 @@ export function WindowUnfullscreen() {
|
||||
}
|
||||
|
||||
export function WindowGetSize() {
|
||||
window.runtime.WindowGetSize();
|
||||
return window.runtime.WindowGetSize();
|
||||
}
|
||||
|
||||
export function WindowSetSize(width, height) {
|
||||
@ -110,7 +114,7 @@ export function WindowSetPosition(x, y) {
|
||||
}
|
||||
|
||||
export function WindowGetPosition() {
|
||||
window.runtime.WindowGetPosition();
|
||||
return window.runtime.WindowGetPosition();
|
||||
}
|
||||
|
||||
export function WindowHide() {
|
||||
@ -149,6 +153,10 @@ export function BrowserOpenURL(url) {
|
||||
window.runtime.BrowserOpenURL(url);
|
||||
}
|
||||
|
||||
export function Environment() {
|
||||
return window.runtime.Environment();
|
||||
}
|
||||
|
||||
export function Quit() {
|
||||
window.runtime.Quit();
|
||||
}
|
||||
|
@ -18,6 +18,12 @@ export interface Size {
|
||||
h: number;
|
||||
}
|
||||
|
||||
// Environment information such as platform, buildtype, ...
|
||||
export interface EnvironmentInfo {
|
||||
buildType: string;
|
||||
platform: string;
|
||||
arch: string;
|
||||
}
|
||||
|
||||
// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit)
|
||||
// emits the given event. Optional data may be passed with the event.
|
||||
@ -72,6 +78,10 @@ export function LogWarning(message: string): void;
|
||||
// Forces a reload by the main application as well as connected browsers.
|
||||
export function WindowReload(): void;
|
||||
|
||||
// [WindowReloadApp](https://wails.io/docs/reference/runtime/window#windowreloadapp)
|
||||
// Reloads the application frontend.
|
||||
export function WindowReloadApp(): void;
|
||||
|
||||
// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme)
|
||||
// *Windows only*
|
||||
// Sets window theme to system default (dark/light).
|
||||
@ -161,10 +171,18 @@ export function WindowUnminimise(): void;
|
||||
// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels.
|
||||
export function WindowSetRGBA(R: number, G: number, B: number, A: number): void;
|
||||
|
||||
// Navigates back to the application after navigating away
|
||||
export function NavigateBackToApp(): void;
|
||||
|
||||
// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl)
|
||||
// Opens the given URL in the system browser.
|
||||
export function BrowserOpenURL(url: string): void;
|
||||
|
||||
// []()
|
||||
//
|
||||
export function Environment(): EnvironmentInfo;
|
||||
|
||||
|
||||
// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit)
|
||||
// Quits the application.
|
||||
export function Quit(): void;
|
||||
|
@ -61,6 +61,10 @@ export function WindowReload() {
|
||||
window.runtime.WindowReload();
|
||||
}
|
||||
|
||||
export function WindowReloadApp() {
|
||||
window.runtime.WindowReloadApp();
|
||||
}
|
||||
|
||||
export function WindowSetSystemDefaultTheme() {
|
||||
window.runtime.WindowSetSystemDefaultTheme();
|
||||
}
|
||||
@ -90,7 +94,7 @@ export function WindowUnfullscreen() {
|
||||
}
|
||||
|
||||
export function WindowGetSize() {
|
||||
window.runtime.WindowGetSize();
|
||||
return window.runtime.WindowGetSize();
|
||||
}
|
||||
|
||||
export function WindowSetSize(width, height) {
|
||||
@ -110,7 +114,7 @@ export function WindowSetPosition(x, y) {
|
||||
}
|
||||
|
||||
export function WindowGetPosition() {
|
||||
window.runtime.WindowGetPosition();
|
||||
return window.runtime.WindowGetPosition();
|
||||
}
|
||||
|
||||
export function WindowHide() {
|
||||
@ -149,6 +153,10 @@ export function BrowserOpenURL(url) {
|
||||
window.runtime.BrowserOpenURL(url);
|
||||
}
|
||||
|
||||
export function Environment() {
|
||||
return window.runtime.Environment();
|
||||
}
|
||||
|
||||
export function Quit() {
|
||||
window.runtime.Quit();
|
||||
}
|
||||
|
@ -18,6 +18,12 @@ export interface Size {
|
||||
h: number;
|
||||
}
|
||||
|
||||
// Environment information such as platform, buildtype, ...
|
||||
export interface EnvironmentInfo {
|
||||
buildType: string;
|
||||
platform: string;
|
||||
arch: string;
|
||||
}
|
||||
|
||||
// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit)
|
||||
// emits the given event. Optional data may be passed with the event.
|
||||
@ -72,6 +78,10 @@ export function LogWarning(message: string): void;
|
||||
// Forces a reload by the main application as well as connected browsers.
|
||||
export function WindowReload(): void;
|
||||
|
||||
// [WindowReloadApp](https://wails.io/docs/reference/runtime/window#windowreloadapp)
|
||||
// Reloads the application frontend.
|
||||
export function WindowReloadApp(): void;
|
||||
|
||||
// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme)
|
||||
// *Windows only*
|
||||
// Sets window theme to system default (dark/light).
|
||||
@ -161,10 +171,18 @@ export function WindowUnminimise(): void;
|
||||
// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels.
|
||||
export function WindowSetRGBA(R: number, G: number, B: number, A: number): void;
|
||||
|
||||
// Navigates back to the application after navigating away
|
||||
export function NavigateBackToApp(): void;
|
||||
|
||||
// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl)
|
||||
// Opens the given URL in the system browser.
|
||||
export function BrowserOpenURL(url: string): void;
|
||||
|
||||
// []()
|
||||
//
|
||||
export function Environment(): EnvironmentInfo;
|
||||
|
||||
|
||||
// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit)
|
||||
// Quits the application.
|
||||
export function Quit(): void;
|
||||
|
@ -61,6 +61,10 @@ export function WindowReload() {
|
||||
window.runtime.WindowReload();
|
||||
}
|
||||
|
||||
export function WindowReloadApp() {
|
||||
window.runtime.WindowReloadApp();
|
||||
}
|
||||
|
||||
export function WindowSetSystemDefaultTheme() {
|
||||
window.runtime.WindowSetSystemDefaultTheme();
|
||||
}
|
||||
@ -90,7 +94,7 @@ export function WindowUnfullscreen() {
|
||||
}
|
||||
|
||||
export function WindowGetSize() {
|
||||
window.runtime.WindowGetSize();
|
||||
return window.runtime.WindowGetSize();
|
||||
}
|
||||
|
||||
export function WindowSetSize(width, height) {
|
||||
@ -110,7 +114,7 @@ export function WindowSetPosition(x, y) {
|
||||
}
|
||||
|
||||
export function WindowGetPosition() {
|
||||
window.runtime.WindowGetPosition();
|
||||
return window.runtime.WindowGetPosition();
|
||||
}
|
||||
|
||||
export function WindowHide() {
|
||||
@ -149,6 +153,10 @@ export function BrowserOpenURL(url) {
|
||||
window.runtime.BrowserOpenURL(url);
|
||||
}
|
||||
|
||||
export function Environment() {
|
||||
return window.runtime.Environment();
|
||||
}
|
||||
|
||||
export function Quit() {
|
||||
window.runtime.Quit();
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ func CreateApp(appoptions *options.App) (*App, error) {
|
||||
}
|
||||
eventHandler := runtime.NewEvents(myLogger)
|
||||
ctx = context.WithValue(ctx, "events", eventHandler)
|
||||
messageDispatcher := dispatcher.NewDispatcher(myLogger, appBindings, eventHandler)
|
||||
messageDispatcher := dispatcher.NewDispatcher(ctx, myLogger, appBindings, eventHandler)
|
||||
|
||||
// Create the frontends and register to event handler
|
||||
desktopFrontend := desktop.NewFrontend(ctx, appoptions, myLogger, appBindings, messageDispatcher)
|
||||
|
@ -85,8 +85,6 @@ func CreateApp(appoptions *options.App) (*App, error) {
|
||||
appBindings := binding.NewBindings(myLogger, appoptions.Bind, bindingExemptions)
|
||||
eventHandler := runtime.NewEvents(myLogger)
|
||||
ctx = context.WithValue(ctx, "events", eventHandler)
|
||||
messageDispatcher := dispatcher.NewDispatcher(myLogger, appBindings, eventHandler)
|
||||
|
||||
// Attach logger to context
|
||||
if debug {
|
||||
ctx = context.WithValue(ctx, "buildtype", "debug")
|
||||
@ -94,6 +92,7 @@ func CreateApp(appoptions *options.App) (*App, error) {
|
||||
ctx = context.WithValue(ctx, "buildtype", "production")
|
||||
}
|
||||
|
||||
messageDispatcher := dispatcher.NewDispatcher(ctx, myLogger, appBindings, eventHandler)
|
||||
appFrontend := desktop.NewFrontend(ctx, appoptions, myLogger, appBindings, messageDispatcher)
|
||||
eventHandler.AddFrontend(appFrontend)
|
||||
|
||||
|
@ -34,6 +34,8 @@ import (
|
||||
"github.com/wailsapp/wails/v2/pkg/options"
|
||||
)
|
||||
|
||||
const startURL = "wails://wails/"
|
||||
|
||||
var messageBuffer = make(chan string, 100)
|
||||
var requestBuffer = make(chan *request, 100)
|
||||
var callbackBuffer = make(chan uint, 10)
|
||||
@ -65,7 +67,7 @@ func NewFrontend(ctx context.Context, appoptions *options.App, myLogger *logger.
|
||||
dispatcher: dispatcher,
|
||||
ctx: ctx,
|
||||
}
|
||||
result.startURL, _ = url.Parse("wails://wails/")
|
||||
result.startURL, _ = url.Parse(startURL)
|
||||
|
||||
if _starturl, _ := ctx.Value("starturl").(*url.URL); _starturl != nil {
|
||||
result.startURL = _starturl
|
||||
@ -113,6 +115,10 @@ func (f *Frontend) WindowReload() {
|
||||
f.ExecJS("runtime.WindowReload();")
|
||||
}
|
||||
|
||||
func (f *Frontend) WindowReloadApp() {
|
||||
f.ExecJS(fmt.Sprintf("window.location.href = '%s';", startURL))
|
||||
}
|
||||
|
||||
func (f *Frontend) WindowSetSystemDefaultTheme() {
|
||||
return
|
||||
}
|
||||
|
@ -31,6 +31,8 @@ import (
|
||||
"github.com/wailsapp/wails/v2/pkg/options"
|
||||
)
|
||||
|
||||
const startURL = "wails://wails/"
|
||||
|
||||
type Frontend struct {
|
||||
|
||||
// Context
|
||||
@ -66,7 +68,7 @@ func NewFrontend(ctx context.Context, appoptions *options.App, myLogger *logger.
|
||||
dispatcher: dispatcher,
|
||||
ctx: ctx,
|
||||
}
|
||||
result.startURL, _ = url.Parse("wails://wails/")
|
||||
result.startURL, _ = url.Parse(startURL)
|
||||
|
||||
if _starturl, _ := ctx.Value("starturl").(*url.URL); _starturl != nil {
|
||||
result.startURL = _starturl
|
||||
@ -169,6 +171,10 @@ func (f *Frontend) WindowUnfullscreen() {
|
||||
f.mainWindow.UnFullscreen()
|
||||
}
|
||||
|
||||
func (f *Frontend) WindowReloadApp() {
|
||||
f.ExecJS(fmt.Sprintf("window.location.href = '%s';", startURL))
|
||||
}
|
||||
|
||||
func (f *Frontend) WindowShow() {
|
||||
f.mainWindow.Show()
|
||||
}
|
||||
|
@ -29,6 +29,8 @@ import (
|
||||
"github.com/wailsapp/wails/v2/pkg/options/windows"
|
||||
)
|
||||
|
||||
const startURL = "http://wails.localhost/"
|
||||
|
||||
type Frontend struct {
|
||||
|
||||
// Context
|
||||
@ -69,7 +71,7 @@ func NewFrontend(ctx context.Context, appoptions *options.App, myLogger *logger.
|
||||
}
|
||||
|
||||
// We currently can't use wails://wails/ as other platforms do, therefore we map the assets sever onto the following url.
|
||||
result.startURL, _ = url.Parse("http://wails.localhost/")
|
||||
result.startURL, _ = url.Parse(startURL)
|
||||
|
||||
if _starturl, _ := ctx.Value("starturl").(*url.URL); _starturl != nil {
|
||||
result.startURL = _starturl
|
||||
@ -209,6 +211,10 @@ func (f *Frontend) WindowFullscreen() {
|
||||
f.mainWindow.Fullscreen()
|
||||
}
|
||||
|
||||
func (f *Frontend) WindowReloadApp() {
|
||||
f.ExecJS(fmt.Sprintf("window.location.href = '%s';", startURL))
|
||||
}
|
||||
|
||||
func (f *Frontend) WindowUnfullscreen() {
|
||||
runtime.LockOSThread()
|
||||
if f.frontendOptions.Frameless && f.frontendOptions.DisableResize == false {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package dispatcher
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/wailsapp/wails/v2/internal/binding"
|
||||
"github.com/wailsapp/wails/v2/internal/frontend"
|
||||
@ -12,14 +13,16 @@ type Dispatcher struct {
|
||||
bindings *binding.Bindings
|
||||
events frontend.Events
|
||||
bindingsDB *binding.DB
|
||||
ctx context.Context
|
||||
}
|
||||
|
||||
func NewDispatcher(log *logger.Logger, bindings *binding.Bindings, events frontend.Events) *Dispatcher {
|
||||
func NewDispatcher(ctx context.Context, log *logger.Logger, bindings *binding.Bindings, events frontend.Events) *Dispatcher {
|
||||
return &Dispatcher{
|
||||
log: log,
|
||||
bindings: bindings,
|
||||
events: events,
|
||||
bindingsDB: bindings.DB(),
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ package dispatcher
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/wailsapp/wails/v2/pkg/runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/wailsapp/wails/v2/internal/frontend"
|
||||
@ -31,6 +32,8 @@ func (d *Dispatcher) processSystemCall(payload callMessage, sender frontend.Fron
|
||||
case "WindowGetSize":
|
||||
w, h := sender.WindowGetSize()
|
||||
return &size{w, h}, nil
|
||||
case "Environment":
|
||||
return runtime.Environment(d.ctx), nil
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown systemcall message: %s", payload.Name)
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ func (d *Dispatcher) mustAtoI(input string) int {
|
||||
|
||||
func (d *Dispatcher) processWindowMessage(message string, sender frontend.Frontend) (string, error) {
|
||||
if len(message) < 2 {
|
||||
return "", errors.New("Invalid Event Message: " + message)
|
||||
return "", errors.New("Invalid Window Message: " + message)
|
||||
}
|
||||
|
||||
switch message[1] {
|
||||
@ -56,6 +56,8 @@ func (d *Dispatcher) processWindowMessage(message string, sender frontend.Fronte
|
||||
go sender.WindowHide()
|
||||
case 'S':
|
||||
go sender.WindowShow()
|
||||
case 'R':
|
||||
go sender.WindowReloadApp()
|
||||
case 'r':
|
||||
var rgba options.RGBA
|
||||
err := json.Unmarshal([]byte(message[3:]), &rgba)
|
||||
|
@ -87,6 +87,7 @@ type Frontend interface {
|
||||
WindowUnfullscreen()
|
||||
WindowSetRGBA(col *options.RGBA)
|
||||
WindowReload()
|
||||
WindowReloadApp()
|
||||
WindowSetSystemDefaultTheme()
|
||||
WindowSetLightTheme()
|
||||
WindowSetDarkTheme()
|
||||
|
@ -10,7 +10,7 @@ The electron alternative for Go
|
||||
/* jshint esversion: 9 */
|
||||
import * as Log from './log';
|
||||
import {eventListeners, EventsEmit, EventsNotify, EventsOff, EventsOn, EventsOnce, EventsOnMultiple} from './events';
|
||||
import {Callback, callbacks} from './calls';
|
||||
import {Call, Callback, callbacks} from './calls';
|
||||
import {SetBindings} from "./bindings";
|
||||
import * as Window from "./window";
|
||||
import * as Browser from "./browser";
|
||||
@ -20,6 +20,10 @@ export function Quit() {
|
||||
window.WailsInvoke('Q');
|
||||
}
|
||||
|
||||
export function Environment() {
|
||||
return Call(":wails:Environment");
|
||||
}
|
||||
|
||||
// The JS runtime
|
||||
window.runtime = {
|
||||
...Log,
|
||||
@ -30,6 +34,7 @@ window.runtime = {
|
||||
EventsOnMultiple,
|
||||
EventsEmit,
|
||||
EventsOff,
|
||||
Environment,
|
||||
Quit
|
||||
};
|
||||
|
||||
@ -64,6 +69,10 @@ if (ENV === 0) {
|
||||
var dragTimeOut;
|
||||
var dragLastTime = 0;
|
||||
|
||||
function drag() {
|
||||
window.WailsInvoke("drag");
|
||||
}
|
||||
|
||||
// Setup drag handler
|
||||
// Based on code from: https://github.com/patr0nus/DeskGap
|
||||
window.addEventListener('mousedown', (e) => {
|
||||
@ -88,12 +97,10 @@ window.addEventListener('mousedown', (e) => {
|
||||
}
|
||||
}
|
||||
if (new Date().getTime() - dragLastTime < window.wails.flags.dbClickInterval) {
|
||||
clearTimeout(dragTimeOut)
|
||||
clearTimeout(dragTimeOut);
|
||||
break;
|
||||
}
|
||||
dragTimeOut = setTimeout(function () {
|
||||
window.WailsInvoke("drag");
|
||||
}, window.wails.flags.dbClickInterval)
|
||||
dragTimeOut = setTimeout(drag, window.wails.flags.dbClickInterval);
|
||||
dragLastTime = new Date().getTime();
|
||||
e.preventDefault();
|
||||
break;
|
||||
|
@ -17,16 +17,20 @@ export function WindowReload() {
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
export function WindowReloadApp() {
|
||||
window.WailsInvoke('WR');
|
||||
}
|
||||
|
||||
export function WindowSetSystemDefaultTheme() {
|
||||
window.WailsInvoke('WASDT');
|
||||
window.WailsInvoke('WASDT');
|
||||
}
|
||||
|
||||
export function WindowSetLightTheme() {
|
||||
window.WailsInvoke('WALT');
|
||||
window.WailsInvoke('WALT');
|
||||
}
|
||||
|
||||
export function WindowSetDarkTheme() {
|
||||
window.WailsInvoke('WADT');
|
||||
window.WailsInvoke('WADT');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -205,7 +209,7 @@ export function WindowUnminimise() {
|
||||
* @param {number} A Alpha
|
||||
*/
|
||||
export function WindowSetRGBA(R, G, B, A) {
|
||||
let rgba = JSON.stringify({r:R || 0, g:G || 0, b:B || 0, a:A || 255});
|
||||
let rgba = JSON.stringify({r: R || 0, g: G || 0, b: B || 0, a: A || 255});
|
||||
window.WailsInvoke('Wr:' + rgba);
|
||||
}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -18,6 +18,12 @@ export interface Size {
|
||||
h: number;
|
||||
}
|
||||
|
||||
// Environment information such as platform, buildtype, ...
|
||||
export interface EnvironmentInfo {
|
||||
buildType: string;
|
||||
platform: string;
|
||||
arch: string;
|
||||
}
|
||||
|
||||
// [EventsEmit](https://wails.io/docs/reference/runtime/events#eventsemit)
|
||||
// emits the given event. Optional data may be passed with the event.
|
||||
@ -72,6 +78,10 @@ export function LogWarning(message: string): void;
|
||||
// Forces a reload by the main application as well as connected browsers.
|
||||
export function WindowReload(): void;
|
||||
|
||||
// [WindowReloadApp](https://wails.io/docs/reference/runtime/window#windowreloadapp)
|
||||
// Reloads the application frontend.
|
||||
export function WindowReloadApp(): void;
|
||||
|
||||
// [WindowSetSystemDefaultTheme](https://wails.io/docs/next/reference/runtime/window#windowsetsystemdefaulttheme)
|
||||
// *Windows only*
|
||||
// Sets window theme to system default (dark/light).
|
||||
@ -161,10 +171,18 @@ export function WindowUnminimise(): void;
|
||||
// Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels.
|
||||
export function WindowSetRGBA(R: number, G: number, B: number, A: number): void;
|
||||
|
||||
// Navigates back to the application after navigating away
|
||||
export function NavigateBackToApp(): void;
|
||||
|
||||
// [BrowserOpenURL](https://wails.io/docs/next/reference/runtime/browser#browseropenurl)
|
||||
// Opens the given URL in the system browser.
|
||||
export function BrowserOpenURL(url: string): void;
|
||||
|
||||
// []()
|
||||
//
|
||||
export function Environment(): EnvironmentInfo;
|
||||
|
||||
|
||||
// [Quit](https://wails.io/docs/next/reference/runtime/intro#quit)
|
||||
// Quits the application.
|
||||
export function Quit(): void;
|
||||
|
@ -61,6 +61,10 @@ export function WindowReload() {
|
||||
window.runtime.WindowReload();
|
||||
}
|
||||
|
||||
export function WindowReloadApp() {
|
||||
window.runtime.WindowReloadApp();
|
||||
}
|
||||
|
||||
export function WindowSetSystemDefaultTheme() {
|
||||
window.runtime.WindowSetSystemDefaultTheme();
|
||||
}
|
||||
@ -90,7 +94,7 @@ export function WindowUnfullscreen() {
|
||||
}
|
||||
|
||||
export function WindowGetSize() {
|
||||
window.runtime.WindowGetSize();
|
||||
return window.runtime.WindowGetSize();
|
||||
}
|
||||
|
||||
export function WindowSetSize(width, height) {
|
||||
@ -110,7 +114,7 @@ export function WindowSetPosition(x, y) {
|
||||
}
|
||||
|
||||
export function WindowGetPosition() {
|
||||
window.runtime.WindowGetPosition();
|
||||
return window.runtime.WindowGetPosition();
|
||||
}
|
||||
|
||||
export function WindowHide() {
|
||||
@ -149,6 +153,10 @@ export function BrowserOpenURL(url) {
|
||||
window.runtime.BrowserOpenURL(url);
|
||||
}
|
||||
|
||||
export function Environment() {
|
||||
return window.runtime.Environment();
|
||||
}
|
||||
|
||||
export function Quit() {
|
||||
window.runtime.Quit();
|
||||
}
|
||||
|
@ -69,6 +69,8 @@ func Quit(ctx context.Context) {
|
||||
|
||||
type EnvironmentInfo struct {
|
||||
BuildType string `json:"buildtype"`
|
||||
Platform string `json:"platform"`
|
||||
Arch string `json:"arch"`
|
||||
}
|
||||
|
||||
func Environment(ctx context.Context) EnvironmentInfo {
|
||||
@ -77,5 +79,7 @@ func Environment(ctx context.Context) EnvironmentInfo {
|
||||
if buildType != nil {
|
||||
result.BuildType = buildType.(string)
|
||||
}
|
||||
result.Platform = goruntime.GOOS
|
||||
result.Arch = goruntime.GOARCH
|
||||
return result
|
||||
}
|
||||
|
@ -36,6 +36,12 @@ func WindowReload(ctx context.Context) {
|
||||
appFrontend.WindowReload()
|
||||
}
|
||||
|
||||
// WindowReloadApp will reload the application
|
||||
func WindowReloadApp(ctx context.Context) {
|
||||
appFrontend := getFrontend(ctx)
|
||||
appFrontend.WindowReloadApp()
|
||||
}
|
||||
|
||||
func WindowSetSystemDefaultTheme(ctx context.Context) {
|
||||
appFrontend := getFrontend(ctx)
|
||||
appFrontend.WindowSetSystemDefaultTheme()
|
||||
|
@ -41,7 +41,16 @@ Go Signature: `WindowReload(ctx context.Context)`
|
||||
|
||||
JS Signature: `WindowReload()`
|
||||
|
||||
Performs a "reload" (Reloads index.html)
|
||||
Performs a "reload" (Reloads current page).
|
||||
|
||||
### WindowReloadApp
|
||||
Go Signature: `WindowReloadApp(ctx context.Context)`
|
||||
|
||||
JS Signature: `WindowReloadApp()`
|
||||
|
||||
Reloads the application frontend.
|
||||
|
||||
### WindowSetSy
|
||||
|
||||
### WindowSetSystemDefaultTheme
|
||||
Go Signature: `WindowSetSystemDefaultTheme(ctx context.Context)`
|
||||
|
Loading…
Reference in New Issue
Block a user