feat(ui): set Box.titleAlign to left

This commit is contained in:
rigormorrtiss 2021-08-15 18:58:53 +04:00
parent 5ced86076f
commit 0c47002c9e
4 changed files with 6 additions and 24 deletions

View file

@ -1,20 +0,0 @@
package ui
import (
"github.com/gdamore/tcell/v2"
"github.com/rigormorrtiss/discordo/util"
"github.com/rivo/tview"
)
func NewGuildsDropDown(onGuildsDropDownSelected func(string, int), theme *util.Theme) (d *tview.DropDown) {
d = tview.NewDropDown()
d.
SetLabel("Guild: ").
SetSelectedFunc(onGuildsDropDownSelected).
SetFieldBackgroundColor(tcell.GetColor(theme.DropDownBackground)).
SetBackgroundColor(tcell.GetColor(theme.DropDownBackground)).
SetBorder(true).
SetBorderPadding(0, 0, 1, 1)
return
}

View file

@ -13,9 +13,9 @@ func NewMessageInputField(onMessageInputFieldInputCapture func(*tcell.EventKey)
SetPlaceholderTextColor(tcell.ColorWhite).
SetFieldBackgroundColor(tcell.GetColor(theme.InputFieldBackground)).
SetBackgroundColor(tcell.GetColor(theme.InputFieldBackground)).
SetInputCapture(onMessageInputFieldInputCapture).
SetBorder(true).
SetBorderPadding(0, 0, 1, 1).
SetInputCapture(onMessageInputFieldInputCapture)
SetBorderPadding(0, 0, 1, 1)
return
}

View file

@ -17,7 +17,8 @@ func NewMessagesTextView(app *tview.Application, theme *util.Theme) (textV *tvie
}).
SetBackgroundColor(tcell.GetColor(theme.TextViewBackground)).
SetBorder(true).
SetBorderPadding(0, 0, 1, 1)
SetBorderPadding(0, 0, 1, 1).
SetTitleAlign(tview.AlignLeft)
return
}

View file

@ -17,7 +17,8 @@ func NewGuildsTreeView(onGuildsTreeViewSelected func(*tview.TreeNode), theme *ut
SetBackgroundColor(tcell.GetColor(theme.TreeViewBackground)).
SetTitle("Guilds").
SetBorder(true).
SetBorderPadding(0, 0, 1, 1)
SetBorderPadding(0, 0, 1, 1).
SetTitleAlign(tview.AlignLeft)
return
}