summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-08 09:25:09 -0600
committerJeff Carr <[email protected]>2025-02-08 09:25:09 -0600
commit7b06b81ed3b4e54a5eabd581ecf5144a04074514 (patch)
treecb3b3044aafc592fc208e9e775d0fa4fe654150c
parent9d1a045a1f84c079707f766d999312a6da12824d (diff)
double click windows brings to front
-rw-r--r--eventMouseClick.go25
1 files changed, 17 insertions, 8 deletions
diff --git a/eventMouseClick.go b/eventMouseClick.go
index a5dcab9..92839a6 100644
--- a/eventMouseClick.go
+++ b/eventMouseClick.go
@@ -112,13 +112,15 @@ func (tk *guiWidget) doWidgetClick(w int, h int) {
func doMouseClick(w int, h int) {
dropdownUnclicked(w, h)
- // Flag widgets (dropdown menus, etc) are the highest priority. ALWAYS SEND MOUSE CLICKS THERE FIRST
- for _, tk := range findByXY(w, h) {
- if tk.node.WidgetType == widget.Flag {
- tk.doWidgetClick(w, h)
- return
+ /*
+ // Flag widgets (dropdown menus, etc) are the highest priority. ALWAYS SEND MOUSE CLICKS THERE FIRST
+ for _, tk := range findByXY(w, h) {
+ if tk.node.WidgetType == widget.Flag {
+ tk.doWidgetClick(w, h)
+ return
+ }
}
- }
+ */
// Button widgets
for _, tk := range findByXY(w, h) {
@@ -128,14 +130,20 @@ func doMouseClick(w int, h int) {
}
}
+ var found bool
+
for _, tk := range findByXY(w, h) {
// will show you everything found on a mouse click. great for debugging!
// tk.dumpWidget("click()")
if tk.node.WidgetType == widget.Stdout {
// don't send clicks to the stdout debugging window
- continue
+ // continue
}
- tk.doWidgetClick(w, h)
+ found = true
+ // tk.doWidgetClick(w, h)
+ return
+ }
+ if found {
return
}
@@ -149,6 +157,7 @@ func doMouseDoubleClick(w int, h int) {
for _, tk := range findByXY(w, h) {
if tk.node.WidgetType == widget.Window {
+ tk.redrawWindow(tk.gocuiSize.w0, tk.gocuiSize.h0)
me.stdout.outputOnTop = false
setThingsOnTop()
return