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 "pan with mouse" feature #488

Merged
merged 1 commit into from
Jan 23, 2024
Merged

Conversation

wawuwo
Copy link
Contributor

@wawuwo wawuwo commented Jan 23, 2024

Hello!

If merged this PR would add the ability to scroll schematic by moving mouse with middle button pressed down:
panning.webm

It also introduces a change that I'm not quite sure about: I had to delete setHidden(true) and setHidden(false) before and after resizeContents in renderModel method because the Q3ScrollView contents widget didn't receive MouseMove events after hiding and then unhiding the widget. I haven't observed any differences after removing these lines though. May be they don't make any sense now (they were inherited from legacy implementation) and it's OK to remove them.

@zergud
Copy link
Collaborator

zergud commented Jan 23, 2024

thank you for contribution!

@zergud zergud merged commit b9ca7dd into ra3xdh:current Jan 23, 2024
2 checks passed
@ra3xdh
Copy link
Owner

ra3xdh commented Jan 23, 2024

@wawuwo , Thanks for the contribution! It would be good to place a "Pan" button on the toolbar near to "zoom" buttons. This will make the new feature visible for users.

@zergud
Copy link
Collaborator

zergud commented Jan 23, 2024

@ra3xdh pan by pressed down middle button does not require button in toolbar
it is "well known" behavior for EDA end CAD users

@zergud zergud added this to the 24.1.0 milestone Jan 23, 2024
@wawuwo
Copy link
Contributor Author

wawuwo commented Jan 23, 2024

@ra3xdh

It would be good to place a "Pan" button on the toolbar near to "zoom" buttons

Yeah, I see what you mean, but unfortunately it cannot be done just by adding a button :(

If I have correctly understood you, the "Pan" button you mean assumes that by clicking on it the user switches to a "panning mode", which has its own mouse event handlers; and when the user is done panning the previous "mode" has to be restored. I believe I know how to implement this in general, but I'm afraid diving into details may take some time.

If this feature is really needed I think I will be able to work on it, but as @zergud wrote, "press mouse wheel to pan" is a common approach. Hence maybe there is no need for separate panning mode/button and users will discover the feature intuitively by themselves

@ra3xdh
Copy link
Owner

ra3xdh commented Jan 23, 2024

but unfortunately it cannot be done just by adding a button :(

If it requires a sufficient effort to implement, the task may be omitted. The current implementation will be sufficient.

@wawuwo wawuwo deleted the feature-pan-with-mouse branch February 13, 2024 18:35
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.

None yet

3 participants