Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use native clipboard on macos #2031

Merged
merged 2 commits into from
Aug 2, 2023
Merged

Conversation

stonerl
Copy link
Collaborator

@stonerl stonerl commented Aug 1, 2023

On macOS we need the native Edit menu to make all keyboard shortcuts accessable.

The shortcuts can copy/cut/paste text and nodes. But using entries from the menu itself only interacts with text.

Therefore on macOS a new menu is added: "Nodes"

Menu structure:

*Nodes
|
|- Undo
|- Redo
|--------
|- Cut
|- Copy
|- Paste
|--------
|- Duplicate
|- Duplicate with Connections

This menus sole purpose is to give the user a menu to interact with Nodes.

closes #1590

@stonerl
Copy link
Collaborator Author

stonerl commented Aug 1, 2023

Just to give you a comparison.

New implementation

CleanShot 2023-08-01 at 21 47 29

Current implementation

CleanShot 2023-08-01 at 21 52 46

@joeyballentine
Copy link
Member

FYI this does not close #958. That issue is with the copy to clipboard node, not frontend copy/paste. That issue will be resolved when we switch from pasteboard to a custom rust binding

@stonerl
Copy link
Collaborator Author

stonerl commented Aug 1, 2023

Ah, I see. Removed the issue from the message.

So I better re-add pasteboard for the moment?

@joeyballentine
Copy link
Member

yes, you should not remove pasteboard in this.

@stonerl
Copy link
Collaborator Author

stonerl commented Aug 1, 2023

Okay, reverted the changes. Pasteboard is back in.

On macOS we need the native Edit menu to make all keyboard shortcuts accessable.

The shortcuts can copy/cut/paste text and nodes. But using entries from the menu
itself only interacts with text.

Therefore on macOS a new menu is added: "Nodes"

Menu structure:

*Nodes
|
|- Undo
|- Redo
|--------
|- Cut
|- Copy
|- Paste
|--------
|- Duplicate
|- Duplicate with Connections

This menus sole purpose is to give the user a menu to interact with Nodes.

closes chaiNNer-org#1590
The View Menu is now located between Edit and Nodes to align it more with the default menu structure on macOS.

Also the Window Menu used on Macs has been added.
@stonerl
Copy link
Collaborator Author

stonerl commented Aug 2, 2023

Here is the new menu on macOS in action.

CleanShot 2023-08-02 at 11 33 30

@RunDevelopment
Copy link
Member

the native Edit menu

I never used macOS, so I had no idea such a thing even exists. Thank you for fixing this!

@RunDevelopment
Copy link
Member

I can't test this, but the code looks good!

@joeyballentine joeyballentine merged commit 5aab59b into chaiNNer-org:main Aug 2, 2023
@stonerl stonerl deleted the clipboard branch August 2, 2023 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(bug) MacOS copy/paste/duplicate happens twice with keyboard shortcuts
3 participants