Skip to content

Commit

Permalink
Update last addition
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Aug 17, 2019
1 parent 7d2cbec commit 123d31a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ More detailed release notes can be found on the [releases page](https://github.c

### Changed

* Dismiss non-modal popovers on secondary tap
* Only measure visible objects in layouts and minSize calculations (#343)
* Don't propagate show/hide in the model - allowing children of tabs to remain hidden
* Disable cut/copy for password fields
Expand Down
14 changes: 13 additions & 1 deletion test/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package test

import "fyne.io/fyne"

// Tap simulates a mouse click on the specified object
// Tap simulates a left mouse click on the specified object
func Tap(obj fyne.Tappable) {
if focus, ok := obj.(fyne.Focusable); ok {
if focus != Canvas().Focused() {
Expand All @@ -14,6 +14,18 @@ func Tap(obj fyne.Tappable) {
obj.Tapped(ev)
}

// TapSecondary simulates a right mouse click on the specified object
func TapSecondary(obj fyne.Tappable) {
if focus, ok := obj.(fyne.Focusable); ok {
if focus != Canvas().Focused() {
Canvas().Focus(focus)
}
}

ev := &fyne.PointEvent{Position: fyne.NewPos(1, 1)}
obj.TappedSecondary(ev)
}

func typeChars(chars []rune, keyDown func(rune)) {
for _, char := range chars {
keyDown(char)
Expand Down

0 comments on commit 123d31a

Please sign in to comment.