Menu windows actually work properly now

This commit is contained in:
2023-04-10 18:07:49 -04:00
parent 2987331a31
commit d67aac3d4f
3 changed files with 30 additions and 3 deletions

View File

@@ -198,11 +198,13 @@ func (window *window) handleButtonPress (
insideWindow := image.Pt (
int(buttonEvent.EventX),
int(buttonEvent.EventY)).In(window.metrics.bounds)
int(buttonEvent.EventY)).In(window.canvas.Bounds())
scrolling := buttonEvent.Detail >= 4 && buttonEvent.Detail <= 7
if !insideWindow && window.shy {
if !insideWindow && window.shy && !scrolling {
window.Close()
} else if buttonEvent.Detail >= 4 && buttonEvent.Detail <= 7 {
} else if scrolling {
if child, ok := window.child.(tomo.ScrollTarget); ok {
sum := scrollSum { }
sum.add(buttonEvent.Detail, window, buttonEvent.State)