stuff
This commit is contained in:
parent
42eafb87c7
commit
e80827d890
|
@ -83,7 +83,7 @@ func (tk *guiWidget) setColorLabel() {
|
|||
tk.color.fg = gocui.ColorBlack
|
||||
tk.color.bg = gocui.AttrNone
|
||||
tk.color.selFg = gocui.AttrNone
|
||||
tk.color.selBg = gocui.AttrNone
|
||||
tk.color.selBg = gocui.ColorWhite
|
||||
}
|
||||
|
||||
func (tk *guiWidget) setColorButtonDense() {
|
||||
|
@ -159,5 +159,5 @@ func (tk *guiWidget) setColorModal() {
|
|||
tk.color.fg = gocui.AttrNone
|
||||
tk.color.bg = gocui.AttrNone
|
||||
tk.color.selFg = gocui.AttrNone
|
||||
tk.color.selBg = gocui.ColorRed
|
||||
tk.color.selBg = gocui.ColorWhite
|
||||
}
|
||||
|
|
|
@ -144,7 +144,6 @@ func (tk *guiWidget) showTextbox() {
|
|||
return
|
||||
}
|
||||
startW, startH := tk.Position()
|
||||
// log.Log(GOCUI, "showTextbox() SHOWING AT W,H=", startW, startH)
|
||||
me.textbox.tk.MoveToOffset(startW+3, startH+2)
|
||||
me.textbox.tk.labelN = "holy cow"
|
||||
me.textbox.tk.setColorModal()
|
||||
|
|
|
@ -24,6 +24,27 @@ import (
|
|||
// this is run every time the user moves the mouse over the terminal window
|
||||
func mouseMove(g *gocui.Gui) {
|
||||
me.ok = true // this tells init() it's okay to work with gocui
|
||||
|
||||
// this runs while the user moves the mouse. this highlights text
|
||||
// toggle off all highlight views except for whatever is under the mouse
|
||||
for _, view := range g.Views() {
|
||||
view.Highlight = false
|
||||
}
|
||||
w, h := g.MousePosition()
|
||||
if v, err := g.ViewByPosition(w, h); err == nil {
|
||||
// todo: identify and highlight grid rows here
|
||||
if me.dropdown.active || me.textbox.active {
|
||||
if me.dropdown.tk != nil && me.dropdown.tk.v == v {
|
||||
v.Highlight = true
|
||||
}
|
||||
if me.textbox.tk != nil && me.textbox.tk.v == v {
|
||||
v.Highlight = true
|
||||
}
|
||||
} else {
|
||||
v.Highlight = true
|
||||
}
|
||||
}
|
||||
|
||||
// very useful for debugging in the past. also, just fun
|
||||
if me.supermouse {
|
||||
w, h := g.MousePosition()
|
||||
|
@ -45,16 +66,6 @@ func mouseMove(g *gocui.Gui) {
|
|||
// okay, the mouse is down and it has been long enough
|
||||
// the user is trying to drag something. let's figure out what
|
||||
|
||||
w, h := g.MousePosition()
|
||||
// toggle off all highlight vies except for whatever is under the mouse
|
||||
for _, view := range g.Views() {
|
||||
view.Highlight = false
|
||||
}
|
||||
|
||||
if v, err := g.ViewByPosition(w, h); err == nil {
|
||||
v.Highlight = true
|
||||
}
|
||||
|
||||
// create the 'msg' view if it does not yet exist // TODO: put this somewhere more correct
|
||||
if widgetView, _ := g.View("msg"); widgetView == nil {
|
||||
if createStdout(g) {
|
||||
|
|
Loading…
Reference in New Issue