Compare commits

..

No commits in common. "8469962c90b2f93519580d3cfd1cc53fa7e60d63" and "d1f0786043a8419d9fd64b6ddf56f9f655a79bd8" have entirely different histories.

View File

@ -72,7 +72,6 @@ func (this *Menu) TearOff () {
this.torn = true this.torn = true
window, err := this.parent.NewChild(this.bounds) window, err := this.parent.NewChild(this.bounds)
window.SetIcon(tomo.IconListChoose)
if err != nil { return } if err != nil { return }
visible := this.Window.Visible() visible := this.Window.Visible()
@ -92,20 +91,20 @@ func (this *Menu) newTearLine () tomo.Object {
tearLine.SetRole(tomo.R("objects", "TearLine")) tearLine.SetRole(tomo.R("objects", "TearLine"))
tearLine.SetFocusable(true) tearLine.SetFocusable(true)
tearLine.OnKeyDown(func (key input.Key, numberPad bool) bool { tearLine.OnKeyDown(func (key input.Key, numberPad bool) bool {
if !isClickingKey(key) { return false } if key != input.KeyEnter && key != input.Key(' ') { return false }
return true return true
}) })
tearLine.OnKeyUp(func (key input.Key, numberPad bool) bool { tearLine.OnKeyUp(func (key input.Key, numberPad bool) bool {
if !isClickingKey(key) { return false } if key != input.KeyEnter && key != input.Key(' ') { return false }
this.TearOff() this.TearOff()
return true return true
}) })
tearLine.OnButtonDown(func (button input.Button) bool { tearLine.OnButtonDown(func (button input.Button) bool {
if !isClickingButton(button) { return false } if button != input.ButtonLeft { return false }
return true return true
}) })
tearLine.OnButtonUp(func (button input.Button) bool { tearLine.OnButtonUp(func (button input.Button) bool {
if !isClickingButton(button) { return false } if button != input.ButtonLeft { return false }
if tearLine.Window().MousePosition().In(tearLine.Bounds()) { if tearLine.Window().MousePosition().In(tearLine.Bounds()) {
this.TearOff() this.TearOff()
} }