Compare commits
2 Commits
d1f0786043
...
8469962c90
Author | SHA1 | Date | |
---|---|---|---|
8469962c90 | |||
0ccdb609ef |
9
menu.go
9
menu.go
@ -72,6 +72,7 @@ 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()
|
||||||
@ -91,20 +92,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 key != input.KeyEnter && key != input.Key(' ') { return false }
|
if !isClickingKey(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 key != input.KeyEnter && key != input.Key(' ') { return false }
|
if !isClickingKey(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 button != input.ButtonLeft { return false }
|
if !isClickingButton(button) { return false }
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
tearLine.OnButtonUp(func (button input.Button) bool {
|
tearLine.OnButtonUp(func (button input.Button) bool {
|
||||||
if button != input.ButtonLeft { return false }
|
if !isClickingButton(button) { return false }
|
||||||
if tearLine.Window().MousePosition().In(tearLine.Bounds()) {
|
if tearLine.Window().MousePosition().In(tearLine.Bounds()) {
|
||||||
this.TearOff()
|
this.TearOff()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user