code cleanup

pull/3/head
Minizbot2012 3 years ago
parent e9b1e50639
commit ea4bbc456d
No known key found for this signature in database
GPG Key ID: 977C8ADE12361917

@ -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=

@ -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

@ -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)

@ -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

@ -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

@ -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

Loading…
Cancel
Save