awesome-gocui / gocui

Minimalist Go package aimed at creating Console User Interfaces.
BSD 3-Clause "New" or "Revised" License
344 stars 39 forks source link

Help with selected row highlight #129

Closed sangdth closed 6 months ago

sangdth commented 1 year ago

Hi, first thanks for efforts to keep the gocui alive :D

I don't see the Discussion feature, so please forgive me to use issue to ask.

So far I can make some simple views, and the selected row works well. But it only show the background of text only, not full row. I attach the screenshots:

Current situation: Screenshot 2023-05-17 at 8 57 34

Expected: Screenshot 2023-05-17 at 8 58 05 (I took from lazygit, also created with gocui)

The code:

if v, err := g.SetView(issuesView, 0, projectViewHeight+1, sideBarWidth, maxY-1); err != nil {
    if err != gocui.ErrUnknownView {
        return err
    }
    v.Title = " Issues "
    v.Highlight = true
    v.SelBgColor = gocui.ColorGreen
    v.SelFgColor = gocui.ColorBlack
}

I tried to search inside the lazygit repo, try to learn from them but my limited knowledge can't do much.

Could someone give a hint, really appreciate it <3

zocker-160 commented 6 months ago

you probably forgot about this issue, but you have to simply fill the entire line with the space rune, then it will highlight the way you expect.

sangdth commented 6 months ago

Thanks @zocker-160 , I do not forget, I just changed company and don't use this app any more so I do not develop it further.