mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 22:00:19 +08:00
[v2] Add "AlwaysOnTop" option
This commit is contained in:
parent
d47b3734af
commit
e0e4c0ae11
@ -26,6 +26,9 @@ func NewWindow(parent winc.Controller, options *options.App) *Window {
|
|||||||
var exStyle int
|
var exStyle int
|
||||||
if options.Windows != nil {
|
if options.Windows != nil {
|
||||||
exStyle = w32.WS_EX_CONTROLPARENT | w32.WS_EX_APPWINDOW
|
exStyle = w32.WS_EX_CONTROLPARENT | w32.WS_EX_APPWINDOW
|
||||||
|
if options.AlwaysOnTop {
|
||||||
|
exStyle |= w32.WS_EX_TOPMOST
|
||||||
|
}
|
||||||
if options.Windows.WindowIsTranslucent {
|
if options.Windows.WindowIsTranslucent {
|
||||||
exStyle |= w32.WS_EX_NOREDIRECTIONBITMAP
|
exStyle |= w32.WS_EX_NOREDIRECTIONBITMAP
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ type App struct {
|
|||||||
MaxHeight int
|
MaxHeight int
|
||||||
StartHidden bool
|
StartHidden bool
|
||||||
HideWindowOnClose bool
|
HideWindowOnClose bool
|
||||||
|
AlwaysOnTop bool
|
||||||
RGBA *RGBA
|
RGBA *RGBA
|
||||||
Assets embed.FS
|
Assets embed.FS
|
||||||
Menu *menu.Menu
|
Menu *menu.Menu
|
||||||
|
@ -168,6 +168,14 @@ Example: 0xFF000088 - Red at 50% transparency
|
|||||||
This value is the RGBA value to set the window by default.
|
This value is the RGBA value to set the window by default.
|
||||||
Default: 0xFFFFFFFF.
|
Default: 0xFFFFFFFF.
|
||||||
|
|
||||||
|
### AlwaysOnTop
|
||||||
|
|
||||||
|
Name: AlwaysOnTop
|
||||||
|
|
||||||
|
Type: bool
|
||||||
|
|
||||||
|
Indicates that the window should stay above other windows when losing focus.
|
||||||
|
|
||||||
### Assets
|
### Assets
|
||||||
|
|
||||||
Name: Assets
|
Name: Assets
|
||||||
|
Loading…
Reference in New Issue
Block a user