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 Transparency feature to pinned image #2943

Closed
kopach opened this issue Oct 10, 2022 · 10 comments
Closed

Add Transparency feature to pinned image #2943

kopach opened this issue Oct 10, 2022 · 10 comments
Assignees
Labels
Enhancement Feature requests and code enhancements
Milestone

Comments

@kopach
Copy link

kopach commented Oct 10, 2022

Feature Description

I often use "pin image" functionality to compare things. E.g. web page before and after change. It would be a really great feature to be able to change the transparency level of a pinned image. This way it would be possible to not only compare things side by side, but also by overlaying pinned image over current state and change transparency of pinned image

@kopach kopach added the Enhancement Feature requests and code enhancements label Oct 10, 2022
@borgmanJeremy borgmanJeremy self-assigned this Oct 10, 2022
@borgmanJeremy
Copy link
Contributor

I like this idea. I have it working mostly but need to add hotkey support.

Check out this PR if you want to play with it early: #2944

@kopach
Copy link
Author

kopach commented Oct 10, 2022

Awesome. As one of control options, I would recommend holding down some key (e.g. Meta or Control) and use mouse scroll.

@mmahmoudian
Copy link
Member

Duplicate of #2251, but I closed that in favor of this issue to keep the PR number in the same issue.

Also this fits well under the #954 .

As one of control options, I would recommend holding down some key (e.g. Meta or Control) and use mouse scroll.

In #954 it was suggested by @aurirjr that "Wheel: Zooming. Ctrl+Wheel: Rotation.". I think we should be very careful about choosing the keybinding, because changing it later would cause a lot of backlash, understandably.

We can use

  • one or a combination of these modifier keys along with mouse wheel: Ctrl, Alt, Shift
  • these keys alone or in combination with the aforementioned modifier keys: Tab, Space, Enter, number keys (risky due to locale settings), letters (risky due to locale settings), +, and -

It is ideal to use + and - as alternative to scrolling in general. The only drawback is that unlike ISO layout, on the ANSI keyboard layout the + is triggered with Shift=. This is the issue regardless of using the QWERTY, Dvorak, or Colemak. To mitigate this, we can accept both + and Shift= at the same time.

image
(source: https://commons.wikimedia.org/wiki/File:Qwerty.svg)

I have no preference on the keybindings.

@eazyAlf
Copy link

eazyAlf commented Oct 11, 2022

Snappy on macos has a feature of pinning screenshots and lowering the opacity via numbers (e.g. 2=20%, 3=30%)

@borgmanJeremy
Copy link
Contributor

@mmahmoudian I kind of like the idea of using numbers, what are your thoughts?

@mmahmoudian
Copy link
Member

mmahmoudian commented Oct 11, 2022

@mmahmoudian I kind of like the idea of using numbers, what are your thoughts?

I actually like the idea and I thought about a version of it before @eazyAlf mentioned it. What I initially thought about was something similar to what we do for tool size (accept a number typed by user in a limited time frame). But then after reading the @eazyAlf comment I thought of a mixed solution:

  1. If the user press [0-9] then we multiply that by 10 and set that as opacity percentage (not transparency). With the exception of 0 which will directly translates to 100% opacity.
  2. If user wants a fine-grained control, then use a leader key/combination (e.g Ctrlu), then type the number. This is somewhat Emacs style (I think vim also have similar concept as well to repeat an action)

This second point above can be used for resizing, rotating, opacity, and any other modification that might come in the future.

I think the method @eazyAlf mentioned is good for quick use and I very much like it, but not granular enough. What do you think?

@eazyAlf
Copy link

eazyAlf commented Oct 12, 2022

Not sure whats @kopach original use case is
never needed it more granular than 10% steps and i've been working daily with image comparisons

But I like the way you would solve it @mmahmoudian

@kopach
Copy link
Author

kopach commented Oct 12, 2022

For me personally, 10% steps should be more than enough.
And as for point #2 from @mmahmoudian suggestion, I would instead recommend using context menu (right mouse click). Key/combination is hard to discover for new users. And as for context menu - there are already some options. So, we can add one more for transparency and then let user type number (as per @mmahmoudian's suggestion) or even use a slider or both.

Here is a screenshot of current context menu options
image

@borgmanJeremy
Copy link
Contributor

added 10% hotkeys and 10% to the context menu. I also agree that 10% is reasonable and we don't need anything more granular than that.

@kopach
Copy link
Author

kopach commented Oct 13, 2022

Just tested the feature from a branch - I like it a lot, works like a charm, thanks a lot @borgmanJeremy
Can't wait for this to be released

@mmahmoudian mmahmoudian added this to the v13 milestone Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Feature requests and code enhancements
Projects
None yet
Development

No branches or pull requests

4 participants