@@ 26,6 26,7 @@ func TUI(client *mautrix.Client, elections *election.ElectionsMap) (el *election
panic(err)
}
list := tview.NewList()
+ list.SetTitle("Select a room").SetBorder(true)
for i, roomID := range resp.JoinedRooms {
name := string(roomID)
room := client.Store.LoadRoom(roomID)
@@ 70,6 71,7 @@ func RoomTUI(client *mautrix.Client, roomID id.RoomID, elections *election.Elect
app := tview.NewApplication()
list := tview.NewList().
AddItem("Create Election", "start a new election in this room", '+', nil)
+ list.SetTitle("Select election").SetBorder(true)
var L []*election.Election
var Ltime time.Time = elections.Ltime.Add(-1 * time.Millisecond)
update := func() {
@@ 221,6 223,7 @@ func CreateElectionTUI() (title string, candidates []election.Candidate) {
AddButton("+", plus).
AddButton("-", minus).
AddButton("Done", done)
+ form.SetTitle("Create an election").SetBorder(true)
if err := app.SetRoot(form, true).SetFocus(form).Run(); err != nil {
panic(err)
}
@@ 234,6 237,7 @@ func CreateElectionTUI() (title string, candidates []election.Candidate) {
func ElectionTUI(client *mautrix.Client, el *election.Election) {
votersTextView := tview.NewTextView()
frame := tview.NewFrame(votersTextView)
+ frame.SetTitle(el.Title).SetBorder(true)
app := tview.NewApplication()
el.RLock()
if el.Creator == el.LocalVoter.UserID {
@@ 306,6 310,7 @@ func Vote(candidates []election.Candidate) []byte {
ranks := make([]int, len(candidates))
app := tview.NewApplication()
form := tview.NewForm()
+ form.SetTitle("Vote").SetBorder(true)
for _, eo := range candidates {
// TODO: support more than 99 candidates