mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Now possible to define the characters for use in paging indicators
This commit is contained in:
@@ -24,7 +24,7 @@ func (widget *Widget) display() {
|
||||
|
||||
widget.View.SetTitle(widget.title(cityData))
|
||||
|
||||
str := widget.tickMarks(widget.Data) + "\n"
|
||||
str := wtf.SygilStr(len(widget.Data), widget.Idx, widget.View) + "\n"
|
||||
str = str + widget.description(cityData) + "\n\n"
|
||||
str = str + widget.temperatures(cityData) + "\n"
|
||||
str = str + widget.sunInfo(cityData)
|
||||
@@ -67,19 +67,6 @@ func (widget *Widget) temperatures(cityData *owm.CurrentWeatherData) string {
|
||||
return str
|
||||
}
|
||||
|
||||
func (widget *Widget) tickMarks(data []*owm.CurrentWeatherData) string {
|
||||
str := ""
|
||||
|
||||
if len(data) > 1 {
|
||||
marks := strings.Repeat("*", len(data))
|
||||
marks = marks[:widget.Idx] + "_" + marks[widget.Idx+1:]
|
||||
|
||||
str = "[lightblue]" + fmt.Sprintf(wtf.RightAlignFormat(widget.View), marks) + "[white]"
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
func (widget *Widget) title(cityData *owm.CurrentWeatherData) string {
|
||||
return fmt.Sprintf(" %s %s ", widget.icon(cityData), cityData.Name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user