Skip to content

Commit

Permalink
Merge pull request #2341 from Jacalz/entryShortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed Jul 27, 2021
2 parents 4b6732b + cc42fee commit dbd4284
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions widget/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,21 +497,20 @@ func (e *Entry) TappedSecondary(pe *fyne.PointEvent) {
}

e.requestFocus()
clipboard := fyne.CurrentApp().Driver().AllWindows()[0].Clipboard()
super := e.super()

cutItem := fyne.NewMenuItem("Cut", func() {
clipboard := fyne.CurrentApp().Driver().AllWindows()[0].Clipboard()
e.cutToClipboard(clipboard)
super.(fyne.Shortcutable).TypedShortcut(&fyne.ShortcutCut{Clipboard: clipboard})
})
copyItem := fyne.NewMenuItem("Copy", func() {
clipboard := fyne.CurrentApp().Driver().AllWindows()[0].Clipboard()
e.copyToClipboard(clipboard)
super.(fyne.Shortcutable).TypedShortcut(&fyne.ShortcutCopy{Clipboard: clipboard})
})
pasteItem := fyne.NewMenuItem("Paste", func() {
clipboard := fyne.CurrentApp().Driver().AllWindows()[0].Clipboard()
e.pasteFromClipboard(clipboard)
super.(fyne.Shortcutable).TypedShortcut(&fyne.ShortcutPaste{Clipboard: clipboard})
})
selectAllItem := fyne.NewMenuItem("Select all", e.selectAll)

super := e.super()
entryPos := fyne.CurrentApp().Driver().AbsolutePositionForObject(super)
popUpPos := entryPos.Add(fyne.NewPos(pe.Position.X, pe.Position.Y))
c := fyne.CurrentApp().Driver().CanvasForObject(super)
Expand Down

0 comments on commit dbd4284

Please sign in to comment.