-
-
Notifications
You must be signed in to change notification settings - Fork 41
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 fit image into current view #281
Conversation
442b153
to
624dade
Compare
The approach with
|
42d0412
to
affee00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good and seems to work but the -1 as message I would replace with a dedicated signal.
Also something that I've noticed, when I fit the image to view, I get something like 116% zoom value and our zoom increments are 10% so I cannot get back to 100% without using the keyboard shortcut CTRL+0
which I had forgotten about myself, event though I'm the one who implemented it. What do you think about another button with corresponding signal that resets the view to 100% or do you think that this is overkill?
Any tests?
void ViewZoomer::setZoomValue(double value) | ||
{ | ||
// ZoomPicker's mFitImageButton() sets value to -1 | ||
if (value < 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, this is a bit strange. When you think about it, the zoom value has not yet change but rather you want to send a notification from the zoom picker to the ViewZoomer and the ViewZoomer then does something that changes the zoom value and this new zoom value should be sent back to the zoom picker. So maybe a new signal for the zoom picker that the ViewZoomer listens to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That means going trough AnnotationGeneralSettings
, over AnnotationSettingsAdapter
and land in AbstractSettingsProvider
to access mZoomValueProvider
:D
hold my beer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, added as additional commit instead of --amend
ing.
affee00
to
cd9d9d5
Compare
Ok, makes more sense.
yeah, that sounds reasonable. Fixed so it reverts to 10% in/decrements on manual zoom change:
Scrolling back to 100% is fast and easy. Wouldn't be a problem to add (and invoke my icon drawing skills again haha).
Tested standalone and in Spectacle. Looks like it always misses by 1% when fitting in Spectacle. |
Hm, build failing on github, working fine on my end. :s |
Looks like you have changed the ZoomProvider interface but not the Mock that implements it for the tests. I guess you're not building the tests local that's why it builds locally but not on the CI. You need to enable the test build, then you'll see it |
ea98287
to
7123c70
Compare
Sorry for the delay, merged. I think I'll have a look into the reset icon, it's a bit redundant to have 100% twice there, but for now it's fine. Thanks for providing this PR! |
No problem. What other icon do you mean with reset? Can't see any other |
Hm, the rotating arrows remind me too much of the 'rotate image' button. |
Adds a button so the user can fit the image to the current view.
Does not automatically fit image. Do we want that?
as requested in: #21