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

CelView: Add dragging for mouse #122

Merged
merged 2 commits into from
Nov 3, 2023

Conversation

tetektoza
Copy link
Contributor

@tetektoza tetektoza commented Oct 22, 2023

This patch adds dragging for mouse, so by pressing middle mouse button dragging mode is being changed to scroll hand drag, basically it allows to navigate on the image without pressing scroll bars.

Adds this functionality:

dragging.mp4

@tetektoza tetektoza force-pushed the add_mouse_dragging branch 2 times, most recently from 97c855d to ae3e542 Compare October 22, 2023 16:15
@tetektoza tetektoza marked this pull request as draft October 22, 2023 16:22
@tetektoza tetektoza marked this pull request as ready for review October 22, 2023 16:36
@tetektoza tetektoza marked this pull request as draft October 22, 2023 22:24
@tetektoza tetektoza force-pushed the add_mouse_dragging branch 2 times, most recently from db0fa63 to 25b6d45 Compare October 23, 2023 22:21
@tetektoza tetektoza marked this pull request as ready for review October 24, 2023 16:37
@AJenbo
Copy link
Member

AJenbo commented Oct 30, 2023

Would it make sens to have it be shace+click like in PhotoShop or middle button like in GIMP?

@tetektoza tetektoza force-pushed the add_mouse_dragging branch 2 times, most recently from b607665 to a3fe172 Compare October 31, 2023 12:01
@tetektoza
Copy link
Contributor Author

Would it make sens to have it be shace+click like in PhotoShop or middle button like in GIMP?

I've remade it so it uses middle mouse button for dragging as we've agreed.

@AJenbo
Copy link
Member

AJenbo commented Oct 31, 2023

I noticed one issue, when you start a drag move it always assumes the scroll bars are at 0x0, so if you have it zoomed to a degree where something is more then 1 screen off there is no way to get to it via dragning.

@tetektoza tetektoza force-pushed the add_mouse_dragging branch 2 times, most recently from 4cfb4d7 to c790b86 Compare November 1, 2023 23:18
This patch adds dragging for mouse, so by pressing middle mouse button
dragging mode is being changed to scroll hand drag, basically it allows
to navigate on the image without pressing scroll bars.

To do that, View class had to be introduced which has been introduced to
override some of QGraphicsView mouse events and to promote QGraphicsView
widget to it.
This patch promotes QGraphicsView widget to View class in
LevelCelView/CelView ui forms, so events for mouse can be dispatched
properly.
@AJenbo AJenbo merged commit ffb5b1a into diasurgical:master Nov 3, 2023
5 checks passed
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.

2 participants