-
Notifications
You must be signed in to change notification settings - Fork 30
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
Make traffic and device windows display correctly #191
base: main
Are you sure you want to change the base?
Conversation
I've just tried this on Linux, and it doesn't really seem like an improvement to me. It just stops me from moving the pane dividers freely. We don't actually want to enforce minimum sizes for the panes. The only reason I added those sizes was that they cause the panes to appear with reasonable initial proportions (e.g. ~75% traffic pane / ~25% device pane) at startup, rather than being split down the middle by default. They also cause the window to appear at a reasonable initial size. The problems with the existing behaviour in my view are:
This change does stop the left edge of the traffic view from disappearing as the window size is reduced, but only does so by preventing the user from moving the pane dividers. What we need is for the list views to always follow the size of the panes. |
In my initial commit the pane divders were able to be moved, but the minimum content sizes for the traffic and device windows were enforced. When the app first starts, the size of these windows were currently at their minimum sizes. This means that the dividers were not able to be moved until the window was enlarged. Based on your feedback I have added a new commit which removes the explicit minimum content sizes. It seems that the scroll windows internally still calculate some "minimum content" sizes, however these are quite small so the user isn't inconvenienced by them and the divders can be chaned when the app first starts. I also added in some calculations to set the initial size of the traffic window as a percentage of the horizontal and vertical panes. These values are not pixel perfect since the actual sizes of the app window, action bar, status bar etc are not available at init time, and there may be some system specific differences that makes the values slightly different between windows, mac, linux etc. However the values calculated should produce acceptable initial settings for the UI, which are better than we have currently. The user is able to then change them if needed at runtime, without any real limitations. As before I have only tested this in Windows 11. I choose values for "traffic_width_percent", "traffic_height_percent", "app_width", "app_height" that I thought worked well. However you may wish to use some other values for these. |
Just to summarise some further discussion on this that @x0rloser and I had on Discord: With the latest commit, I had two issues:
I suspect that what we need to do is connect some signal on the |
This PR fixes the below listed issues, which includes issue #132 from the issue tracker:
I have only tested these fixes in windows 11.
This does not fix:
I think this might be due to an issue in the 'traffic_view' and 'device_view' related code, rather than the UI init code that was changed here. My reason for this thinking is that when I set the horizontal scrollbar to "always" be displayed for traffic and device windows, it shows the scroll bar as taking up the full space and so unable to be moved left or right. This is the scrollbar behaviour you get when it thinks the contents already fits into the scrollable window, and so doesn't need scrolling. So it seems like 'traffic_view' and 'device_view' are maybe misrepresenting the size of their rows.