mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 13:22:55 +08:00
Fix non-windows build issues
This commit is contained in:
parent
c937c3bd8b
commit
ab06920e74
@ -135,7 +135,7 @@ func main() {
|
||||
})
|
||||
sizeMenu.Add("Set Max Size (600,600)").OnClick(func(ctx *application.Context) {
|
||||
currentWindow(func(w *application.WebviewWindow) {
|
||||
w.SetFullscreenButtonEnabled(false)
|
||||
w.SetMaximiseButtonState(application.ButtonDisabled)
|
||||
w.SetMaxSize(600, 600)
|
||||
})
|
||||
})
|
||||
@ -155,7 +155,7 @@ func main() {
|
||||
sizeMenu.Add("Reset Max Size").OnClick(func(ctx *application.Context) {
|
||||
currentWindow(func(w *application.WebviewWindow) {
|
||||
w.SetMaxSize(0, 0)
|
||||
w.SetFullscreenButtonEnabled(true)
|
||||
w.SetMaximiseButtonState(application.ButtonEnabled)
|
||||
})
|
||||
})
|
||||
positionMenu := menu.AddSubmenu("Position")
|
||||
|
@ -3,7 +3,6 @@ package main
|
||||
import (
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"github.com/wailsapp/wails/v3/pkg/w32"
|
||||
"log"
|
||||
"math/rand"
|
||||
"runtime"
|
||||
@ -16,6 +15,11 @@ import (
|
||||
"github.com/wailsapp/wails/v3/pkg/application"
|
||||
)
|
||||
|
||||
// This is a stub for non-windows platforms
|
||||
var getExStyle = func() int {
|
||||
return 0
|
||||
}
|
||||
|
||||
func main() {
|
||||
app := application.New(application.Options{
|
||||
Name: "WebviewWindow Demo",
|
||||
@ -138,7 +142,7 @@ func main() {
|
||||
app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
|
||||
Windows: application.WindowsWindow{
|
||||
DisableMenu: true,
|
||||
ExStyle: w32.WS_EX_TOOLWINDOW | w32.WS_EX_NOREDIRECTIONBITMAP | w32.WS_EX_TOPMOST,
|
||||
ExStyle: getExStyle(),
|
||||
},
|
||||
}).
|
||||
SetTitle("WebviewWindow "+strconv.Itoa(windowCounter)).
|
||||
|
11
v3/examples/window/windows.go
Normal file
11
v3/examples/window/windows.go
Normal file
@ -0,0 +1,11 @@
|
||||
//go:build windows
|
||||
|
||||
package main
|
||||
|
||||
import "github.com/wailsapp/wails/v3/pkg/w32"
|
||||
|
||||
func init() {
|
||||
getExStyle = func() int {
|
||||
return w32.WS_EX_TOOLWINDOW | w32.WS_EX_NOREDIRECTIONBITMAP | w32.WS_EX_TOPMOST
|
||||
}
|
||||
}
|
@ -224,7 +224,7 @@ func main() {
|
||||
})
|
||||
sizeMenu.Add("Set Max Size (600,600)").OnClick(func(ctx *application.Context) {
|
||||
currentWindow(func(w *application.WebviewWindow) {
|
||||
w.SetFullscreenButtonEnabled(false)
|
||||
w.SetMaximiseButtonState(application.ButtonDisabled)
|
||||
w.SetMaxSize(600, 600)
|
||||
})
|
||||
})
|
||||
@ -244,7 +244,7 @@ func main() {
|
||||
sizeMenu.Add("Reset Max Size").OnClick(func(ctx *application.Context) {
|
||||
currentWindow(func(w *application.WebviewWindow) {
|
||||
w.SetMaxSize(0, 0)
|
||||
w.SetFullscreenButtonEnabled(true)
|
||||
w.SetMaximiseButtonState(application.ButtonEnabled)
|
||||
})
|
||||
})
|
||||
positionMenu := menu.AddSubmenu("Position")
|
||||
|
Loading…
Reference in New Issue
Block a user