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:
@@ -15,8 +15,8 @@ func (widget *Widget) display() {
|
||||
return
|
||||
}
|
||||
|
||||
title := fmt.Sprintf("[green]%s[white]\n", repoData.Repository)
|
||||
widget.View.SetTitle(fmt.Sprintf("%s- %s", widget.Name, title))
|
||||
title := fmt.Sprintf("%s - [green]%s[white]", widget.Name, repoData.Repository)
|
||||
widget.View.SetTitle(widget.ContextualTitle(title))
|
||||
|
||||
str := wtf.SigilStr(len(widget.Data), widget.Idx, widget.View) + "\n"
|
||||
str = str + " [red]Branch[white]\n"
|
||||
|
||||
@@ -34,7 +34,7 @@ type Widget struct {
|
||||
|
||||
func NewWidget(app *tview.Application, pages *tview.Pages) *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" Git ", "git", true),
|
||||
TextWidget: wtf.NewTextWidget("Git", "git", true),
|
||||
|
||||
app: app,
|
||||
Idx: 0,
|
||||
|
||||
Reference in New Issue
Block a user