-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Give clim popup a minimum width and make sure it stays on screen when layer controls are floating #869
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, I was able to verified the old undesirable performance on master and the fix on this branch. Ideally I'd like us to wait until our CI issues are fixed until merge just so we know everything passes, but then this is ready for 0.2.10
Are we positive this is the behaviour we want? e.g. if I've undocked the controls and moved the sliders to another monitor, I think if I right click my preferred behaviour is that I get a popup on the same monitor as the controls... It should not be the width of the controls window but rather much wider. Thoughts? |
I'm not positive, no... but currently, the undocked layer controls are rather small by default ... so we either need to do this, or do what you say where the popup extends well beyond the edges of the parent window. |
I don't think this is super urgent, and I'd rather take the time to get it right. Yes, doing it correctly does sound like a mess, but otherwise, we're back to the old napari, moving back and forth between controls on the left of the canvas and the ones on the right. I actually find myself getting frustrated just thinking about right-clicking on one part of the screen and having the controls pop up somewhere else 😂 |
can you clarify exactly what you would want the behavior to be then? assuming the popup always appears at the top of the layer controls... what minimum width? and if the layer controls are at the edge of the monitor, you want the popup to keep that minimum width but have the edge of the popup hit the edge of the monitor and then extend off-centered off the edge of the layer controls? |
Yes, that's exactly what I would expect, kind of like any other right-click menu really... |
How about at the top of the layer controls width defined by some fraction of the entire screen width (say 2/3 or 3/4 assuming it's easy to grab) and then either centered on screen if controls are in the middle or left aligned if controls are very far on left, and right aligned if very far on right (again assuming you can find out where the control panels are). Agreed this logic is a little more complicated, but I think we can then get it looking nice for the majority of configurations |
sounds good. will work on it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 🚀 😍
I just tested this and works great for me. I'd say good to go after fixing the windows test and addressing Juan's comment on |
One comment @tlambert03 - that can wait for future PRs - but if we like the ideas in #879 we might want to make the slider popup be vertically aligned with the slider your clicking on instead of with the top of the viewer. This could mean less mouse movements if you're clicking on many of these, maybe also if the control panel is docked underneath the layers list |
I'm 👎 on the vertical sliders... It seems weird. I haven't encountered that in any other software, and when I imagine it I think I would find it jarring. |
I think you might be misunderstanding @jni / maybe I was very unclear with my wording - I'm just talking about the vertical alignment of the slider (i.e. how high / low it is on the screen), the slider is still horizontal. Does this make more sense now? Or am I misunderstanding you. I can put a screenshot in if needed |
Ah! Yes, I totally misunderstood. 🤦♂️ All good! 👍 |
If @AhmetCanSolak wants to play with that idea in #879, I would suggest starting with the |
Description
This PR makes sure that right clicking on the contrast limits slider shows the popup in the main viewer window even if the layer controls are undocked/floating. It does so by adding a bottom up
find_ancestor_mainwindow(widget)
utility function, and slightly updates theQtPopup.show_at
method. Would be nice to include this with #866 in the next bugfix release.Type of change
How has this been tested?
find_ancestor_mainwindow
function works.Final checklist: