Window 窗口
这些方法可以控制应用程序窗口。
WindowSetTitle 窗口标题
设置窗口标题栏中的文本。
Go: WindowSetTitle(ctx context.Context, title string)
JS: WindowSetTitle(title: string)
WindowFullscreen 窗口全屏
使窗口全屏。
Go: WindowFullscreen(ctx context.Context)
JS: WindowFullscreen()
WindowUnfullscreen 窗口取消全屏
恢复全屏之前的先前窗口尺寸和位置。
Go: WindowUnfullscreen(ctx context.Context)
JS: WindowUnfullscreen()
WindowIsFullscreen 窗口是否全屏
如果窗口是全屏的,则返回 true。
Go: WindowIsFullscreen(ctx context.Context) bool
JS: WindowIsFullscreen() Promise<boolean>
WindowCenter 窗口居中
使窗口在当前窗口所在的监视器上居中。
Go: WindowCenter(ctx context.Context)
JS: WindowCenter()
WindowExecJS 窗口执行JS代码
在窗口中执行任意 JS 代码。
此方法在浏览器中异步运行代码并立即返回。 如果脚本导致任何错误,它们将只在浏览器控制台中可用。
Go: WindowExecJS(ctx context.Context, js string)
WindowReload 窗口重新加载
执行“重新加载”(重新加载当前页面)。
Go: WindowReload(ctx context.Context)
JS: WindowReload()
WindowReloadApp 重新加载应用程序前端。
重新加载应用程序前端。
Go: WindowReloadApp(ctx context.Context)
JS: WindowReloadApp()
WindowSetSystemDefaultTheme 窗口设置系统默认主题
仅限 Windows。
Go: WindowSetSystemDefaultTheme(ctx context.Context)
JS: WindowSetSystemDefaultTheme()
将窗口主题设置为系统默认值(暗/亮)。
WindowSetLightTheme 窗口设置浅色主题
仅限 Windows。
Go: WindowSetLightTheme(ctx context.Context)
JS: WindowSetLightTheme()
将窗口主题设置为浅色。
WindowSetDarkTheme 窗口设置深色主题
仅限 Windows。
Go: WindowSetDarkTheme(ctx context.Context)
JS: WindowSetDarkTheme()
将窗口主题设置为深色。
WindowShow 显示窗口
显示窗口,如果它当前是隐藏的。
Go: WindowShow(ctx context.Context)
JS: WindowShow()
WindowShow 隐藏窗口
如果当前可见,则隐藏窗口。
Go: WindowHide(ctx context.Context)
JS: WindowHide()