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:
@@ -12,7 +12,7 @@ type Widget struct {
|
||||
|
||||
func NewWidget() *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" BambooHR ", "bamboohr", false),
|
||||
TextWidget: wtf.NewTextWidget("BambooHR", "bamboohr", false),
|
||||
}
|
||||
|
||||
return &widget
|
||||
@@ -29,7 +29,7 @@ func (widget *Widget) Refresh() {
|
||||
)
|
||||
|
||||
widget.UpdateRefreshedAt()
|
||||
widget.View.SetTitle(fmt.Sprintf("%s (%d) ", widget.Name, len(todayItems)))
|
||||
widget.View.SetTitle(widget.ContextualTitle(widget.Name))
|
||||
|
||||
widget.View.SetText(widget.contentFrom(todayItems))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user