begin carving out channel and thread display
This commit is contained in:
28
gui.go
28
gui.go
@ -1,12 +1,23 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fyne.io/fyne"
|
||||
"fyne.io/fyne/app"
|
||||
"fyne.io/fyne/layout"
|
||||
"fyne.io/fyne/widget"
|
||||
)
|
||||
|
||||
type GUI struct {
|
||||
db *database
|
||||
db *database
|
||||
window fyne.Window
|
||||
|
||||
channelPane *widget.Box
|
||||
threadPane *widget.Box
|
||||
channelList *widget.ScrollContainer
|
||||
messageList *widget.ScrollContainer
|
||||
contentArea *widget.Label
|
||||
selectedChannel string
|
||||
selectedMessage string
|
||||
}
|
||||
|
||||
func NewGUI() *GUI {
|
||||
@ -22,8 +33,15 @@ func (client *GUI) Start(path string) {
|
||||
|
||||
a := app.New()
|
||||
|
||||
w := a.NewWindow("Syndie GUI")
|
||||
rightSideBar := widget.NewVScrollContainer(client.renderChannelList())
|
||||
w.SetContent(rightSideBar)
|
||||
w.ShowAndRun()
|
||||
client.window = a.NewWindow("Syndie GUI")
|
||||
client.contentArea = widget.NewLabel("This is where the message content goes")
|
||||
|
||||
client.repaint()
|
||||
client.window.ShowAndRun()
|
||||
}
|
||||
|
||||
func (client *GUI) repaint() {
|
||||
client.channelList = widget.NewVScrollContainer(client.renderChannelList())
|
||||
client.messageList = widget.NewVScrollContainer(client.renderThreadList())
|
||||
client.window.SetContent(fyne.NewContainerWithLayout(layout.NewGridLayout(2), widget.NewHSplitContainer(client.channelList, client.messageList), client.contentArea))
|
||||
}
|
||||
|
Reference in New Issue
Block a user