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

Enhanced Scrollable Area #3598

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

braza2004
Copy link
Contributor

What I did

I wanted to dynamically change the scrollable area to accommodate all nodes because, as of now, if you zoom out, place a new device, and then zoom back in, and the new device exits the field of view, you cannot scroll to it.

However, I could not find the function where new devices are being added. So, for the time being, I have simply increased the scenes dimensions.

@braza2004
Copy link
Contributor Author

@grossmj can you please review this! Also, can you please suggest a suitable approach to adjust the scrollable area dynamically such that the scene accommodates all devices?

@grossmj
Copy link
Member

grossmj commented Jul 23, 2024

I am sure we should hard code a + 1000 for the scene width and height.

You can configure the default width and height in the preferences:

Screenshot from 2024-07-23 16-02-11

or on a project basis:

Screenshot from 2024-07-23 16-01-58

@braza2004
Copy link
Contributor Author

@grossmj I was not aware of width and height configuration option in preferences. I have undone what I hardcoded previously. Instead, I have recalculated the bounding rectangle every time a zoom action is executed so that the scroll bars allow you to see everything regardless of how zoomed in or zoomed out you are. Please review this!

@braza2004
Copy link
Contributor Author

@grossmj Hi, I wanted to check in and see if you've had the chance to review this. I would really appreciate it if you could give me some feedback.

@grossmj
Copy link
Member

grossmj commented Jul 31, 2024

I got the following traceback so I made some changes to your PR.

Traceback (most recent call last):
  File "/home/grossmj/PycharmProjects/gns3-gui/gns3/topology.py", line 172, in _projectLoadedSlot
    self._main_window.uiGraphicsView.setZoom(self._project.zoom())
  File "/home/grossmj/PycharmProjects/gns3-gui/gns3/graphics_view.py", line 130, in setZoom
    bounding_rect = self.scene.itemsBoundingRect()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'builtin_function_or_method' object has no attribute 'itemsBoundingRect'

@braza2004
Copy link
Contributor Author

@grossmj I was looking at your commit, everything seems fine to me but a check is still failing. If you have the time could you please look into this. Also, it would be great if you could share your email with me I have something important to discuss

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