begin carving out channel and thread display

This commit is contained in:
2020-07-20 02:39:14 -04:00
parent 5ddd680686
commit 06ee911aa6
4 changed files with 155 additions and 16 deletions

28
gui.go
View File

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