mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 19:50:15 +08:00
[windows] Support drawing a frame for frameless to support hiding the titlebar
This commit is contained in:
parent
ec1a535acb
commit
47d783291d
@ -34,6 +34,9 @@ func NewWindow(parent winc.Controller, appoptions *options.App) *Window {
|
|||||||
var dwStyle = w32.WS_OVERLAPPEDWINDOW
|
var dwStyle = w32.WS_OVERLAPPEDWINDOW
|
||||||
if appoptions.Frameless {
|
if appoptions.Frameless {
|
||||||
dwStyle = w32.WS_POPUP
|
dwStyle = w32.WS_POPUP
|
||||||
|
if winoptions := appoptions.Windows; winoptions != nil && winoptions.EnableFramelessBorder {
|
||||||
|
dwStyle |= w32.WS_BORDER
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
winc.RegClassOnlyOnce("wailsWindow")
|
winc.RegClassOnlyOnce("wailsWindow")
|
||||||
|
@ -5,4 +5,7 @@ type Options struct {
|
|||||||
WebviewIsTransparent bool
|
WebviewIsTransparent bool
|
||||||
WindowIsTranslucent bool
|
WindowIsTranslucent bool
|
||||||
DisableWindowIcon bool
|
DisableWindowIcon bool
|
||||||
|
|
||||||
|
// Draw a border around the window, even if the window is frameless
|
||||||
|
EnableFramelessBorder bool
|
||||||
}
|
}
|
||||||
|
@ -41,9 +41,10 @@ func main() {
|
|||||||
app,
|
app,
|
||||||
},
|
},
|
||||||
Windows: &windows.Options{
|
Windows: &windows.Options{
|
||||||
WebviewIsTransparent: false,
|
WebviewIsTransparent: false,
|
||||||
WindowIsTranslucent: false,
|
WindowIsTranslucent: false,
|
||||||
DisableWindowIcon: false,
|
DisableWindowIcon: false,
|
||||||
|
EnableFramelessBorder: false,
|
||||||
},
|
},
|
||||||
Mac: &mac.Options{
|
Mac: &mac.Options{
|
||||||
TitleBar: &mac.TitleBar{
|
TitleBar: &mac.TitleBar{
|
||||||
@ -316,8 +317,16 @@ Name: DisableWindowIcon
|
|||||||
|
|
||||||
Type: bool
|
Type: bool
|
||||||
|
|
||||||
Setting this to true will remove the icon in the top left corner of the title bar.
|
Setting this to `true` will remove the icon in the top left corner of the title bar.
|
||||||
|
|
||||||
|
### EnableFramelessBorder
|
||||||
|
|
||||||
|
Name: EnableFramelessBorder
|
||||||
|
|
||||||
|
Type: bool
|
||||||
|
|
||||||
|
Setting this to `true` will add a border around the window if [Frameless](#Frameless) has been activated.
|
||||||
|
This allows hiding the title bar but still having a border around the window.
|
||||||
|
|
||||||
## Mac Specific Options
|
## Mac Specific Options
|
||||||
|
|
||||||
|
@ -40,9 +40,10 @@ func main() {
|
|||||||
app,
|
app,
|
||||||
},
|
},
|
||||||
Windows: &windows.Options{
|
Windows: &windows.Options{
|
||||||
WebviewIsTransparent: false,
|
WebviewIsTransparent: false,
|
||||||
WindowIsTranslucent: false,
|
WindowIsTranslucent: false,
|
||||||
DisableWindowIcon: false,
|
DisableWindowIcon: false,
|
||||||
|
EnableFramelessBorder: false,
|
||||||
},
|
},
|
||||||
Mac: &mac.Options{
|
Mac: &mac.Options{
|
||||||
TitleBar: &mac.TitleBar{
|
TitleBar: &mac.TitleBar{
|
||||||
|
Loading…
Reference in New Issue
Block a user