Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Create edit menu with Copy/Cut/Paste/Select All support#237

Closed
lukevers wants to merge 2 commits intowebview:masterwebview/webview:masterfrom
lukevers:edit-menulukevers/webview:edit-menuCopy head branch name to clipboard
Closed

Create edit menu with Copy/Cut/Paste/Select All support#237
lukevers wants to merge 2 commits intowebview:masterwebview/webview:masterfrom
lukevers:edit-menulukevers/webview:edit-menuCopy head branch name to clipboard

Conversation

@lukevers
Copy link
Copy Markdown

@lukevers lukevers commented Feb 14, 2019

Hi,

This adds support for the following actions on macOS:

  • Cut
  • Copy
  • Paste
  • Select All

It also adds it in an "Edit" menubar to follow the standards set by other macOS applications.

Here's a screenshot of it in an app I'm writing:

screen shot 2019-02-14 at 11 26 13 am


#99

@travismiller
Copy link
Copy Markdown

Awesome! This fixes cut/copy/paste for me on MacOS. 👍

@travismiller
Copy link
Copy Markdown

travismiller commented Feb 16, 2019

This will also add Undo/Redo…

  item = create_menu_item(get_nsstring("Undo"), "undo:", "z");
  objc_msgSend(editMenu, sel_registerName("addItem:"), item);

  item = create_menu_item(get_nsstring("Redo"), "redo:", "y");
  objc_msgSend(editMenu, sel_registerName("addItem:"), item);

  item = objc_msgSend((id)objc_getClass("NSMenuItem"), sel_registerName("separatorItem"));
  objc_msgSend(editMenu, sel_registerName("addItem:"), item);

@lukevers
Copy link
Copy Markdown
Author

Thanks @travismiller! Just added that.

@tobowers
Copy link
Copy Markdown

tobowers commented Jun 3, 2019

Do I have to do something to turn this on? The latest commit ( 16c93bc ) doesn't have an edit menu for me on osx 10.14.5 . Even the examples directory ones.

@tobowers
Copy link
Copy Markdown

tobowers commented Jun 3, 2019

oh - just saw this is still open :)

@brianm
Copy link
Copy Markdown

brianm commented Jun 7, 2019

Any chance this can get merged?

@sbward
Copy link
Copy Markdown

sbward commented Jul 5, 2019

@zserge Are you considering merging this? I'm using JS "keypress" event listeners to work around this; the code smells bad but it works...

nothingismagick pushed a commit to tauri-apps/tauri that referenced this pull request Jul 20, 2019
nothingismagick pushed a commit to tauri-apps/tauri that referenced this pull request Jul 20, 2019
* feat(proton) cargo-bundle fork & features argument

* chore(bundle) rename lib to proton-bundle

* feat(proton.h) merge open PRs from webview

webview/webview/pull/237
webview/webview/pull/222
webview/webview/pull/214

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(licenses) licenses and structure

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* addition to previous commit

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(version) of proton-sys in cargo.toml

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(various) use super: and remove 2018

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(various)

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(rust-2018) update

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(rust-2018) update

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(rust-2018) add lockfiles

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(proton) includedir errors on prod build

* fix(rust-2018) authors, lockfiles and newest stuff

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(cargo-proton-bundle) update readme

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(proton) variable does not live long enough on dev

* chore(proton) remove unnecessary global variable declaration
rajivshah3 added a commit to rajivshah3/web-view that referenced this pull request Jan 8, 2020
Adds edit menu based on webview/webview#237

Co-authored-by: Luke Evers <luke@lukevers.com>
Co-authored-by: Travis Miller <travis@travismiller.com>
rajivshah3 added a commit to rajivshah3/web-view that referenced this pull request Jan 8, 2020
Adds edit menu for macOS apps, based on webview/webview#237

Co-authored-by: Luke Evers <luke@lukevers.com>
Co-authored-by: Travis Miller <travis@travismiller.com>
@brianm
Copy link
Copy Markdown

brianm commented Jan 9, 2020

bump

@zserge
Copy link
Copy Markdown
Collaborator

zserge commented Jan 9, 2020

Well, since this is a macOS-only, highly specific feature (not every app needs such window menu at all) - I would rather close this. At some point we might want to add global window menu API and clipboard API, but before that I don't think such opinionated feature would be of much use for the majority of webview consumers.

Still, thanks for the PR, and I'm sure if will help those who would need such functionality for webview-x branch.

@zserge zserge closed this Jan 9, 2020
@zserge
Copy link
Copy Markdown
Collaborator

zserge commented Jan 9, 2020

The reason I'm closing many PRs now is because I would like to merge webview-x first, with the very minimal core functionality. Then - extend window APIs for all platforms. We don't have much resources to do it all at the same time, thus - core functionality (actual webview, RPC) comes first, window decoration - next. And for window APIs I would like this time to have a well-though API, maybe similar to Electron, rather than one API function per user request.

@lukevers
Copy link
Copy Markdown
Author

lukevers commented Jan 9, 2020

Makes sense @zserge! Anyone who is impatient can always take this code on their own when building locally 😉

nothingismagick pushed a commit to tauri-apps/smoke-tests that referenced this pull request Feb 12, 2020
* feat(proton) cargo-bundle fork & features argument

* chore(bundle) rename lib to proton-bundle

* feat(proton.h) merge open PRs from webview

webview/webview/pull/237
webview/webview/pull/222
webview/webview/pull/214

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(licenses) licenses and structure

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* addition to previous commit

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(version) of proton-sys in cargo.toml

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(various) use super: and remove 2018

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(various)

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(rust-2018) update

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(rust-2018) update

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(rust-2018) add lockfiles

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(proton) includedir errors on prod build

* fix(rust-2018) authors, lockfiles and newest stuff

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(cargo-proton-bundle) update readme

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(proton) variable does not live long enough on dev

* chore(proton) remove unnecessary global variable declaration
nothingismagick pushed a commit to tauri-apps/smoke-tests that referenced this pull request Feb 12, 2020
* feat(proton) cargo-bundle fork & features argument

* chore(bundle) rename lib to proton-bundle

* feat(proton.h) merge open PRs from webview

webview/webview/pull/237
webview/webview/pull/222
webview/webview/pull/214

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(licenses) licenses and structure

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* addition to previous commit

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(version) of proton-sys in cargo.toml

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(various) use super: and remove 2018

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(various)

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(rust-2018) update

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(rust-2018) update

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(rust-2018) add lockfiles

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(proton) includedir errors on prod build

* fix(rust-2018) authors, lockfiles and newest stuff

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(cargo-proton-bundle) update readme

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(proton) variable does not live long enough on dev

* chore(proton) remove unnecessary global variable declaration
nothingismagick pushed a commit to tauri-apps/smoke-tests that referenced this pull request Feb 12, 2020
* feat(proton) cargo-bundle fork & features argument

* chore(bundle) rename lib to proton-bundle

* feat(proton.h) merge open PRs from webview

webview/webview/pull/237
webview/webview/pull/222
webview/webview/pull/214

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(licenses) licenses and structure

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* addition to previous commit

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(version) of proton-sys in cargo.toml

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(various) use super: and remove 2018

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(various)

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(rust-2018) update

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(rust-2018) update

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(rust-2018) add lockfiles

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(proton) includedir errors on prod build

* fix(rust-2018) authors, lockfiles and newest stuff

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* feat(cargo-proton-bundle) update readme

Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>

* fix(proton) variable does not live long enough on dev

* chore(proton) remove unnecessary global variable declaration
@abemedia
Copy link
Copy Markdown
Member

@zserge Are you considering merging this? I'm using JS "keypress" event listeners to work around this; the code smells bad but it works...

@sbward could you share your workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.