mouse drag was not always right
This commit is contained in:
parent
5a84456c7a
commit
82ed687460
19
dropdown.go
19
dropdown.go
|
@ -113,22 +113,3 @@ func (w *guiWidget) dropdownClicked(mouseW, mouseH int) string {
|
|||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
/*
|
||||
func dropdownUnclicked(w, h int) {
|
||||
var d *guiWidget
|
||||
|
||||
// examine everything under X & Y on the screen)
|
||||
for _, tk := range findByXY(w, h) {
|
||||
// tk.dumpWidget("dropdownUnclicked()")
|
||||
if tk.node.WidgetType == widget.Dropdown {
|
||||
d = tk
|
||||
}
|
||||
}
|
||||
if d == nil {
|
||||
// log.Log(GOCUI, fmt.Sprintf("dropdownUnclicked() there was no dropdown widget at (w=%d h=%d)", mouseW, mouseH))
|
||||
return
|
||||
}
|
||||
// log.Log(GOCUI, "dropdownUnclicked()", d.node.Strings(), "end. now try to enable me.dropdownV")
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -70,6 +70,7 @@ func mouseDown(g *gocui.Gui, v *gocui.View) error {
|
|||
// log.Info("mouse down resize off", s)
|
||||
me.mouse.resize = false
|
||||
}
|
||||
win.setAsDragging()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
10
find.go
10
find.go
|
@ -200,3 +200,13 @@ func ctrlDown(g *gocui.Gui, v *gocui.View) error {
|
|||
log.Info("todo: clicked with ctrlDown")
|
||||
return nil
|
||||
}
|
||||
|
||||
func (tk *guiWidget) findParentWindow() *guiWidget {
|
||||
if tk.node.WidgetType == widget.Window {
|
||||
return tk
|
||||
}
|
||||
if tk.parent == nil {
|
||||
return nil
|
||||
}
|
||||
return tk.parent.findParentWindow()
|
||||
}
|
||||
|
|
|
@ -105,4 +105,9 @@ func textboxClosed() {
|
|||
|
||||
// send an event from the plugin with the new string
|
||||
me.myTree.SendUserEvent(me.textbox.callerTK.node)
|
||||
|
||||
win := me.textbox.callerTK.findParentWindow()
|
||||
if win != nil {
|
||||
win.dumpWidget("redraw this!!!")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue