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:
@@ -19,7 +19,7 @@ type Widget struct {
|
||||
|
||||
func NewWidget() *Widget {
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" Pretty Weather ", "prettyweather", false),
|
||||
TextWidget: wtf.NewTextWidget("Pretty Weather", "prettyweather", false),
|
||||
}
|
||||
|
||||
return &widget
|
||||
|
||||
@@ -72,5 +72,6 @@ func (widget *Widget) temperatures(cityData *owm.CurrentWeatherData) string {
|
||||
}
|
||||
|
||||
func (widget *Widget) title(cityData *owm.CurrentWeatherData) string {
|
||||
return fmt.Sprintf(" %s %s ", widget.emojiFor(cityData), cityData.Name)
|
||||
str := fmt.Sprintf("%s %s", widget.emojiFor(cityData), cityData.Name)
|
||||
return widget.ContextualTitle(str)
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ type Widget struct {
|
||||
func NewWidget(app *tview.Application, pages *tview.Pages) *Widget {
|
||||
configKey := "weather"
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" Weather ", configKey, true),
|
||||
TextWidget: wtf.NewTextWidget("Weather", configKey, true),
|
||||
|
||||
app: app,
|
||||
pages: pages,
|
||||
|
||||
Reference in New Issue
Block a user