diff options
Diffstat (limited to 'eventMouseMove.go')
| -rw-r--r-- | eventMouseMove.go | 64 |
1 files changed, 46 insertions, 18 deletions
diff --git a/eventMouseMove.go b/eventMouseMove.go index 7b637ec..ff08b01 100644 --- a/eventMouseMove.go +++ b/eventMouseMove.go @@ -93,6 +93,29 @@ func mouseMove(g *gocui.Gui) { } } +func (tk *guiWidget) relocateStdout(w int, h int) { + me.stdout.lastW = w + me.stdout.lastH = h + + w0 := w + h0 := h + w1 := w + me.stdout.w + h1 := h + me.stdout.h + + tk.gocuiSize.w0 = w0 + tk.gocuiSize.w1 = w1 + tk.gocuiSize.h0 = h0 + tk.gocuiSize.h1 = h1 + + tk.full.w0 = w0 + tk.full.w1 = w1 + tk.full.h0 = h0 + tk.full.h1 = h1 + + me.baseGui.SetView("msg", w0, h0, w1, h1, 0) + me.baseGui.SetViewOnBottom("msg") +} + // this is how the window gets dragged around func (tk *guiWidget) moveNew() { w, h := me.baseGui.MousePosition() @@ -108,27 +131,32 @@ func (tk *guiWidget) moveNew() { tk.dumpWidget(s) return } else { - // log.Info("NOT MOVE FLAG. PASSING MOVE TO MSG", tk.node.WidgetType) - // tk.dumpWidget("moveNew() MSG" + tk.cuiName) - w0 := w - me.stdout.offsetW - h0 := h - me.stdout.offsetH - w1 := w - me.stdout.offsetW + me.stdout.w - h1 := h - me.stdout.offsetH + me.stdout.h - me.baseGui.SetView("msg", w0, h0, w1, h1, 0) + newW := w - me.stdout.mouseOffsetW + newH := h - me.stdout.mouseOffsetH + tk.relocateStdout(newW, newH) + /* + // log.Info("NOT MOVE FLAG. PASSING MOVE TO MSG", tk.node.WidgetType) + // tk.dumpWidget("moveNew() MSG" + tk.cuiName) + w0 := w - me.stdout.offsetW + h0 := h - me.stdout.offsetH + w1 := w - me.stdout.offsetW + me.stdout.w + h1 := h - me.stdout.offsetH + me.stdout.h + me.baseGui.SetView("msg", w0, h0, w1, h1, 0) - // me.startOutputW = w - me.stdout.offsetW - // me.startOutputH = h - me.stdout.offsetH - me.baseGui.SetViewOnBottom("msg") + // me.startOutputW = w - me.stdout.offsetW + // me.startOutputH = h - me.stdout.offsetH + me.baseGui.SetViewOnBottom("msg") - tk.gocuiSize.w0 = w0 - tk.gocuiSize.w1 = w1 - tk.gocuiSize.h0 = h0 - tk.gocuiSize.h1 = h1 + tk.gocuiSize.w0 = w0 + tk.gocuiSize.w1 = w1 + tk.gocuiSize.h0 = h0 + tk.gocuiSize.h1 = h1 - tk.full.w0 = w0 - tk.full.w1 = w1 - tk.full.h0 = h0 - tk.full.h1 = h1 + tk.full.w0 = w0 + tk.full.w1 = w1 + tk.full.h0 = h0 + tk.full.h1 = h1 + */ } // always place the help menu on top setThingsOnTop() // sets help, Stdout, etc on the top after windows have been redrawn |
