mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 23:20:51 +08:00

* Add changelog. Fix zoom docs. Add Info.dev.plist info * Update build assets README.md * Update changelog * actions/checkout@v2 => v3 * Docs
224 lines
6.6 KiB
Plaintext
224 lines
6.6 KiB
Plaintext
---
|
||
sidebar_position: 4
|
||
---
|
||
|
||
# ウィンドウ
|
||
|
||
アプリケーションウィンドウを制御できるメソッド群です。
|
||
|
||
### WindowSetTitle
|
||
|
||
ウィンドウのタイトルバーにテキストを設定します。
|
||
|
||
Go: `WindowSetTitle(ctx context.Context, title string)`<br/> JS: `WindowSetTitle(title: string)`
|
||
|
||
### WindowFullscreen
|
||
|
||
ウィンドウをフルスクリーンにします。
|
||
|
||
Go: `WindowFullscreen(ctx context.Context)`<br/> JS: `WindowFullscreen()`
|
||
|
||
### WindowUnfullscreen
|
||
|
||
フルスクリーンにする前のウィンドウサイズおよび位置に戻します。
|
||
|
||
Go: `WindowUnfullscreen(ctx context.Context)`<br/> JS: `WindowUnfullscreen()`
|
||
|
||
### WindowIsFullscreen
|
||
|
||
ウィンドウがフルスクリーンの場合は、trueを返します。
|
||
|
||
Go: `WindowIsFullscreen(ctx context.Context) bool`<br/> JS: `WindowIsFullscreen() bool`
|
||
|
||
### WindowCenter
|
||
|
||
ウィンドウが現在表示されているモニターの中央に、ウィンドウを配置させます。
|
||
|
||
Go: `WindowReload(ctx context.Context)`<br/> JS: `WindowReload()`
|
||
|
||
### WindowExecJS
|
||
|
||
Executes arbitrary JS code in the window.
|
||
|
||
This method runs the code in the browser asynchronously and returns immediately. If the script causes any errors, they will only be available in the browser console.
|
||
|
||
Go: `WindowExecJS(ctx context.Context, js string)`
|
||
|
||
### WindowReload
|
||
|
||
リロードします。(現在表示されているページをリロード)
|
||
|
||
Go: `WindowReloadApp(ctx context.Context)`<br/> JS: `WindowReloadApp()`
|
||
|
||
### WindowReloadApp
|
||
|
||
アプリケーションフロントエンドをリロードします。
|
||
|
||
Go: `WindowSetSystemDefaultTheme(ctx context.Context)`<br/> JS: `WindowSetSystemDefaultTheme()`
|
||
|
||
### WindowSetSystemDefaultTheme
|
||
|
||
Windowsのみ使用可能。
|
||
|
||
Go: `WindowSetDarkTheme(ctx context.Context)`<br/> JS: `WindowSetDarkTheme()`
|
||
|
||
ウィンドウのテーマをシステムデフォルト(ダーク/ライト) に設定します。
|
||
|
||
### WindowSetLightTheme
|
||
|
||
Windowsのみ使用可能。
|
||
|
||
Go: `WindowSetLightTheme(ctx context.Context)`<br/> JS: `WindowSetLightTheme()`
|
||
|
||
ウィンドウのテーマをライトに設定します。
|
||
|
||
### WindowSetDarkTheme
|
||
|
||
Windowsのみ使用可能。
|
||
|
||
Go: `WindowShow(ctx context.Context)`<br/> JS: `WindowShow()`
|
||
|
||
ウィンドウのテーマをダークに設定します。
|
||
|
||
### WindowShow
|
||
|
||
ウィンドウが非表示になっている場合は、表示させます。
|
||
|
||
Go: `WindowHide(ctx context.Context)`<br/> JS: `WindowHide()`
|
||
|
||
### WindowHide
|
||
|
||
現在表示されているウィンドウを非表示にします。
|
||
|
||
Go: `WindowSetSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetSize(size: Size)`
|
||
|
||
### WindowIsNormal
|
||
|
||
ウィンドウが最小化、最大化、またはフルスクリーンになっていない場合、trueを返します。
|
||
|
||
Go: `WindowIsNormal(ctx context.Context) bool`<br/> JS: `WindowIsNormal() bool`
|
||
|
||
### WindowSetSize
|
||
|
||
ウィンドウの幅と高さを設定します。
|
||
|
||
Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetMaxSize(size: Size)`
|
||
|
||
### WindowGetSize
|
||
|
||
ウィンドウの幅と高さを取得します。
|
||
|
||
Go: `WindowGetSize(ctx context.Context) (width int, height int)`<br/> JS: `WindowGetSize() : Size`
|
||
|
||
### WindowSetMinSize
|
||
|
||
ウィンドウの最小サイズを設定します。 現在のウィンドウサイズが、指定された最小サイズよりも小さい場合、現在のウィンドウサイズは変更されます。
|
||
|
||
サイズを`0,0`に設定すると、サイズの制約が無効化されます。
|
||
|
||
Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`<br/> JS: `WindowSetAlwaysOnTop(b: Boolen)`
|
||
|
||
### WindowSetMaxSize
|
||
|
||
ウィンドウの最大サイズを設定します。 現在のウィンドウサイズが、指定された最大サイズよりも大きい場合、現在のウィンドウサイズは変更されます。
|
||
|
||
サイズを`0,0`に設定すると、サイズの制約が無効化されます。
|
||
|
||
Go: `WindowSetPosition(ctx context.Context, x int, y int)`<br/> JS: `WindowSetPosition(position: Position)`
|
||
|
||
### WindowSetAlwaysOnTop
|
||
|
||
ウィンドウを常に最前面に表示するかを切り替えます。
|
||
|
||
Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`<br/> JS: `WindowSetAlwaysOnTop(b: Boolen)`
|
||
|
||
### WindowSetPosition
|
||
|
||
現在ウィンドウが表示されているモニターに対する、相対的なウィンドウ位置を設定します。
|
||
|
||
Go: `WindowMaximise(ctx context.Context)`<br/> JS: `WindowMaximise()`
|
||
|
||
### WindowGetPosition
|
||
|
||
現在ウィンドウが表示されているモニターに対する、相対的なウィンドウ位置を取得します。
|
||
|
||
Go: `WindowGetPosition(ctx context.Context) (x int, y int)`<br/> JS: `WindowGetPosition() : Position`
|
||
|
||
### WindowMaximise
|
||
|
||
ウィンドウを最大化します。
|
||
|
||
Go: `WindowToggleMaximise(ctx context.Context)`<br/> JS: `WindowToggleMaximise()`
|
||
|
||
### WindowUnmaximise
|
||
|
||
ウィンドウの最大化を解除し、最大化する前のサイズおよび位置に戻します。
|
||
|
||
Go: `WindowMinimise(ctx context.Context)`<br/> JS: `WindowMinimise()`
|
||
|
||
### WindowIsMaximised
|
||
|
||
ウィンドウが最大化している場合はtrueを返します。
|
||
|
||
Go: `WindowIsMaximised(ctx context.Context) bool`<br/> JS: `WindowIsMaximised() bool`
|
||
|
||
### WindowToggleMaximise
|
||
|
||
最大化の状態を切り替えます。
|
||
|
||
Go: `WindowToggleMaximise(ctx context.Context)`<br/> JS: `WindowToggleMaximise()`
|
||
|
||
### WindowMinimise
|
||
|
||
ウィンドウを最小化します。
|
||
|
||
Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`<br/> JS: `WindowSetBackgroundColour(R, G, B, A)`
|
||
|
||
### WindowUnminimise
|
||
|
||
ウィンドウの最小化を解除し、最小化する前のサイズおよび位置に戻します。
|
||
|
||
Go: `WindowUnminimise(ctx context.Context)`<br/> JS: `WindowUnminimise()`
|
||
|
||
### WindowIsMinimised
|
||
|
||
ウィンドウが最小化している場合はtrueを返します。
|
||
|
||
Go: `WindowIsMinimised(ctx context.Context) bool`<br/> JS: `WindowIsMinimised() bool`
|
||
|
||
### WindowSetBackgroundColour
|
||
|
||
ウィンドウの背景色をRGBAカラー定義で設定します。 この色は、すべての透過ピクセルに対して表示されます。
|
||
|
||
R、G、B、Aの有効な値の範囲は0~255です。
|
||
|
||
:::info Windows
|
||
|
||
|
||
Windowsの場合、0または255のアルファ値(A) のみがサポートされています。 0以外の値を指定すると、すべて255とみなされます。
|
||
|
||
:::
|
||
|
||
|
||
Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`<br/> JS: `WindowSetBackgroundColour(R, G, B, A)`
|
||
|
||
## Typescript型定義
|
||
|
||
### Position
|
||
|
||
```ts
|
||
interface Position {
|
||
x: number;
|
||
y: number;
|
||
}
|
||
```
|
||
|
||
### Size
|
||
|
||
```ts
|
||
interface Size {
|
||
w: number;
|
||
h: number;
|
||
}
|
||
```
|