Fensterposition fix
This commit is contained in:
parent
63f510dcf8
commit
033073970d
42
main.go
42
main.go
|
@ -133,7 +133,11 @@ func main() {
|
|||
// If several displays, move the window to the second display
|
||||
var displays = a.Displays()
|
||||
if len(displays) > 1 {
|
||||
wFrontend.MoveInDisplay(displays[1], 50, 50)
|
||||
if displays[1].IsPrimary() {
|
||||
wFrontend.MoveInDisplay(displays[0], 50, 50)
|
||||
} else {
|
||||
wFrontend.MoveInDisplay(displays[1], 50, 50)
|
||||
}
|
||||
wFrontend.Maximize()
|
||||
}
|
||||
|
||||
|
@ -154,40 +158,4 @@ func main() {
|
|||
|
||||
// Blocking pattern
|
||||
a.Wait()
|
||||
|
||||
|
||||
// Initialize astilectron
|
||||
/*var a, _ = astilectron.New(astilectron.Options{
|
||||
AppName: "Konfi@Castle Kasino Kasse",
|
||||
AppIconDefaultPath: "<your .png icon>",
|
||||
AppIconDarwinPath: "<your .icns icon>",
|
||||
BaseDirectoryPath: "<where you want the provisioner to install the dependencies>",
|
||||
})
|
||||
defer a.Close()
|
||||
|
||||
// Start astilectron
|
||||
a.Start()
|
||||
|
||||
// Create a new window
|
||||
var wAdmin, _ = a.NewWindow("http://" + SiteConf.Interface + "/admin", &astilectron.WindowOptions{
|
||||
Center: astilectron.PtrBool(true),
|
||||
Height: astilectron.PtrInt(800),
|
||||
Width: astilectron.PtrInt(1300),
|
||||
})
|
||||
wAdmin.Create()
|
||||
|
||||
// Create a new window
|
||||
var wFrontend, _ = a.NewWindow("http://" + SiteConf.Interface, &astilectron.WindowOptions{
|
||||
Center: astilectron.PtrBool(true),
|
||||
Height: astilectron.PtrInt(600),
|
||||
Width: astilectron.PtrInt(600),
|
||||
})
|
||||
wFrontend.Create()
|
||||
|
||||
// If several displays, move the window to the second display
|
||||
var displays = a.Displays()
|
||||
if len(displays) > 1 {
|
||||
wFrontend.MoveInDisplay(displays[1], 50, 50)
|
||||
wFrontend.Maximize()
|
||||
}*/
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue