1
0
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:
Chris Cummer
2018-05-24 09:03:00 -07:00
parent 0cdd859aa7
commit 5f7c3260c1
4 changed files with 17 additions and 43 deletions

View File

@@ -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)
}