1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Add character identifiers to focusable widgets

When no widget has focus, press the letter key to focus on the widget
assigned to that letter.

Example:

    GitHub (d)

    Press "d" to focus on the GitHub widget.
This commit is contained in:
Chris Cummer
2018-07-30 15:51:19 -07:00
parent 749318ead6
commit beb0c43b07
36 changed files with 100 additions and 44 deletions

View File

@@ -14,7 +14,7 @@ func (widget *Widget) display() {
return
}
widget.View.SetTitle(fmt.Sprintf("%s- %s ", widget.Name, widget.title(repo)))
widget.View.SetTitle(widget.ContextualTitle(fmt.Sprintf("%s - %s", widget.Name, widget.title(repo))))
str := wtf.SigilStr(len(widget.GithubRepos), widget.Idx, widget.View) + "\n"
str = str + " [red]Stats[white]\n"

View File

@@ -30,7 +30,7 @@ type Widget struct {
func NewWidget(app *tview.Application, pages *tview.Pages) *Widget {
widget := Widget{
TextWidget: wtf.NewTextWidget(" Github ", "github", true),
TextWidget: wtf.NewTextWidget("Github", "github", true),
app: app,
Idx: 0,