better window title colors
This commit is contained in:
parent
9a08b37be4
commit
c00084bf3f
59
colorNew.go
59
colorNew.go
|
@ -9,6 +9,17 @@ import (
|
|||
"github.com/awesome-gocui/gocui"
|
||||
)
|
||||
|
||||
func (tk *guiWidget) updateColor() {
|
||||
if tk.v == nil {
|
||||
return
|
||||
}
|
||||
tk.v.FrameColor = tk.color.frame
|
||||
tk.v.FgColor = tk.color.fg
|
||||
tk.v.BgColor = tk.color.bg
|
||||
tk.v.SelFgColor = tk.color.selFg
|
||||
tk.v.SelBgColor = tk.color.selBg
|
||||
}
|
||||
|
||||
func (tk *guiWidget) setColorWindowFrame() {
|
||||
if tk.color == nil {
|
||||
tk.color = new(colorT)
|
||||
|
@ -19,6 +30,7 @@ func (tk *guiWidget) setColorWindowFrame() {
|
|||
tk.color.bg = gocui.ColorBlack
|
||||
tk.color.selFg = gocui.AttrNone
|
||||
tk.color.selBg = gocui.AttrNone
|
||||
tk.updateColor()
|
||||
return
|
||||
}
|
||||
tk.color.frame = gocui.AttrNone
|
||||
|
@ -26,9 +38,33 @@ func (tk *guiWidget) setColorWindowFrame() {
|
|||
tk.color.bg = gocui.AttrNone
|
||||
tk.color.selFg = gocui.AttrNone
|
||||
tk.color.selBg = gocui.AttrNone
|
||||
|
||||
tk.updateColor()
|
||||
}
|
||||
|
||||
// weird. lots of color problems for me on debian sid using the traditional Andy Herzfield 'gnome'
|
||||
func (tk *guiWidget) setColorWindowTitleActive() {
|
||||
if tk.color == nil {
|
||||
tk.color = new(colorT)
|
||||
}
|
||||
if me.dark { // use a dark color palette
|
||||
tk.color.frame = gocui.AttrNone
|
||||
tk.color.fg = gocui.ColorBlue
|
||||
tk.color.bg = gocui.AttrNone
|
||||
tk.color.selFg = gocui.ColorWhite
|
||||
tk.color.selBg = gocui.ColorBlue
|
||||
tk.updateColor()
|
||||
return
|
||||
}
|
||||
tk.color.frame = gocui.ColorWhite
|
||||
tk.color.fg = gocui.ColorWhite
|
||||
tk.color.bg = gocui.ColorBlue
|
||||
tk.color.selFg = gocui.ColorWhite
|
||||
tk.color.selBg = gocui.ColorBlue
|
||||
|
||||
tk.updateColor()
|
||||
}
|
||||
|
||||
func (tk *guiWidget) setColorWindowTitle() {
|
||||
if tk.color == nil {
|
||||
tk.color = new(colorT)
|
||||
|
@ -39,13 +75,16 @@ func (tk *guiWidget) setColorWindowTitle() {
|
|||
tk.color.bg = gocui.AttrNone
|
||||
tk.color.selFg = gocui.ColorWhite
|
||||
tk.color.selBg = gocui.ColorBlue
|
||||
tk.updateColor()
|
||||
return
|
||||
}
|
||||
tk.color.frame = gocui.ColorWhite
|
||||
tk.color.fg = gocui.ColorWhite
|
||||
tk.color.bg = gocui.ColorBlue
|
||||
tk.color.fg = gocui.ColorBlue
|
||||
tk.color.bg = gocui.AttrNone
|
||||
tk.color.selFg = gocui.ColorWhite
|
||||
tk.color.selBg = gocui.ColorBlue
|
||||
|
||||
tk.updateColor()
|
||||
}
|
||||
|
||||
func (tk *guiWidget) setColorBG() {
|
||||
|
@ -58,6 +97,7 @@ func (tk *guiWidget) setColorBG() {
|
|||
tk.color.bg = gocui.ColorBlack
|
||||
tk.color.selFg = gocui.AttrNone
|
||||
tk.color.selBg = gocui.AttrNone
|
||||
tk.updateColor()
|
||||
return
|
||||
}
|
||||
tk.color.frame = gocui.ColorWhite
|
||||
|
@ -65,6 +105,8 @@ func (tk *guiWidget) setColorBG() {
|
|||
tk.color.bg = gocui.AttrNone
|
||||
tk.color.selFg = gocui.AttrNone
|
||||
tk.color.selBg = gocui.AttrNone
|
||||
|
||||
tk.updateColor()
|
||||
}
|
||||
|
||||
func (tk *guiWidget) setColorLabel() {
|
||||
|
@ -77,6 +119,7 @@ func (tk *guiWidget) setColorLabel() {
|
|||
tk.color.bg = gocui.ColorBlack
|
||||
tk.color.selFg = gocui.ColorWhite
|
||||
tk.color.selBg = gocui.AttrNone
|
||||
tk.updateColor()
|
||||
return
|
||||
}
|
||||
tk.color.frame = gocui.AttrNone
|
||||
|
@ -84,6 +127,8 @@ func (tk *guiWidget) setColorLabel() {
|
|||
tk.color.bg = gocui.AttrNone
|
||||
tk.color.selFg = gocui.AttrNone
|
||||
tk.color.selBg = gocui.ColorWhite
|
||||
|
||||
tk.updateColor()
|
||||
}
|
||||
|
||||
func (tk *guiWidget) setColorButtonDense() {
|
||||
|
@ -96,6 +141,7 @@ func (tk *guiWidget) setColorButtonDense() {
|
|||
tk.color.bg = gocui.ColorBlack
|
||||
tk.color.selFg = gocui.ColorWhite
|
||||
tk.color.selBg = gocui.ColorBlue
|
||||
tk.updateColor()
|
||||
return
|
||||
}
|
||||
tk.color.frame = gocui.AttrNone
|
||||
|
@ -103,6 +149,8 @@ func (tk *guiWidget) setColorButtonDense() {
|
|||
tk.color.bg = gocui.ColorBlue
|
||||
tk.color.selFg = gocui.ColorBlue
|
||||
tk.color.selBg = gocui.AttrNone
|
||||
|
||||
tk.updateColor()
|
||||
}
|
||||
|
||||
func (tk *guiWidget) setColorButton() {
|
||||
|
@ -115,6 +163,7 @@ func (tk *guiWidget) setColorButton() {
|
|||
tk.color.bg = gocui.ColorBlack
|
||||
tk.color.selFg = gocui.ColorWhite
|
||||
tk.color.selBg = gocui.ColorBlue
|
||||
tk.updateColor()
|
||||
return
|
||||
}
|
||||
tk.color.frame = gocui.ColorBlue
|
||||
|
@ -122,6 +171,8 @@ func (tk *guiWidget) setColorButton() {
|
|||
tk.color.bg = gocui.AttrNone
|
||||
tk.color.selFg = gocui.ColorWhite
|
||||
tk.color.selBg = gocui.ColorBlue
|
||||
|
||||
tk.updateColor()
|
||||
}
|
||||
|
||||
func (tk *guiWidget) setColorInput() {
|
||||
|
@ -134,6 +185,7 @@ func (tk *guiWidget) setColorInput() {
|
|||
tk.color.bg = gocui.AttrNone
|
||||
tk.color.selFg = gocui.ColorYellow
|
||||
tk.color.selBg = gocui.ColorBlack
|
||||
tk.updateColor()
|
||||
return
|
||||
}
|
||||
tk.color.frame = gocui.ColorYellow
|
||||
|
@ -141,6 +193,7 @@ func (tk *guiWidget) setColorInput() {
|
|||
tk.color.bg = gocui.AttrNone
|
||||
tk.color.selFg = gocui.ColorYellow
|
||||
tk.color.selBg = gocui.ColorBlack
|
||||
tk.updateColor()
|
||||
}
|
||||
|
||||
func (tk *guiWidget) setColorModal() {
|
||||
|
@ -153,6 +206,7 @@ func (tk *guiWidget) setColorModal() {
|
|||
tk.color.bg = gocui.ColorBlack
|
||||
tk.color.selFg = gocui.ColorBlack
|
||||
tk.color.selBg = gocui.AttrNone
|
||||
tk.updateColor()
|
||||
return
|
||||
}
|
||||
tk.color.frame = gocui.ColorRed
|
||||
|
@ -160,4 +214,5 @@ func (tk *guiWidget) setColorModal() {
|
|||
tk.color.bg = gocui.AttrNone
|
||||
tk.color.selFg = gocui.AttrNone
|
||||
tk.color.selBg = gocui.ColorWhite
|
||||
tk.updateColor()
|
||||
}
|
||||
|
|
21
window.go
21
window.go
|
@ -19,7 +19,7 @@ func (tk *guiWidget) setTitle(s string) {
|
|||
if tk.v == nil {
|
||||
return
|
||||
}
|
||||
tk.setColorWindowTitle()
|
||||
tk.setColorWindowTitleActive()
|
||||
rect := tk.gocuiSize
|
||||
rect.w1 = rect.w0 + tk.full.Width() + 1
|
||||
// rect.h1 = rect.h0 + 1
|
||||
|
@ -56,7 +56,8 @@ func (tk *guiWidget) redrawWindow(w int, h int) {
|
|||
tk.hasTabs = false
|
||||
|
||||
tk.DrawAt(w, h)
|
||||
tk.setColor(&colorActiveW) // sets the window to Green BG
|
||||
// tk.setColor(&colorActiveW) // sets the window to Green BG
|
||||
tk.setColorWindowTitleActive()
|
||||
|
||||
if tk.window.collapsed {
|
||||
// don't show anything but the title bar
|
||||
|
@ -70,22 +71,11 @@ func (tk *guiWidget) redrawWindow(w int, h int) {
|
|||
tk.full.h0 = tk.force.h0
|
||||
|
||||
tk.setFullSize()
|
||||
/*
|
||||
v, err := me.baseGui.SetView(tk.cuiName, tk.gocuiSize.w0, tk.gocuiSize.h0, tk.gocuiSize.w1, tk.gocuiSize.h1, 0)
|
||||
if err != nil {
|
||||
log.Info("crap. got an err", err)
|
||||
}
|
||||
if tk.v != v {
|
||||
log.Info("crap. got another problem v != tk.v")
|
||||
}
|
||||
*/
|
||||
tk.Show()
|
||||
tk.v.Clear()
|
||||
fmt.Fprint(tk.v, "ZZZ"+tk.GetText())
|
||||
tk.showWidgets()
|
||||
|
||||
// RE-VERIFY THIS CAN'T BE DONE IN A BETTER WAY. However, for now, this works finally so I am leaving it alone
|
||||
|
||||
if tk.windowFrame == nil {
|
||||
tk.addWindowFrameTK(0 - tk.node.WidgetId)
|
||||
tk.windowFrame.node.State.Label = "" // temporary name. blank out when ready for release
|
||||
|
@ -116,7 +106,7 @@ func (tk *guiWidget) redrawWindow(w int, h int) {
|
|||
tk.showWidgets()
|
||||
|
||||
// draw the window title
|
||||
tk.setTitle(tk.node.GetLabel() + " jwc")
|
||||
tk.setTitle(tk.node.GetLabel())
|
||||
}
|
||||
|
||||
// re-draws the buttons for each of the windows
|
||||
|
@ -195,7 +185,8 @@ func (tk *guiWidget) makeWindowActive() {
|
|||
for _, tk := range me.allwin {
|
||||
tk.window.order += 1
|
||||
tk.window.active = false
|
||||
tk.setColor(&colorWindow) // color for inactive windows
|
||||
// tk.setColor(&colorWindow) // color for inactive windows
|
||||
tk.setColorWindowTitle()
|
||||
}
|
||||
|
||||
// set this window as the active one
|
||||
|
|
Loading…
Reference in New Issue