summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eventMouseDrag.go37
1 files changed, 18 insertions, 19 deletions
diff --git a/eventMouseDrag.go b/eventMouseDrag.go
index 2829708..137e421 100644
--- a/eventMouseDrag.go
+++ b/eventMouseDrag.go
@@ -46,6 +46,16 @@ func mouseMove(g *gocui.Gui) {
v.Highlight = true
}
}
+
+ // old hack. 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) {
+ return
+ }
+ return
+ }
+
// END HIGHLIGHTING
// Super Mouse Mode. very useful for debugging in the past. also, just fun
@@ -57,30 +67,19 @@ func mouseMove(g *gocui.Gui) {
}
}
- // how long has the mouse button been pressed down?
- if time.Since(me.mouse.down) < me.mouse.clicktime {
- // log.Info("not yet")
- return
- }
- // okay, the mouse button has been pressed down for a while.
- // below here is mouse dragging
-
- if me.dropdown.active || me.textbox.active {
- // can't drag or do anything when dropdown or textbox are visible
+ if me.mouse.mouseUp {
return
}
- // okay, the mouse is down and it has been long enough
- // the user is trying to drag something. let's figure out what
+ // EVERYTHING BELOW THIS IS RELATED TO MOUSE DRAGGING
- // 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) {
- return
- }
+ // has the mouse been pressed down long enough to start dragging?
+ if time.Since(me.mouse.down) < me.mouse.clicktime {
+ // not dragging
return
}
- if me.mouse.mouseUp {
+ if me.dropdown.active || me.textbox.active {
+ // can't drag
return
}
@@ -90,7 +89,7 @@ func mouseMove(g *gocui.Gui) {
me.mouse.currentDrag.moveNew()
return
}
- log.Info(fmt.Sprintf("gui toolkit error. nothing to drag at (%d,%d)", w, h))
+ log.Info(fmt.Sprintf("gocui gui toolkit plugin error. nothing to drag at (%d,%d)", w, h))
return
}