Quality of Life update #4

Merged
raul merged 10 commits from testing into main 2024-05-08 08:04:46 +02:00
1 changed files with 13 additions and 13 deletions
Showing only changes of commit f8332d102a - Show all commits

View File

@ -159,9 +159,9 @@ func initKeybindings(g *gocui.Gui) error {
log.Panicln(err) log.Panicln(err)
} }
if err := g.SetKeybinding("button", gocui.MouseLeft, gocui.ModNone, sendToServer); err != nil { // if err := g.SetKeybinding("button", gocui.MouseLeft, gocui.ModNone, sendToServer); err != nil {
log.Panicln(err) // log.Panicln(err)
} // }
if err := g.SetKeybinding("textarea", gocui.KeyEnter, gocui.ModNone, sendToServer); err != nil { if err := g.SetKeybinding("textarea", gocui.KeyEnter, gocui.ModNone, sendToServer); err != nil {
log.Panicln(err) log.Panicln(err)
@ -197,17 +197,17 @@ func layout(g *gocui.Gui) error {
chatbox.Title = "Chat Box" chatbox.Title = "Chat Box"
} }
if button, err := g.SetView("button", maxX/2+32, maxY-4, maxX-28, maxY-2); err != nil { // if button, err := g.SetView("button", maxX/2+32, maxY-4, maxX-28, maxY-2); err != nil {
if err != gocui.ErrUnknownView { // if err != gocui.ErrUnknownView {
return err // return err
} // }
//
// button.Wrap = true
// button.Frame = true
// fmt.Fprintln(button, "Send it")
// }
button.Wrap = true if textarea, err := g.SetView("textarea", 2, maxY-4, maxX-28, maxY-2); err != nil {
button.Frame = true
fmt.Fprintln(button, "Send it")
}
if textarea, err := g.SetView("textarea", 2, maxY-4, maxX-40, maxY-2); err != nil {
if err != gocui.ErrUnknownView { if err != gocui.ErrUnknownView {
return err return err
} }