summaryrefslogtreecommitdiff
path: root/eventMouseMove.go
diff options
context:
space:
mode:
Diffstat (limited to 'eventMouseMove.go')
-rw-r--r--eventMouseMove.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/eventMouseMove.go b/eventMouseMove.go
index f7c5454..991bd62 100644
--- a/eventMouseMove.go
+++ b/eventMouseMove.go
@@ -43,6 +43,12 @@ func mouseMove(g *gocui.Gui) {
return
}
for _, tk := range findByXY(w, h) {
+ if tk.node.WidgetType == widget.Window {
+ currentDrag = tk
+ return
+ }
+ }
+ for _, tk := range findByXY(w, h) {
if tk.node.WidgetType == widget.Flag {
currentDrag = tk
// tk.moveNew(g)
@@ -85,6 +91,14 @@ func mouseMove(g *gocui.Gui) {
// this is how the window gets dragged around
func (tk *guiWidget) moveNew(g *gocui.Gui) {
w, h := g.MousePosition()
+ if tk.node.WidgetType == widget.Window {
+ w1, h1 := tk.Size()
+ g.SetView(tk.cuiName, w, h, w+w1, h+h1, 0)
+ tk.verifyRect()
+ s := fmt.Sprintf("move(%dx%d) %s ###", w, h, tk.cuiName)
+ tk.dumpWidget(s)
+ return
+ }
if tk.node.WidgetType == widget.Flag {
// outputW, outputH := tk.Size()
// g.SetView(tk.cuiName, w-xOffset, h-yOffset, w-xOffset+outputW+20, h-yOffset+outputH+me.FramePadH+20, 0)