Using tcell.Colors instead of HardCoding Hex Values
This commit is contained in:
parent
a3c5af06c8
commit
4a0a3e18f7
@ -15,7 +15,7 @@ var (
|
|||||||
NotificationServer interface {
|
NotificationServer interface {
|
||||||
Send(string)
|
Send(string)
|
||||||
}
|
}
|
||||||
WHITE_AND_BOLD string = "[#ffffff::b]"
|
WHITE_AND_BOLD string = "[white::b]"
|
||||||
)
|
)
|
||||||
|
|
||||||
func SetConnection(c *mpd.Client) {
|
func SetConnection(c *mpd.Client) {
|
||||||
|
@ -16,14 +16,14 @@ func UpdateBuffSearchView(inputTable *tview.Table, m fuzzy.Matches, f []FileNode
|
|||||||
} else {
|
} else {
|
||||||
for k, v := range m {
|
for k, v := range m {
|
||||||
if len(f[v.Index].Children) != 0 {
|
if len(f[v.Index].Children) != 0 {
|
||||||
inputTable.SetCell(k, 0, tview.NewTableCell(utils.GetMatchedString(utils.Unique(v.MatchedIndexes), f[v.Index].Path, "[#0000ff:-:bi]")).
|
inputTable.SetCell(k, 0, tview.NewTableCell(utils.GetMatchedString(utils.Unique(v.MatchedIndexes), f[v.Index].Path, "[blue:-:bi]")).
|
||||||
SetAlign(tview.AlignLeft).
|
SetAlign(tview.AlignLeft).
|
||||||
SetStyle(tcell.StyleDefault.
|
SetStyle(tcell.StyleDefault.
|
||||||
Foreground(tcell.ColorYellow).
|
Foreground(tcell.ColorYellow).
|
||||||
Background(tcell.ColorBlack).
|
Background(tcell.ColorBlack).
|
||||||
Bold(true)))
|
Bold(true)))
|
||||||
} else {
|
} else {
|
||||||
inputTable.SetCell(k, 0, tview.NewTableCell(utils.GetMatchedString(utils.Unique(v.MatchedIndexes), f[v.Index].Title, "[#fbff00:-:bi]")).
|
inputTable.SetCell(k, 0, tview.NewTableCell(utils.GetMatchedString(utils.Unique(v.MatchedIndexes), f[v.Index].Title, "[yellow:-:bi]")).
|
||||||
SetAlign(tview.AlignLeft).
|
SetAlign(tview.AlignLeft).
|
||||||
SetStyle(tcell.StyleDefault.
|
SetStyle(tcell.StyleDefault.
|
||||||
Foreground(tcell.ColorGreen).
|
Foreground(tcell.ColorGreen).
|
||||||
|
@ -36,10 +36,10 @@ func NewApplication() *Application {
|
|||||||
imagePreviewer.SetBackgroundColor(tcell.ColorDefault)
|
imagePreviewer.SetBackgroundColor(tcell.ColorDefault)
|
||||||
|
|
||||||
searchBar.SetTitle("Search").SetTitleAlign(tview.AlignLeft)
|
searchBar.SetTitle("Search").SetTitleAlign(tview.AlignLeft)
|
||||||
searchBar.SetAutocompleteBackgroundColor(tcell.GetColor("#15191a"))
|
searchBar.SetAutocompleteBackgroundColor(tcell.ColorBlack)
|
||||||
searchBar.SetAutocompleteSelectBackgroundColor(tcell.GetColor("#e5e5e5"))
|
searchBar.SetAutocompleteSelectBackgroundColor(tcell.ColorWhite)
|
||||||
searchBar.SetAutocompleteMainTextColor(tcell.GetColor("#7f7f7f"))
|
searchBar.SetAutocompleteMainTextColor(tcell.ColorDarkGray)
|
||||||
searchBar.SetAutocompleteSelectedTextColor(tcell.GetColor("#111111"))
|
searchBar.SetAutocompleteSelectedTextColor(tcell.ColorBlack)
|
||||||
Navbar.SetBorder(true)
|
Navbar.SetBorder(true)
|
||||||
Navbar.SetSelectable(true, false)
|
Navbar.SetSelectable(true, false)
|
||||||
Navbar.SetCell(0, 0, tview.NewTableCell("PlayList"))
|
Navbar.SetCell(0, 0, tview.NewTableCell("PlayList"))
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
package notify
|
package notify
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/aditya-K2/gomp/ui"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/aditya-K2/gomp/ui"
|
||||||
|
|
||||||
"github.com/aditya-K2/gomp/utils"
|
"github.com/aditya-K2/gomp/utils"
|
||||||
|
|
||||||
"github.com/aditya-K2/tview"
|
"github.com/aditya-K2/tview"
|
||||||
@ -43,12 +44,12 @@ func (self *Notification) Draw(screen tcell.Screen) {
|
|||||||
TEXTPOSITION int = 2
|
TEXTPOSITION int = 2
|
||||||
)
|
)
|
||||||
|
|
||||||
self.Box.SetBackgroundColor(tcell.GetColor("#15191a"))
|
self.Box.SetBackgroundColor(tcell.ColorBlack)
|
||||||
self.SetRect(COL-(TEXTLENGTH+7), 1, TEXTLENGTH+4, HEIGHT)
|
self.SetRect(COL-(TEXTLENGTH+7), 1, TEXTLENGTH+4, HEIGHT)
|
||||||
self.DrawForSubclass(screen, self.Box)
|
self.DrawForSubclass(screen, self.Box)
|
||||||
tview.Print(screen, self.Text,
|
tview.Print(screen, self.Text,
|
||||||
COL-(TEXTLENGTH+5), TEXTPOSITION, TEXTLENGTH,
|
COL-(TEXTLENGTH+5), TEXTPOSITION, TEXTLENGTH,
|
||||||
tview.AlignCenter, tcell.GetColor("#ffffff"))
|
tview.AlignCenter, tcell.ColorWhite)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Notification Server : Not an actual Server*/
|
/* Notification Server : Not an actual Server*/
|
||||||
|
@ -59,7 +59,7 @@ func InsertAt(inputString, stringTobeInserted string, index int) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetText(width, percentage float64, eta string) string {
|
func GetText(width, percentage float64, eta string) string {
|
||||||
q := "[#000000:#ffffff:b]"
|
q := "[black:white:b]"
|
||||||
var a string
|
var a string
|
||||||
a += strings.Repeat(" ", int(width)-len(eta))
|
a += strings.Repeat(" ", int(width)-len(eta))
|
||||||
a = InsertAt(a, eta, int(width/2)-10)
|
a = InsertAt(a, eta, int(width/2)-10)
|
||||||
|
Loading…
Reference in New Issue
Block a user