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

Rename WindowSetRGBA -> WindowSetBackgroundColour (#1506)

* Rename WindowSetRGBA -> WindowSetBackgroundColour

* Fix Typos
This commit is contained in:
Lea Anthony 2022-06-29 22:31:49 +10:00 committed by GitHub
parent 7141c972fd
commit 3e42d2da05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
52 changed files with 111 additions and 99 deletions

View File

@ -167,9 +167,9 @@ export function WindowMinimise(): void;
// Restores the window to the dimensions and position prior to minimising.
export function WindowUnminimise(): void;
// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba)
// [WindowSetBackgroundColour](https://wails.io/docs/reference/runtime/window#windowsetbackgroundcolour)
// 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;
export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void;
// [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl)
// Opens the given URL in the system browser.

View File

@ -145,8 +145,8 @@ export function WindowUnminimise() {
window.runtime.WindowUnminimise();
}
export function WindowSetRGBA(RGBA) {
window.runtime.WindowSetRGBA(RGBA);
export function WindowSetBackgroundColour(R, G, B, A) {
window.runtime.WindowSetBackgroundColour(R, G, B, A);
}
export function BrowserOpenURL(url) {

View File

@ -167,9 +167,9 @@ export function WindowMinimise(): void;
// Restores the window to the dimensions and position prior to minimising.
export function WindowUnminimise(): void;
// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba)
// [WindowSetBackgroundColour](https://wails.io/docs/reference/runtime/window#windowsetbackgroundcolour)
// 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;
export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void;
// [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl)
// Opens the given URL in the system browser.

View File

@ -145,8 +145,8 @@ export function WindowUnminimise() {
window.runtime.WindowUnminimise();
}
export function WindowSetRGBA(RGBA) {
window.runtime.WindowSetRGBA(RGBA);
export function WindowSetBackgroundColour(R, G, B, A) {
window.runtime.WindowSetBackgroundColour(R, G, B, A);
}
export function BrowserOpenURL(url) {

View File

@ -167,9 +167,9 @@ export function WindowMinimise(): void;
// Restores the window to the dimensions and position prior to minimising.
export function WindowUnminimise(): void;
// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba)
// [WindowSetBackgroundColour](https://wails.io/docs/reference/runtime/window#windowsetbackgroundcolour)
// 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;
export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void;
// [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl)
// Opens the given URL in the system browser.

View File

@ -145,8 +145,8 @@ export function WindowUnminimise() {
window.runtime.WindowUnminimise();
}
export function WindowSetRGBA(RGBA) {
window.runtime.WindowSetRGBA(RGBA);
export function WindowSetBackgroundColour(R, G, B, A) {
window.runtime.WindowSetBackgroundColour(R, G, B, A);
}
export function BrowserOpenURL(url) {

View File

@ -167,9 +167,9 @@ export function WindowMinimise(): void;
// Restores the window to the dimensions and position prior to minimising.
export function WindowUnminimise(): void;
// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba)
// [WindowSetBackgroundColour](https://wails.io/docs/reference/runtime/window#windowsetbackgroundcolour)
// 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;
export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void;
// [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl)
// Opens the given URL in the system browser.

View File

@ -145,8 +145,8 @@ export function WindowUnminimise() {
window.runtime.WindowUnminimise();
}
export function WindowSetRGBA(RGBA) {
window.runtime.WindowSetRGBA(RGBA);
export function WindowSetBackgroundColour(R, G, B, A) {
window.runtime.WindowSetBackgroundColour(R, G, B, A);
}
export function BrowserOpenURL(url) {

View File

@ -167,9 +167,9 @@ export function WindowMinimise(): void;
// Restores the window to the dimensions and position prior to minimising.
export function WindowUnminimise(): void;
// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba)
// [WindowSetBackgroundColour](https://wails.io/docs/reference/runtime/window#windowsetbackgroundcolour)
// 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;
export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void;
// [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl)
// Opens the given URL in the system browser.

View File

@ -145,8 +145,8 @@ export function WindowUnminimise() {
window.runtime.WindowUnminimise();
}
export function WindowSetRGBA(RGBA) {
window.runtime.WindowSetRGBA(RGBA);
export function WindowSetBackgroundColour(R, G, B, A) {
window.runtime.WindowSetBackgroundColour(R, G, B, A);
}
export function BrowserOpenURL(url) {

View File

@ -167,9 +167,9 @@ export function WindowMinimise(): void;
// Restores the window to the dimensions and position prior to minimising.
export function WindowUnminimise(): void;
// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba)
// [WindowSetBackgroundColour](https://wails.io/docs/reference/runtime/window#windowsetbackgroundcolour)
// 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;
export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void;
// [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl)
// Opens the given URL in the system browser.

View File

@ -145,8 +145,8 @@ export function WindowUnminimise() {
window.runtime.WindowUnminimise();
}
export function WindowSetRGBA(RGBA) {
window.runtime.WindowSetRGBA(RGBA);
export function WindowSetBackgroundColour(R, G, B, A) {
window.runtime.WindowSetBackgroundColour(R, G, B, A);
}
export function BrowserOpenURL(url) {

View File

@ -167,9 +167,9 @@ export function WindowMinimise(): void;
// Restores the window to the dimensions and position prior to minimising.
export function WindowUnminimise(): void;
// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba)
// [WindowSetBackgroundColour](https://wails.io/docs/reference/runtime/window#windowsetbackgroundcolour)
// 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;
export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void;
// [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl)
// Opens the given URL in the system browser.

View File

@ -145,8 +145,8 @@ export function WindowUnminimise() {
window.runtime.WindowUnminimise();
}
export function WindowSetRGBA(RGBA) {
window.runtime.WindowSetRGBA(RGBA);
export function WindowSetBackgroundColour(R, G, B, A) {
window.runtime.WindowSetBackgroundColour(R, G, B, A);
}
export function BrowserOpenURL(url) {

View File

@ -167,9 +167,9 @@ export function WindowMinimise(): void;
// Restores the window to the dimensions and position prior to minimising.
export function WindowUnminimise(): void;
// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba)
// [WindowSetBackgroundColour](https://wails.io/docs/reference/runtime/window#windowsetbackgroundcolour)
// 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;
export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void;
// [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl)
// Opens the given URL in the system browser.

View File

@ -145,8 +145,8 @@ export function WindowUnminimise() {
window.runtime.WindowUnminimise();
}
export function WindowSetRGBA(RGBA) {
window.runtime.WindowSetRGBA(RGBA);
export function WindowSetBackgroundColour(R, G, B, A) {
window.runtime.WindowSetBackgroundColour(R, G, B, A);
}
export function BrowserOpenURL(url) {

View File

@ -167,9 +167,9 @@ export function WindowMinimise(): void;
// Restores the window to the dimensions and position prior to minimising.
export function WindowUnminimise(): void;
// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba)
// [WindowSetBackgroundColour](https://wails.io/docs/reference/runtime/window#windowsetbackgroundcolour)
// 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;
export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void;
// [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl)
// Opens the given URL in the system browser.

View File

@ -145,8 +145,8 @@ export function WindowUnminimise() {
window.runtime.WindowUnminimise();
}
export function WindowSetRGBA(RGBA) {
window.runtime.WindowSetRGBA(RGBA);
export function WindowSetBackgroundColour(R, G, B, A) {
window.runtime.WindowSetBackgroundColour(R, G, B, A);
}
export function BrowserOpenURL(url) {

View File

@ -167,9 +167,9 @@ export function WindowMinimise(): void;
// Restores the window to the dimensions and position prior to minimising.
export function WindowUnminimise(): void;
// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba)
// [WindowSetBackgroundColour](https://wails.io/docs/reference/runtime/window#windowsetbackgroundcolour)
// 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;
export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void;
// [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl)
// Opens the given URL in the system browser.

View File

@ -145,8 +145,8 @@ export function WindowUnminimise() {
window.runtime.WindowUnminimise();
}
export function WindowSetRGBA(RGBA) {
window.runtime.WindowSetRGBA(RGBA);
export function WindowSetBackgroundColour(R, G, B, A) {
window.runtime.WindowSetBackgroundColour(R, G, B, A);
}
export function BrowserOpenURL(url) {

View File

@ -167,9 +167,9 @@ export function WindowMinimise(): void;
// Restores the window to the dimensions and position prior to minimising.
export function WindowUnminimise(): void;
// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba)
// [WindowSetBackgroundColour](https://wails.io/docs/reference/runtime/window#windowsetbackgroundcolour)
// 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;
export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void;
// [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl)
// Opens the given URL in the system browser.

View File

@ -145,8 +145,8 @@ export function WindowUnminimise() {
window.runtime.WindowUnminimise();
}
export function WindowSetRGBA(RGBA) {
window.runtime.WindowSetRGBA(RGBA);
export function WindowSetBackgroundColour(R, G, B, A) {
window.runtime.WindowSetBackgroundColour(R, G, B, A);
}
export function BrowserOpenURL(url) {

View File

@ -167,9 +167,9 @@ export function WindowMinimise(): void;
// Restores the window to the dimensions and position prior to minimising.
export function WindowUnminimise(): void;
// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba)
// [WindowSetBackgroundColour](https://wails.io/docs/reference/runtime/window#windowsetbackgroundcolour)
// 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;
export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void;
// [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl)
// Opens the given URL in the system browser.

View File

@ -145,8 +145,8 @@ export function WindowUnminimise() {
window.runtime.WindowUnminimise();
}
export function WindowSetRGBA(RGBA) {
window.runtime.WindowSetRGBA(RGBA);
export function WindowSetBackgroundColour(R, G, B, A) {
window.runtime.WindowSetBackgroundColour(R, G, B, A);
}
export function BrowserOpenURL(url) {

View File

@ -167,9 +167,9 @@ export function WindowMinimise(): void;
// Restores the window to the dimensions and position prior to minimising.
export function WindowUnminimise(): void;
// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba)
// [WindowSetBackgroundColour](https://wails.io/docs/reference/runtime/window#windowsetbackgroundcolour)
// 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;
export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void;
// [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl)
// Opens the given URL in the system browser.

View File

@ -145,8 +145,8 @@ export function WindowUnminimise() {
window.runtime.WindowUnminimise();
}
export function WindowSetRGBA(RGBA) {
window.runtime.WindowSetRGBA(RGBA);
export function WindowSetBackgroundColour(R, G, B, A) {
window.runtime.WindowSetBackgroundColour(R, G, B, A);
}
export function BrowserOpenURL(url) {

View File

@ -9,7 +9,7 @@ require (
github.com/go-git/go-billy/v5 v5.2.0 // indirect
github.com/go-git/go-git/v5 v5.3.0
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/google/uuid v1.1.2 // indirect
github.com/google/uuid v1.1.2
github.com/imdario/mergo v0.3.12
github.com/jackmordaunt/icns v1.0.0
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e
@ -37,15 +37,17 @@ require (
golang.org/x/tools v0.1.0
)
require github.com/bitfield/script v0.19.0
require (
github.com/bep/debounce v1.2.1
github.com/bitfield/script v0.19.0
github.com/go-ole/go-ole v1.2.6
)
require (
bitbucket.org/creachadair/shell v0.0.7 // indirect
github.com/Microsoft/go-winio v0.4.16 // indirect
github.com/bep/debounce v1.2.1 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
github.com/kr/pretty v0.3.0 // indirect

View File

@ -38,7 +38,6 @@ github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12 h1:PbK
github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw=
github.com/go-git/go-git/v5 v5.3.0 h1:8WKMtJR2j8RntEXR/uvTKagfEt4GYlwQ7mntE4+0GWc=
github.com/go-git/go-git/v5 v5.3.0/go.mod h1:xdX4bWJ48aOrdhnl2XqHYstHbbp6+LFS4r4X+lNVprw=
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
@ -48,7 +47,6 @@ github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=

View File

@ -16,6 +16,8 @@ func (a *App) Run() error {
return nil
}
func (a *App) Shutdown() {}
// CreateApp creates the app!
func CreateApp(_ *options.App) (*App, error) {
return nil, fmt.Errorf(`Wails applications will not build without the correct build tags.`)

View File

@ -16,6 +16,8 @@ func (a *App) Run() error {
return nil
}
func (a *App) Shutdown() {}
// CreateApp creates the app!
func CreateApp(_ *options.App) (*App, error) {
return nil, fmt.Errorf(`Wails applications will not build without the correct build tags.`)

View File

@ -17,6 +17,8 @@ func (a *App) Run() error {
return nil
}
func (a *App) Shutdown() {}
// CreateApp creates the app!
func CreateApp(_ *options.App) (*App, error) {
result := w32.MessageBox(0,

View File

@ -36,7 +36,7 @@ void Maximise(void* ctx);
void UnMaximise(void* ctx);
void Hide(void* ctx);
void Show(void* ctx);
void SetRGBA(void* ctx, int r, int g, int b, int a);
void SetBackgroundColour(void* ctx, int r, int g, int b, int a);
void ExecJS(void* ctx, const char*);
void Quit(void*);

View File

@ -81,10 +81,10 @@ void SetTitle(void* inctx, const char *title) {
}
void SetRGBA(void *inctx, int r, int g, int b, int a) {
void SetBackgroundColour(void *inctx, int r, int g, int b, int a) {
WailsContext *ctx = (__bridge WailsContext*) inctx;
ON_MAIN_THREAD(
[ctx SetRGBA:r :g :b :a];
[ctx SetBackgroundColour:r :g :b :a];
);
}

View File

@ -70,7 +70,7 @@
- (void) Maximise;
- (void) ToggleMaximise;
- (void) UnMaximise;
- (void) SetRGBA:(int)r :(int)g :(int)b :(int)a;
- (void) SetBackgroundColour:(int)r :(int)g :(int)b :(int)a;
- (void) HideMouse;
- (void) ShowMouse;
- (void) Hide;

View File

@ -299,7 +299,7 @@
[self.webview loadRequest:wkRequest];
}
- (void) SetRGBA:(int)r :(int)g :(int)b :(int)a {
- (void) SetBackgroundColour:(int)r :(int)g :(int)b :(int)a {
float red = r/255.0;
float green = g/255.0;
float blue = b/255.0;

View File

@ -217,11 +217,11 @@ func (f *Frontend) WindowSetMaxSize(width int, height int) {
f.mainWindow.SetMaxSize(width, height)
}
func (f *Frontend) WindowSetRGBA(col *options.RGBA) {
func (f *Frontend) WindowSetBackgroundColour(col *options.RGBA) {
if col == nil {
return
}
f.mainWindow.SetRGBA(col.R, col.G, col.B, col.A)
f.mainWindow.SetBackgroundColour(col.R, col.G, col.B, col.A)
}
func (f *Frontend) Quit() {

View File

@ -220,7 +220,7 @@ int main(int argc, const char * argv[]) {
int startsHidden = 0;
WailsContext *result = Create("OI OI!",400,400, frameless, resizable, fullscreen, fullSizeContent, hideTitleBar, titlebarAppearsTransparent, hideTitle, useToolbar, hideToolbarSeparator, webviewIsTransparent, alwaysOnTop, hideWindowOnClose, appearance, windowIsTranslucent, debug, windowStartState,
startsHidden, 400, 400, 600, 600);
SetRGBA(result, 255, 0, 0, 255);
SetBackgroundColour(result, 255, 0, 0, 255);
void *m = NewMenu("");
SetAbout(result, "Fake title", "I am a description", _Users_username_Pictures_SaltBae_png, _Users_username_Pictures_SaltBae_png_len);
// AddMenuByRole(result, 1);

View File

@ -93,7 +93,7 @@ func NewWindow(frontendOptions *options.App, debugMode bool) *Window {
}
if frontendOptions.BackgroundColour != nil {
result.SetRGBA(frontendOptions.BackgroundColour.R, frontendOptions.BackgroundColour.G, frontendOptions.BackgroundColour.B, frontendOptions.BackgroundColour.A)
result.SetBackgroundColour(frontendOptions.BackgroundColour.R, frontendOptions.BackgroundColour.G, frontendOptions.BackgroundColour.B, frontendOptions.BackgroundColour.A)
}
if frontendOptions.Mac != nil && frontendOptions.Mac.About != nil {
@ -129,8 +129,8 @@ func (w *Window) Quit() {
C.Quit(w.context)
}
func (w *Window) SetRGBA(r uint8, g uint8, b uint8, a uint8) {
C.SetRGBA(w.context, C.int(r), C.int(g), C.int(b), C.int(a))
func (w *Window) SetBackgroundColour(r uint8, g uint8, b uint8, a uint8) {
C.SetBackgroundColour(w.context, C.int(r), C.int(g), C.int(b), C.int(a))
}
func (w *Window) ExecJS(js string) {

View File

@ -209,11 +209,11 @@ func (f *Frontend) WindowSetMaxSize(width int, height int) {
f.mainWindow.SetMaxSize(width, height)
}
func (f *Frontend) WindowSetRGBA(col *options.RGBA) {
func (f *Frontend) WindowSetBackgroundColour(col *options.RGBA) {
if col == nil {
return
}
f.mainWindow.SetRGBA(col.R, col.G, col.B, col.A)
f.mainWindow.SetBackgroundColour(col.R, col.G, col.B, col.A)
}
func (f *Frontend) Quit() {

View File

@ -433,7 +433,7 @@ typedef struct RGBAOptions {
void *webview;
} RGBAOptions;
void setRGBA(void* data) {
void setBackgroundColour(void* data) {
RGBAOptions* options = (RGBAOptions*)data;
GdkRGBA colour = {options->r / 255.0, options->g / 255.0, options->b / 255.0, options->a / 255.0};
webkit_web_view_set_background_color(WEBKIT_WEB_VIEW(options->webview), &colour);
@ -638,7 +638,7 @@ func NewWindow(appoptions *options.App, debug bool) *Window {
// Set background colour
RGBA := appoptions.BackgroundColour
result.SetRGBA(RGBA.R, RGBA.G, RGBA.B, RGBA.A)
result.SetBackgroundColour(RGBA.R, RGBA.G, RGBA.B, RGBA.A)
// Setup window
result.SetKeepAbove(appoptions.AlwaysOnTop)
@ -779,7 +779,7 @@ func (w *Window) IsMaximised() bool {
return result > 0
}
func (w *Window) SetRGBA(r uint8, g uint8, b uint8, a uint8) {
func (w *Window) SetBackgroundColour(r uint8, g uint8, b uint8, a uint8) {
data := C.RGBAOptions{
r: C.uchar(r),
g: C.uchar(g),
@ -787,7 +787,7 @@ func (w *Window) SetRGBA(r uint8, g uint8, b uint8, a uint8) {
a: C.uchar(a),
webview: w.webview,
}
invokeOnMainThread(func() { C.setRGBA(unsafe.Pointer(&data)) })
invokeOnMainThread(func() { C.setBackgroundColour(unsafe.Pointer(&data)) })
}

View File

@ -307,7 +307,7 @@ func (f *Frontend) WindowSetMaxSize(width int, height int) {
f.mainWindow.SetMaxSize(width, height)
}
func (f *Frontend) WindowSetRGBA(col *options.RGBA) {
func (f *Frontend) WindowSetBackgroundColour(col *options.RGBA) {
if col == nil {
return
}
@ -399,7 +399,7 @@ func (f *Frontend) setupChromium() {
onFocus.Bind(f.onFocus)
// Set background colour
f.WindowSetRGBA(f.frontendOptions.BackgroundColour)
f.WindowSetBackgroundColour(f.frontendOptions.BackgroundColour)
chromium.SetGlobalPermission(edge.CoreWebView2PermissionStateAllow)
chromium.AddWebResourceRequestedFilter("*", edge.COREWEBVIEW2_WEB_RESOURCE_CONTEXT_ALL)

View File

@ -243,8 +243,8 @@ func (d *DevWebServer) WindowUnfullscreen() {
d.desktopFrontend.WindowUnfullscreen()
}
func (d *DevWebServer) WindowSetRGBA(col *options.RGBA) {
d.desktopFrontend.WindowSetRGBA(col)
func (d *DevWebServer) WindowSetBackgroundColour(col *options.RGBA) {
d.desktopFrontend.WindowSetBackgroundColour(col)
}
func (d *DevWebServer) MenuSetApplicationMenu(menu *menu.Menu) {

View File

@ -70,7 +70,7 @@ func (d *Dispatcher) processWindowMessage(message string, sender frontend.Fronte
if err != nil {
return "", err
}
go sender.WindowSetRGBA(&rgba)
go sender.WindowSetBackgroundColour(&rgba)
case 'M':
go sender.WindowMaximise()
case 't':

View File

@ -86,7 +86,7 @@ type Frontend interface {
WindowSetMaxSize(width int, height int)
WindowFullscreen()
WindowUnfullscreen()
WindowSetRGBA(col *options.RGBA)
WindowSetBackgroundColour(col *options.RGBA)
WindowReload()
WindowReloadApp()
WindowSetSystemDefaultTheme()

View File

@ -11,7 +11,7 @@ The electron alternative for Go
/* jshint esversion: 9 */
import { Call } from "./calls";
import {Call} from "./calls";
export function WindowReload() {
window.location.reload();
@ -213,7 +213,6 @@ export function WindowUnminimise() {
window.WailsInvoke('Wu');
}
/**
* Sets the background colour of the window
*
@ -223,8 +222,8 @@ export function WindowUnminimise() {
* @param {number} B Blue
* @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 });
export function WindowSetBackgroundColour(R, G, B, A) {
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

View File

@ -167,9 +167,9 @@ export function WindowMinimise(): void;
// Restores the window to the dimensions and position prior to minimising.
export function WindowUnminimise(): void;
// [WindowSetRGBA](https://wails.io/docs/reference/runtime/window#windowsetrgba)
// [WindowSetBackgroundColour](https://wails.io/docs/reference/runtime/window#windowsetbackgroundcolour)
// 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;
export function WindowSetBackgroundColour(R: number, G: number, B: number, A: number): void;
// [BrowserOpenURL](https://wails.io/docs/reference/runtime/browser#browseropenurl)
// Opens the given URL in the system browser.

View File

@ -145,8 +145,8 @@ export function WindowUnminimise() {
window.runtime.WindowUnminimise();
}
export function WindowSetRGBA(RGBA) {
window.runtime.WindowSetRGBA(RGBA);
export function WindowSetBackgroundColour(R, G, B, A) {
window.runtime.WindowSetBackgroundColour(R, G, B, A);
}
export function BrowserOpenURL(url) {

View File

@ -139,7 +139,8 @@ func WindowUnminimise(ctx context.Context) {
appFrontend.WindowUnminimise()
}
func WindowSetRGBA(ctx context.Context, R, G, B, A uint8) {
// WindowSetBackgroundColour sets the colour of the window background
func WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8) {
appFrontend := getFrontend(ctx)
col := &options.RGBA{
R: R,
@ -147,5 +148,5 @@ func WindowSetRGBA(ctx context.Context, R, G, B, A uint8) {
B: B,
A: A,
}
appFrontend.WindowSetRGBA(col)
appFrontend.WindowSetBackgroundColour(col)
}

View File

@ -184,10 +184,10 @@ JS Signature: `WindowUnminimise()`
Restores the window to the dimensions and position prior to minimising.
### WindowSetRGBA
Go Signature: `WindowSetRGBA(ctx context.Context, R, G, B, A uint8)`
### WindowSetBackgroundColour
Go Signature: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`
JS Signature: `WindowSetRGBA(R, G, B, A)`
JS Signature: `WindowSetBackgroundColour(R, G, B, A)`
Sets the background colour of the window to the given RGBA colour definition.
This colour will show through for all transparent pixels.