浏览代码

Fix button disabled behavior

Daniel Salvadori 6 年之前
父节点
当前提交
10379ebca7
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      gui/button.go

+ 4 - 0
gui/button.go

@@ -136,6 +136,10 @@ func (b *Button) onCursor(evname string, ev interface{}) {
 // onMouseEvent process subscribed mouse events
 func (b *Button) onMouse(evname string, ev interface{}) {
 
+	if !b.Enabled() {
+		return
+	}
+
 	switch evname {
 	case OnMouseDown:
 		Manager().SetKeyFocus(b)