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

@@ -2,7 +2,6 @@ package github
import (
"fmt"
"strings"
"github.com/senorprogrammer/wtf/wtf"
)
@@ -18,7 +17,7 @@ func (widget *Widget) display() {
widget.View.SetTitle(fmt.Sprintf(" Github: %s ", widget.title(repo)))
str := widget.tickMarks(widget.Data) + "\n"
str := wtf.SygilStr(len(widget.Data), widget.Idx, widget.View) + "\n"
str = str + " [red]Open Review Requests[white]\n"
str = str + widget.prsForReview(repo, Config.UString("wtf.mods.github.username"))
str = str + "\n"
@@ -72,19 +71,6 @@ func (widget *Widget) prsForReview(repo *GithubRepo, username string) string {
return str
}
func (widget *Widget) tickMarks(data []*GithubRepo) 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(repo *GithubRepo) string {
return fmt.Sprintf("[green]%s - %s[white]", repo.Owner, repo.Name)
}