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

[v2] Add "AlwaysOnTop" option

This commit is contained in:
Lea Anthony 2021-10-13 08:02:35 +11:00
parent d47b3734af
commit e0e4c0ae11
3 changed files with 12 additions and 0 deletions

View File

@ -26,6 +26,9 @@ func NewWindow(parent winc.Controller, options *options.App) *Window {
var exStyle int
if options.Windows != nil {
exStyle = w32.WS_EX_CONTROLPARENT | w32.WS_EX_APPWINDOW
if options.AlwaysOnTop {
exStyle |= w32.WS_EX_TOPMOST
}
if options.Windows.WindowIsTranslucent {
exStyle |= w32.WS_EX_NOREDIRECTIONBITMAP
}

View File

@ -26,6 +26,7 @@ type App struct {
MaxHeight int
StartHidden bool
HideWindowOnClose bool
AlwaysOnTop bool
RGBA *RGBA
Assets embed.FS
Menu *menu.Menu

View File

@ -168,6 +168,14 @@ Example: 0xFF000088 - Red at 50% transparency
This value is the RGBA value to set the window by default.
Default: 0xFFFFFFFF.
### AlwaysOnTop
Name: AlwaysOnTop
Type: bool
Indicates that the window should stay above other windows when losing focus.
### Assets
Name: Assets