Fensterposition fix

This commit is contained in:
konrad 2017-09-02 16:17:02 +02:00 committed by kolaente
parent 63f510dcf8
commit 033073970d
1 changed files with 5 additions and 37 deletions

42
main.go
View File

@ -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()
}*/
}