Repository navigation
feat!: touchpad scroll for zoom (with Ctrl) and pan - #535
Conversation
|
Ok, I definitely need more time to test this, might take a few days. When using the touchpad, it does not feel the same like e.g. in a browser. I need to educate myself about touchpad gestures, though. But my gut feeling is that zooming should be a pinch move without ctrl? Can we figure that out from GTK? Regarding regular mouse:
|
|
No hurry at all - take your time with the testing, and thank you for the feedback! The clamping was intended to prevent the screenshot from moving completely "off-screen", which didn't feel too restrictive during my testing. Could you share a bit more about your workflow and why you'd prefer to move further? I'd love to avoid adding another configuration option if possible, as we already have quite a few. 🙃 Maybe I just remove the clamping code 😉, because less code is better and one can find the way back with the resize-to-regular or fit-to-page toolbar buttons. It's also interesting that it feels sluggish for you - I haven't noticed any lag myself - see video below. As for pinch-to-zoom: Chromium and other apps do support both pinch and Ctrl+Scroll. I rarely use pinch gestures on my laptop (mostly just on my phone), so I completely missed that, but likely people expect it. satty-touchpad-support.mp4 |
ff769df to
489db03
Compare
| if me.modifier.contains(ModifierType::CONTROL_MASK) { | ||
| let mut factor = APP_CONFIG.read().zoom_factor(); | ||
| if me.is_touchpad { | ||
| factor = 1.0 + (factor - 1.0) / 2.0; // decrease a bit |
|
It is now without clamping. |
Well, maybe there wasn't enough time in the morning :) I tried:
And I think these four actions actually did benefit from clamping. Sorry :) However, and this is what I complained about this morning, when I'm using the middle mouse button to pan (and I might continue to do that) the clamping feels very limiting. I think my preference would be to use clamping for panning via scrolling, and no clamping for panning via middle mouse button. Does that make sense?
The problem isn't lag. I think what happened (but I haven't confirmed via debugger) is this: I started to pan via middle mouse button and tried to move around, then accidentally triggered a scroll wheel event and the panning via middle mouse button stopped or at least got interrupted briefly. This is not what happens before the PR, although I'm sure I hit the scroll wheel just the same, the wheel is quite sensitive.
Yeah, I think that could be a good addition. :) |
- zoom with two finger pinch gesture - zoom with two finger scroll and Ctrl modifier - pan with two finger scroll See issue Satty-org#338. Breaking change: Zooming with mouse now also requires Ctrl like in many other apps.
489db03 to
ffce88d
Compare
|
Now with pinch-to-zoom. 🤏 I dare to resurrect clamping - as discussed resize-to-regular or fit-to-page will bring you back if you got lost and it was irritating for you and likely is for others if you do not know the reason for the invisible bounds. |
|
Fair enough :) looks good to me now and pretty much ready to merge, should be fine once the inline comment is resolved. |
|
I'm going to merge this now. If anyone is bothered by the hardcoded value and inversion and/or the zoom factor modification, they can of course open an issue for these, and then we can talk about whether there's a better default, or this needs option(s). |
|
If we might need config in the future it is at robertwidfen:feat/touchpad_zoom_pan_config I will keep it on my stack for a while, but hope that we do not need it 😉 |
See issue #338.
Breaking change: Zooming with mouse now also requires Ctrl like in many other apps.