mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 22:55:48 +01:00
[v3 windows] Implement start x/y + parent window for dialogs
This commit is contained in:
parent
294a2c701e
commit
671dc2aa3a
5 changed files with 37 additions and 22 deletions
38
v3/STATUS.md
38
v3/STATUS.md
|
|
@ -89,12 +89,12 @@ Webview Window Interface Methods
|
|||
|
||||
| Feature | Windows | Linux | Mac | Notes |
|
||||
|----------|---------|-------|-----|-------|
|
||||
| Info | | | Y | |
|
||||
| Warning | | | Y | |
|
||||
| Error | | | Y | |
|
||||
| Question | | | Y | |
|
||||
| OpenFile | | | Y | |
|
||||
| SaveFile | | | Y | |
|
||||
| Info | Y | | Y | |
|
||||
| Warning | Y | | Y | |
|
||||
| Error | Y | | Y | |
|
||||
| Question | Y | | Y | |
|
||||
| OpenFile | Y | | Y | |
|
||||
| SaveFile | Y | | Y | |
|
||||
|
||||
### Clipboard
|
||||
|
||||
|
|
@ -157,7 +157,7 @@ An 'X' indicates that the option is not supported by the platform.
|
|||
|
||||
| Feature | Windows | Linux | Mac | Notes |
|
||||
|---------------------------------|---------|-------|-----|--------------------------------------------|
|
||||
| Name | | | | |
|
||||
| Name | Y | | | |
|
||||
| Title | Y | | | |
|
||||
| Width | Y | | | |
|
||||
| Height | Y | | | |
|
||||
|
|
@ -176,10 +176,10 @@ An 'X' indicates that the option is not supported by the platform.
|
|||
| HTML | | | | |
|
||||
| JS | | | | |
|
||||
| CSS | | | | |
|
||||
| X | | | | |
|
||||
| Y | | | | |
|
||||
| X | Y | | | |
|
||||
| Y | Y | | | |
|
||||
| HideOnClose | Y | | | |
|
||||
| FullscreenButtonEnabled | | | | |
|
||||
| FullscreenButtonEnabled | Y | | | |
|
||||
| Hidden | Y | | | |
|
||||
| EnableFraudulentWebsiteWarnings | | | | |
|
||||
| Zoom | | | | |
|
||||
|
|
@ -204,7 +204,7 @@ To log or not to log? System logger vs custom logger.
|
|||
| Icon | Y | | Y | Windows has default icons for light/dark mode & supports PNG or ICO. |
|
||||
| Label | - | | Y | |
|
||||
| Label (ANSI Codes) | - | | | |
|
||||
| Menu | | | Y | |
|
||||
| Menu | Y | | Y | |
|
||||
|
||||
## Cross Platform Events
|
||||
|
||||
|
|
@ -264,14 +264,14 @@ Built-in plugin support:
|
|||
|
||||
## Packaging
|
||||
|
||||
| | Windows | Linux | Mac | Notes |
|
||||
|-----------------|---------|-------|-----|-------|
|
||||
| Icon Generation | | | Y | |
|
||||
| Icon Embedding | | | Y | |
|
||||
| Info.plist | | | Y | |
|
||||
| NSIS Installer | | | - | |
|
||||
| Mac bundle | | | Y | |
|
||||
| Windows exe | | | - | |
|
||||
| | Windows | Linux | Mac | Notes |
|
||||
|-----------------|---------|-------|-----|-------|
|
||||
| Icon Generation | | | Y | |
|
||||
| Icon Embedding | | | Y | |
|
||||
| Info.plist | - | | Y | |
|
||||
| NSIS Installer | | | - | |
|
||||
| Mac bundle | | | Y | |
|
||||
| Windows exe | | | - | |
|
||||
|
||||
## Frameless Windows
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@ module github.com/wailsapp/wails/v3
|
|||
go 1.19
|
||||
|
||||
require (
|
||||
github.com/go-ole/go-ole v1.2.6
|
||||
github.com/go-task/task/v3 v3.20.0
|
||||
github.com/google/go-cmp v0.5.9
|
||||
github.com/google/uuid v1.3.0
|
||||
github.com/jackmordaunt/icns/v2 v2.2.1
|
||||
github.com/json-iterator/go v1.1.12
|
||||
github.com/leaanthony/clir v1.6.0
|
||||
|
|
@ -28,7 +30,6 @@ require (
|
|||
github.com/dustin/go-humanize v1.0.0 // indirect
|
||||
github.com/fatih/color v1.13.0 // indirect
|
||||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
github.com/gookit/color v1.5.2 // indirect
|
||||
github.com/joho/godotenv v1.4.0 // indirect
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25Kn
|
|||
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
|
||||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
|
||||
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
|
||||
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
|
||||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I=
|
||||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
|
||||
github.com/go-task/task/v3 v3.20.0 h1:pTavuhP+AiEpKLzh5I6Lja9Ux7ypYO5QMsEPTbhYEDc=
|
||||
|
|
@ -167,6 +169,7 @@ golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
|
|||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
|
|
|
|||
|
|
@ -80,6 +80,13 @@ func (m *windowOpenFileDialog) show() ([]string, error) {
|
|||
Folder: defaultFolder,
|
||||
}
|
||||
|
||||
if m.dialog.window != nil {
|
||||
config.ParentWindowHandle, err = m.dialog.window.NativeWindowHandle()
|
||||
if err != nil {
|
||||
w32.Fatal(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
var result []string
|
||||
if m.dialog.allowsMultipleSelection {
|
||||
temp, err := showCfdDialog(
|
||||
|
|
|
|||
|
|
@ -97,13 +97,17 @@ func (w *windowsWebviewWindow) run() {
|
|||
if options.AlwaysOnTop {
|
||||
exStyle |= w32.WS_EX_TOPMOST
|
||||
}
|
||||
|
||||
var startX, _ = lo.Coalesce(options.X, w32.CW_USEDEFAULT)
|
||||
var startY, _ = lo.Coalesce(options.Y, w32.CW_USEDEFAULT)
|
||||
|
||||
w.hwnd = w32.CreateWindowEx(
|
||||
exStyle,
|
||||
windowClassName,
|
||||
w32.MustStringToUTF16Ptr(options.Title),
|
||||
w32.WS_OVERLAPPEDWINDOW,
|
||||
w32.CW_USEDEFAULT,
|
||||
w32.CW_USEDEFAULT,
|
||||
startX,
|
||||
startY,
|
||||
options.Width,
|
||||
options.Height,
|
||||
0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue