Begin implementation of "scroll to zoom" functionality #906
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Intent of this tiny change is to modify "database overview" model
in such a way, that "scroll to zoom" behaviour is possible.
Changes made affect these two files:
modified: libpgmodeler_ui/src/modelwidget.cpp
modified: libpgmodeler_ui/src/modelwidget.h
These changes finalize modifications to ease navigation in large
projects with standard, 3-button and scroll wheel enabled mouse.
Users now can zoom in and out and pan around the database really
quickly. This is also immensely useful, when analyzing already
existing databases with big numbers of tables.
Code expects this behaviour to be toggleable, given some users
might be used to "scroll wheel to pan up and down" in some
environments, on some platforms.
Second phase would be adding gui toggle into the preferences
dialog and code to config file praser. Although I tried really
hard, I was unable to modify both the gui or config parsing
on my machine.
Quick zoomability also uncovered new tiny glitch as well,
where in small database models, database view ends up in
upper left corner, when fully zoomed out. This can get
pretty confusing on high zoom out levels.
It would be preferrable instead, if model remained centered
to the pgmodeler window, when zooming out too far.
Unfortunately I don't understand the code well enough to do
that either, but I am recording my intent in this commit.