mirror of https://github.com/qwc/backive.git
Creating the layout base
This commit is contained in:
parent
9e1d9fb20b
commit
a738650ca1
|
@ -2,13 +2,24 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fyne.io/fyne/v2/app"
|
"fyne.io/fyne/v2/app"
|
||||||
"fyne.io/fyne/v2/widget"
|
|
||||||
|
"github.com/qwc/backive"
|
||||||
|
backiveui "github.com/qwc/backive/ui"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
config backive.Configuration
|
||||||
|
database backive.Database
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
|
database.Load()
|
||||||
|
config.Load()
|
||||||
app := app.New()
|
app := app.New()
|
||||||
w := app.NewWindow("Hello World!")
|
w := app.NewWindow("Hello World!")
|
||||||
|
backiveui.Init(app, w, config, database)
|
||||||
|
|
||||||
w.SetContent(widget.NewLabel("Hello World!"))
|
//w.SetContent(widget.NewLabel("Hello World!"))
|
||||||
w.ShowAndRun()
|
w.ShowAndRun()
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
package ui
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fyne.io/fyne/v2"
|
||||||
|
"fyne.io/fyne/v2/container"
|
||||||
|
"fyne.io/fyne/v2/layout"
|
||||||
|
"fyne.io/fyne/v2/widget"
|
||||||
|
"github.com/qwc/backive"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
app fyne.App
|
||||||
|
window fyne.Window
|
||||||
|
config backive.Configuration
|
||||||
|
db backive.Database
|
||||||
|
|
||||||
|
accord *widget.Accordion
|
||||||
|
center *fyne.Container
|
||||||
|
)
|
||||||
|
|
||||||
|
func Init(a fyne.App, w fyne.Window, c backive.Configuration, d backive.Database) {
|
||||||
|
app = a
|
||||||
|
window = w
|
||||||
|
config = c
|
||||||
|
db = d
|
||||||
|
SetupLayout()
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetupLayout() {
|
||||||
|
accord = widget.NewAccordion()
|
||||||
|
center := container.NewMax()
|
||||||
|
content := container.New(layout.NewBorderLayout(nil, nil, accord, nil), accord, center)
|
||||||
|
window.SetContent(content)
|
||||||
|
}
|
Loading…
Reference in New Issue