Create edit menu with Copy/Cut/Paste/Select All support#237
Create edit menu with Copy/Cut/Paste/Select All support#237lukevers wants to merge 2 commits intowebview:masterwebview/webview:masterfrom
Conversation
|
Awesome! This fixes cut/copy/paste for me on MacOS. 👍 |
|
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); |
|
Thanks @travismiller! Just added that. |
|
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. |
|
oh - just saw this is still open :) |
|
Any chance this can get merged? |
|
@zserge Are you considering merging this? I'm using JS |
webview/webview/pull/237 webview/webview/pull/222 webview/webview/pull/214 Signed-off-by: Daniel Thompson-Yvetot <denjell@quasar.dev>
* 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
Adds edit menu based on webview/webview#237 Co-authored-by: Luke Evers <luke@lukevers.com> Co-authored-by: Travis Miller <travis@travismiller.com>
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>
|
bump |
|
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. |
|
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. |
|
Makes sense @zserge! Anyone who is impatient can always take this code on their own when building locally 😉 |
* 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
* 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
* 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
Hi,
This adds support for the following actions on macOS:
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:
#99