mirror of
https://github.com/taigrr/wails.git
synced 2026-04-02 05:08:54 -07:00
Merge branch 'v2-alpha' into 796-support-browseropenurl
This commit is contained in:
@@ -2,4 +2,5 @@
|
||||
|
||||
This branch contains WORK IN PROGRESS! There are no guarantees. Use at your peril!
|
||||
|
||||
This document will be updated as progress is made.
|
||||
This document will be updated as progress is made.
|
||||
|
||||
|
||||
@@ -38,6 +38,9 @@ func (d *Dispatcher) ProcessMessage(message string, sender frontend.Frontend) (s
|
||||
return d.processWindowMessage(message, sender)
|
||||
case 'B':
|
||||
return d.processBrowserMessage(message, sender)
|
||||
case 'Q':
|
||||
sender.Quit()
|
||||
return "", nil
|
||||
default:
|
||||
return "", errors.New("Unknown message from front end: " + message)
|
||||
}
|
||||
|
||||
@@ -71,8 +71,6 @@ func (d *Dispatcher) processWindowMessage(message string, sender frontend.Fronte
|
||||
w := d.mustAtoI(parts[0])
|
||||
h := d.mustAtoI(parts[1])
|
||||
go sender.WindowSetMinSize(w, h)
|
||||
case 'C':
|
||||
sender.Quit()
|
||||
default:
|
||||
d.log.Error("unknown Window message: %s", message)
|
||||
}
|
||||
|
||||
@@ -15,6 +15,11 @@ import { SetBindings } from "./bindings";
|
||||
import * as Window from "./window";
|
||||
import * as Browser from "./browser";
|
||||
|
||||
|
||||
export function Quit() {
|
||||
window.WailsInvoke('Q');
|
||||
}
|
||||
|
||||
// The JS runtime
|
||||
window.runtime = {
|
||||
...Log,
|
||||
@@ -25,6 +30,7 @@ window.runtime = {
|
||||
EventsOnMultiple,
|
||||
EventsEmit,
|
||||
EventsOff,
|
||||
Quit
|
||||
};
|
||||
|
||||
// Internal wails endpoints
|
||||
|
||||
@@ -185,12 +185,3 @@ export function WindowSetRGBA(RGBA) {
|
||||
window.WailsInvoke('Wr:' + rgba);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Close the Window
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
export function WindowClose() {
|
||||
window.WailsInvoke('WC');
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -14,9 +14,15 @@ import * as Events from './events';
|
||||
import * as Window from './window';
|
||||
import * as Browser from './browser';
|
||||
|
||||
export function Quit() {
|
||||
window.runtime.Quit();
|
||||
}
|
||||
|
||||
|
||||
export default {
|
||||
...Log,
|
||||
...Events,
|
||||
...Window,
|
||||
...Browser
|
||||
...Browser,
|
||||
Quit
|
||||
};
|
||||
@@ -71,11 +71,11 @@ interface runtime {
|
||||
|
||||
WindowUnminimise(): void
|
||||
|
||||
WindowSetRGBA(rgba: RGBA): void;
|
||||
|
||||
WindowClose(): void
|
||||
WindowSetRGBA(rgba: RGBA): void
|
||||
|
||||
BrowserOpenURL(): void
|
||||
|
||||
Quit(): void
|
||||
}
|
||||
|
||||
declare global {
|
||||
|
||||
@@ -185,12 +185,3 @@ export function WindowUnminimise() {
|
||||
export function WindowSetRGBA(RGBA) {
|
||||
window.runtime.WindowSetRGBA(RGBA);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the Window
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
export function WindowClose() {
|
||||
window.runtime.WindowClose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user