Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix window color #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions ctrl.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,9 @@ func Quit(g *c.Gui, v *c.View) error {
func SwitchView(g *c.Gui, v *c.View) error {
switch v.Name() {
case SITES_VIEW:
g.SelFgColor = c.ColorGreen | c.AttrBold
if v == SitesList.View {
NewsList.Focus(g)
SitesList.Unfocus()
if strings.Contains(NewsList.Title, "bookmarks") {
g.SelFgColor = c.ColorMagenta | c.AttrBold
}
}
case NEWS_VIEW:
SitesList.Focus(g)
Expand Down Expand Up @@ -386,7 +382,7 @@ func OnEnter(g *c.Gui, v *c.View) error {
Summary.Clear()
NewsList.Clear()
NewsList.Focus(g)
g.SelFgColor = c.ColorGreen | c.AttrBold

NewsList.Title = " Fetching ... "
g.Update(func(g *c.Gui) error {
events, err := DownloadEvents(site.Url)
Expand Down Expand Up @@ -438,7 +434,6 @@ func OnEnter(g *c.Gui, v *c.View) error {
return err
}
deletePromptView(g)
g.SelFgColor = c.ColorGreen | c.AttrBold
SitesList.Focus(g)

if err = LoadSites(); err != nil {
Expand Down Expand Up @@ -550,7 +545,6 @@ func LoadBookmarks(g *c.Gui, v *c.View) error {
return err
}
}
g.SelFgColor = c.ColorMagenta | c.AttrBold
return nil
}

Expand Down Expand Up @@ -613,11 +607,6 @@ func RemoveTopView(g *c.Gui, v *c.View) error {
return err
}
}
if isBookmarksNews() {
g.SelFgColor = c.ColorMagenta | c.AttrBold
} else {
g.SelFgColor = c.ColorGreen | c.AttrBold
}

return nil
}
Expand Down Expand Up @@ -646,7 +635,6 @@ func LoadContent(g *c.Gui, v *c.View) error {
log.Println("Error on createContentView", err)
return err
}
g.SelFgColor = c.ColorGreen | c.AttrBold
cv, _ := g.View(CONTENT_VIEW)
cv.Title = "Fetching..."
g.Update(func(g *c.Gui) error {
Expand Down
5 changes: 1 addition & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var (
CurrentBookmarks []db.Event
curW int
curH int
Bold *color.Color
Bold = color.New(color.Bold)
)

// relSize calculates the sizes of the sites view width
Expand Down Expand Up @@ -139,12 +139,9 @@ func getAppDir() (string, error) {
}

func main() {

var v *c.View
var err error

Bold = color.New(color.Bold)

appDir, err := getAppDir()
if err != nil {
panic("Could not set up app directory.")
Expand Down