better window titlebar
This commit is contained in:
parent
955afcb1a9
commit
9a08b37be4
|
@ -42,10 +42,10 @@ func (tk *guiWidget) setColorWindowTitle() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
tk.color.frame = gocui.ColorWhite
|
tk.color.frame = gocui.ColorWhite
|
||||||
tk.color.fg = gocui.AttrNone
|
tk.color.fg = gocui.ColorWhite
|
||||||
tk.color.bg = gocui.ColorBlue
|
tk.color.bg = gocui.ColorBlue
|
||||||
tk.color.selFg = gocui.ColorBlue
|
tk.color.selFg = gocui.ColorWhite
|
||||||
tk.color.selBg = gocui.AttrNone
|
tk.color.selBg = gocui.ColorBlue
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tk *guiWidget) setColorBG() {
|
func (tk *guiWidget) setColorBG() {
|
||||||
|
|
|
@ -105,7 +105,7 @@ func doMouseClick(w int, h int) {
|
||||||
if win.checkWindowClose(w, h) {
|
if win.checkWindowClose(w, h) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Info("you clicked on a window, but not any widgets. check for title / close window here", win.cuiName)
|
// log.Info("you clicked on a window, but not any widgets. check for title / close window here", win.cuiName)
|
||||||
win.redrawWindow(win.gocuiSize.w0, win.gocuiSize.h0)
|
win.redrawWindow(win.gocuiSize.w0, win.gocuiSize.h0)
|
||||||
me.stdout.outputOnTop = false
|
me.stdout.outputOnTop = false
|
||||||
setThingsOnTop()
|
setThingsOnTop()
|
||||||
|
|
|
@ -33,7 +33,7 @@ func (callertk *guiWidget) showTextbox() {
|
||||||
if me.textbox.tk == nil {
|
if me.textbox.tk == nil {
|
||||||
// should only happen once
|
// should only happen once
|
||||||
me.textbox.tk = makeNewFlagWidget(me.textbox.wId)
|
me.textbox.tk = makeNewFlagWidget(me.textbox.wId)
|
||||||
me.textbox.tk.dumpWidget("init() textbox")
|
// me.textbox.tk.dumpWidget("init() textbox")
|
||||||
}
|
}
|
||||||
if me.textbox.tk == nil {
|
if me.textbox.tk == nil {
|
||||||
log.Log(GOCUI, "showTextbox() Is Broken")
|
log.Log(GOCUI, "showTextbox() Is Broken")
|
||||||
|
@ -60,7 +60,7 @@ func (callertk *guiWidget) showTextbox() {
|
||||||
me.textbox.tk.setColorModal()
|
me.textbox.tk.setColorModal()
|
||||||
me.textbox.tk.v.Clear()
|
me.textbox.tk.v.Clear()
|
||||||
cur := strings.TrimSpace(callertk.String())
|
cur := strings.TrimSpace(callertk.String())
|
||||||
log.Info("setting textbox string to:", cur)
|
// log.Info("setting textbox string to:", cur)
|
||||||
me.textbox.tk.v.WriteString(cur)
|
me.textbox.tk.v.WriteString(cur)
|
||||||
|
|
||||||
me.textbox.tk.v.Editable = true
|
me.textbox.tk.v.Editable = true
|
||||||
|
@ -95,7 +95,7 @@ func textboxClosed() {
|
||||||
newtext = strings.TrimSpace(newtext)
|
newtext = strings.TrimSpace(newtext)
|
||||||
me.textbox.active = false
|
me.textbox.active = false
|
||||||
me.textbox.tk.Hide()
|
me.textbox.tk.Hide()
|
||||||
log.Info("textbox closed with text:", newtext, me.textbox.callerTK.cuiName)
|
// log.Info("textbox closed with text:", newtext, me.textbox.callerTK.cuiName)
|
||||||
|
|
||||||
if me.clock.tk.v != nil {
|
if me.clock.tk.v != nil {
|
||||||
me.baseGui.SetCurrentView("help")
|
me.baseGui.SetCurrentView("help")
|
||||||
|
|
|
@ -19,15 +19,16 @@ func (tk *guiWidget) setTitle(s string) {
|
||||||
if tk.v == nil {
|
if tk.v == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
tk.setColorWindowTitle()
|
||||||
rect := tk.gocuiSize
|
rect := tk.gocuiSize
|
||||||
rect.w1 = rect.w0 + tk.full.Width() + 1
|
rect.w1 = rect.w0 + tk.full.Width() + 1
|
||||||
// rect.h1 = rect.h0 + 1
|
// rect.h1 = rect.h0 + 1
|
||||||
me.baseGui.SetView(tk.v.Name(), rect.w0, rect.h0, rect.w1, rect.h1, 0)
|
me.baseGui.SetView(tk.v.Name(), rect.w0-1, rect.h0, rect.w1+1, rect.h1, 0)
|
||||||
tk.v.Clear()
|
tk.v.Clear()
|
||||||
f := "%-" + fmt.Sprintf("%d", tk.full.Width()-3) + "s %s"
|
f := " %-" + fmt.Sprintf("%d", tk.full.Width()-3) + "s %s"
|
||||||
// tmp := tk.node.GetLabel() + " " + tk.v.Name() + " " + f
|
// tmp := tk.node.GetLabel() + " " + tk.v.Name() + " " + f
|
||||||
tmp := tk.node.GetLabel()
|
tmp := tk.node.GetLabel()
|
||||||
labelN := fmt.Sprintf(f, tmp, "XX")
|
labelN := fmt.Sprintf(f, tmp, "X")
|
||||||
tk.v.WriteString(labelN)
|
tk.v.WriteString(labelN)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue