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

Add button to copy code snippet #56

Merged
merged 7 commits into from
Aug 29, 2024
Merged

Add button to copy code snippet #56

merged 7 commits into from
Aug 29, 2024

Conversation

ryonakano
Copy link
Contributor

Fixes #5
Closes #31

Differences from the previous PR:

  • Use a label instead of the edit-copy icon, so that we can also use it to tell users the text being copied
  • Do not swallow Ctrl + C in case someone selects some part of the snippet and press that hotkey
    • Now we require GLib >= 2.78 because of Timeout.add_once ()

I tried the button to be similar to the one written in the Prior Art of #5, but I'm not familiar with CSS so design feedback is especially appreciated.

スクリーンショット 2024-08-14 17 44 58

Co-authored-by: Antolius <josip.antolis@protonmail.com>
@zeebok
Copy link

zeebok commented Aug 23, 2024

I won't merge in case there is design feedback, but the code looks good

@ryonakano ryonakano requested a review from a team August 23, 2024 10:48
data/Application.css Outdated Show resolved Hide resolved
src/IconView.vala Outdated Show resolved Hide resolved
src/IconView.vala Outdated Show resolved Hide resolved
src/IconView.vala Outdated Show resolved Hide resolved
@ryonakano
Copy link
Contributor Author

@danirabbit Thank you for your detailed reviews! I addressed your comments.

I don't have PCs with a touch screen so I can't test if the copy button get visible on these devices. Could you test that if you have one?

Copy link
Member

@danirabbit danirabbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup that works for me! Can access the button with mouse, keyboard, and touch. Nice job :)

@danirabbit danirabbit merged commit 353d8b2 into main Aug 29, 2024
3 checks passed
@danirabbit danirabbit deleted the ryonakano/copy-button branch August 29, 2024 20:25
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.

Copy button for code snippet
3 participants