diff --git a/go.sum b/go.sum index 8f0823a..3544ad7 100644 --- a/go.sum +++ b/go.sum @@ -80,6 +80,7 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190808195139-e713427fea3f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200328031815-3db5fc6bac03 h1:XpToik3MpT5iW3iHgNwnh3a8QwugfomvxOlyDnaOils= golang.org/x/tools v0.0.0-20200328031815-3db5fc6bac03/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/keymap/orbweaver/orbweaver.go b/keymap/orbweaver/orbweaver.go index c2f5374..9f0c91f 100644 --- a/keymap/orbweaver/orbweaver.go +++ b/keymap/orbweaver/orbweaver.go @@ -21,7 +21,7 @@ func SaveIntoKeymap(mapped *PKM, file fyne.URIWriteCloser) { //LoadFile loads an orb func LoadFile(file fyne.URIReadCloser) *PKM { - mapped := &PKM{} + mapped := new(PKM) binary.Read(file, binary.LittleEndian, mapped) file.Close() return mapped diff --git a/orbbind.go b/orbbind.go index f2a402d..f271b70 100644 --- a/orbbind.go +++ b/orbbind.go @@ -16,7 +16,7 @@ func main() { window := ap.NewWindow("Orbweaver Rebinding") window.SetMaster() - omap := &orbweaver.PKM{} + omap := new(orbweaver.PKM) pages := make(map[string]baseui.PageWithBindings) pages["main"] = mainpage.NewMainPage(window, omap) pages["side"] = sidepage.NewSidePage(window, omap) diff --git a/ui/bind/popup.go b/ui/bind/popup.go index 205751f..0156516 100644 --- a/ui/bind/popup.go +++ b/ui/bind/popup.go @@ -6,7 +6,6 @@ import ( "fyne.io/fyne/layout" "fyne.io/fyne/widget" "github.com/minizbot2012/orbbind/keys" - "github.com/minizbot2012/orbbind/ui/baseui" ) //BindingInfo Genral data to use in a channel @@ -17,7 +16,6 @@ type BindingInfo struct { //Page Binding UI type Page struct { - baseui.DialogPage dev map[string]fyne.CanvasObject Bind BindingInfo window fyne.Window @@ -59,7 +57,7 @@ func (bp *Page) Create(bid string) fyne.CanvasObject { //NewBindPage Create a new bind popup func NewBindPage(bid int, w fyne.Window, def uint16) *Page { - p := &Page{} + p := new(Page) p.window = w p.Bind.Bindid = bid p.Bind.Bound = def diff --git a/ui/mainpage/mainpage.go b/ui/mainpage/mainpage.go index 95e6ba4..cd61fb1 100644 --- a/ui/mainpage/mainpage.go +++ b/ui/mainpage/mainpage.go @@ -8,13 +8,11 @@ import ( "fyne.io/fyne/layout" "fyne.io/fyne/widget" "github.com/minizbot2012/orbbind/keymap/orbweaver" - "github.com/minizbot2012/orbbind/ui/baseui" "github.com/minizbot2012/orbbind/ui/bind" ) //Page is a basic page type Page struct { - baseui.PageWithBindings binds *orbweaver.PKM dev map[string]fyne.CanvasObject parent fyne.Window @@ -53,7 +51,7 @@ func (mp *Page) Create() *widget.TabItem { //NewMainPage Creates a new main page func NewMainPage(parent fyne.Window, pkm *orbweaver.PKM) *Page { - mp := &Page{} + mp := new(Page) mp.binds = pkm mp.parent = parent return mp diff --git a/ui/sidepage/sidepage.go b/ui/sidepage/sidepage.go index c55bca9..dd80ac4 100644 --- a/ui/sidepage/sidepage.go +++ b/ui/sidepage/sidepage.go @@ -8,13 +8,11 @@ import ( "fyne.io/fyne/layout" "fyne.io/fyne/widget" "github.com/minizbot2012/orbbind/keymap/orbweaver" - "github.com/minizbot2012/orbbind/ui/baseui" "github.com/minizbot2012/orbbind/ui/bind" ) //Page Overweave side button configs type Page struct { - baseui.PageWithBindings binds *orbweaver.PKM dev map[string]fyne.CanvasObject parent fyne.Window @@ -46,7 +44,7 @@ func (p *Page) Create() *widget.TabItem { //NewSidePage Creates a new side configuration page func NewSidePage(parent fyne.Window, pkm *orbweaver.PKM) *Page { - p := &Page{} + p := new(Page) p.binds = pkm p.parent = parent return p