Compare commits
No commits in common. "8469962c90b2f93519580d3cfd1cc53fa7e60d63" and "d1f0786043a8419d9fd64b6ddf56f9f655a79bd8" have entirely different histories.
8469962c90
...
d1f0786043
9
menu.go
9
menu.go
@ -72,7 +72,6 @@ func (this *Menu) TearOff () {
|
||||
this.torn = true
|
||||
|
||||
window, err := this.parent.NewChild(this.bounds)
|
||||
window.SetIcon(tomo.IconListChoose)
|
||||
if err != nil { return }
|
||||
|
||||
visible := this.Window.Visible()
|
||||
@ -92,20 +91,20 @@ func (this *Menu) newTearLine () tomo.Object {
|
||||
tearLine.SetRole(tomo.R("objects", "TearLine"))
|
||||
tearLine.SetFocusable(true)
|
||||
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
|
||||
})
|
||||
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()
|
||||
return true
|
||||
})
|
||||
tearLine.OnButtonDown(func (button input.Button) bool {
|
||||
if !isClickingButton(button) { return false }
|
||||
if button != input.ButtonLeft { return false }
|
||||
return true
|
||||
})
|
||||
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()) {
|
||||
this.TearOff()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user