misc
This commit is contained in:
parent
9d5cd2c865
commit
012273d8d3
|
@ -39,7 +39,7 @@ func mouseMove(g *gocui.Gui) {
|
||||||
// don't move this code out of here
|
// don't move this code out of here
|
||||||
var found bool = false
|
var found bool = false
|
||||||
if currentDrag != nil {
|
if currentDrag != nil {
|
||||||
currentDrag.moveNew(g)
|
currentDrag.moveNew()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, tk := range findByXY(w, h) {
|
for _, tk := range findByXY(w, h) {
|
||||||
|
@ -51,19 +51,19 @@ func mouseMove(g *gocui.Gui) {
|
||||||
for _, tk := range findByXY(w, h) {
|
for _, tk := range findByXY(w, h) {
|
||||||
if tk.node.WidgetType == widget.Flag {
|
if tk.node.WidgetType == widget.Flag {
|
||||||
currentDrag = tk
|
currentDrag = tk
|
||||||
// tk.moveNew(g)
|
// tk.moveNew()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, tk := range findByXY(w, h) {
|
for _, tk := range findByXY(w, h) {
|
||||||
if tk.node.WidgetType == widget.Stdout {
|
if tk.node.WidgetType == widget.Stdout {
|
||||||
currentDrag = tk
|
currentDrag = tk
|
||||||
// tk.moveNew(g)
|
// tk.moveNew()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if tk.node.WidgetType == widget.Label {
|
if tk.node.WidgetType == widget.Label {
|
||||||
currentDrag = tk
|
currentDrag = tk
|
||||||
// tk.moveNew(g)
|
// tk.moveNew()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
found = true
|
found = true
|
||||||
|
@ -89,8 +89,8 @@ func mouseMove(g *gocui.Gui) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is how the window gets dragged around
|
// this is how the window gets dragged around
|
||||||
func (tk *guiWidget) moveNew(g *gocui.Gui) {
|
func (tk *guiWidget) moveNew() {
|
||||||
w, h := g.MousePosition()
|
w, h := me.baseGui.MousePosition()
|
||||||
if tk.node.WidgetType == widget.Window {
|
if tk.node.WidgetType == widget.Window {
|
||||||
/*
|
/*
|
||||||
w1, h1 := tk.Size()
|
w1, h1 := tk.Size()
|
||||||
|
@ -108,7 +108,7 @@ func (tk *guiWidget) moveNew(g *gocui.Gui) {
|
||||||
if tk.node.WidgetType == widget.Flag {
|
if tk.node.WidgetType == widget.Flag {
|
||||||
// outputW, outputH := tk.Size()
|
// outputW, outputH := tk.Size()
|
||||||
// g.SetView(tk.cuiName, w-xOffset, h-yOffset, w-xOffset+outputW+20, h-yOffset+outputH+me.FramePadH+20, 0)
|
// g.SetView(tk.cuiName, w-xOffset, h-yOffset, w-xOffset+outputW+20, h-yOffset+outputH+me.FramePadH+20, 0)
|
||||||
g.SetView(tk.cuiName, w-3, h-3, w+20, h+20, 0)
|
me.baseGui.SetView(tk.cuiName, w-3, h-3, w+20, h+20, 0)
|
||||||
tk.verifyRect()
|
tk.verifyRect()
|
||||||
s := fmt.Sprintf("move(%dx%d) %s ###", w, h, tk.cuiName)
|
s := fmt.Sprintf("move(%dx%d) %s ###", w, h, tk.cuiName)
|
||||||
tk.dumpWidget(s)
|
tk.dumpWidget(s)
|
||||||
|
@ -117,15 +117,15 @@ func (tk *guiWidget) moveNew(g *gocui.Gui) {
|
||||||
// g.SetViewOnBottom(tk.cuiName)
|
// g.SetViewOnBottom(tk.cuiName)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
log.Info("NOT MOVE FLAG. PASSING MOVE TO MSG", tk.node.WidgetType)
|
// log.Info("NOT MOVE FLAG. PASSING MOVE TO MSG", tk.node.WidgetType)
|
||||||
}
|
}
|
||||||
tk.dumpWidget("moveNew() on " + tk.cuiName)
|
// tk.dumpWidget("moveNew() MSG" + tk.cuiName)
|
||||||
outputW := 180
|
outputW := 180
|
||||||
outputH := 40
|
outputH := 40
|
||||||
g.SetView("msg", w-xOffset, h-yOffset, w-xOffset+outputW, h-yOffset+outputH+me.FramePadH, 0)
|
me.baseGui.SetView("msg", w-xOffset, h-yOffset, w-xOffset+outputW, h-yOffset+outputH+me.FramePadH, 0)
|
||||||
me.startOutputW = w - xOffset
|
me.startOutputW = w - xOffset
|
||||||
me.startOutputH = h - yOffset
|
me.startOutputH = h - yOffset
|
||||||
g.SetViewOnBottom("msg")
|
me.baseGui.SetViewOnBottom("msg")
|
||||||
}
|
}
|
||||||
|
|
||||||
func createStdout(g *gocui.Gui) bool {
|
func createStdout(g *gocui.Gui) bool {
|
||||||
|
|
Loading…
Reference in New Issue