-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Rewrite layout management code #2172
Conversation
This pull request introduces 1 alert when merging aeae3b1 into a3661fa - view on LGTM.com new alerts:
|
Just took a quick look, the refactoring looks very nice, I'll try to test it and make a better review later :) |
a42a161
to
6e0dec8
Compare
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.
That's a major improvement, well done!! It looks good and I enjoyed it
Notes before looking at the code
-
When clicking "Reset layout" it's not clear to what layout it is going to be reset. So the behavior is unexpected until you are familiar with Cutter. I suggest renaming "Reset layout" to "Reset to default layout".
-
Should "Reset layout" be so separated from "Save layout" and "Layouts >"? I am not sure what I prefer, the Reset to be together, or the layouts. I love them both. This can maybe be solved by organizing it like
-
Plugins: Until now, the widgets of newly added plugins were showed to the user on first-sight. It was usually opened in the right side of the screen. I personally didn't like it. Now, when new plugin is added, the widget of it is added to the main dock, but isn't in focus. I like it. So this is only a quick note about this change to make sure it is intentional.
-
Debug: When entering debug mode the layout was wrong
-
Debug: when stepping, weird things happen to my layout when stepping
-
Debug: Why stack are on the upper view and not Registers? Registers should be top-right and stack should be bottom-right
-
Debug: saved debug layout is available when not in debug which shouldn't be since the debug widgets should not be available when not in debug
Renamed it.
I was thinking about this as well but couldn't come up with good solution.
This is result of trying to place new widgets in somewhat reasonable place. The old behavior didn't scale when you had more than one new widget. Depending on what was the right most widget previous time it sometimes caused broken layout similar to what you saw during debuging with hexwidget slowly expanding.
This might be result of bad layout upgrade. Let me know if you figure out how to reproduce it.
Most likely result of broken layout from previous step.
Weren't registers always at the bottom?
Can't repeat it.
I couldn't decide if we should artificially limit this. If you create some complicated layout wouldn't it be annoying to create it twice instead of loading a debug layout during normal mode and making minor modifications to it? |
Haven't done the tests yet. |
Did the tests. |
General notes
Had time to test 3 test-cases, all passed successfully
|
Hi, thanks again for this awesome PR. |
@xarkes Overview has been not enabled by default for a while. This PR doesn't change that. To be more precise there is code which is supposed to handle third state for overview - automatic show/hide depending on there being something to show in overview. I assume this automatic showing was the default mode some time ago but it broke a while ago resulting in overview not shown by default. |
Yes it is like this for months. We never came with the best solution for WHEN to show it and when not |
Co-authored-by: Itay Cohen <itaycohen23@gmail.com>
This is fantastic work! a big step forward. Much more stable!! |
* Use QDockWidget::toggleViewAction instead of custom solution. * Improve new dock placement.
Your checklist for this pull request
WARNING ❗
This branch performs one way upgrade of settings and layout. If you have some complex layout that you want to keep using in the old Cutter backup your cutter settings.
Detailed description
Can be reviewed. Do not merge into 1.10.3 !
When I started working on this I tried to visualize layout related code structure.
![before](https://user-images.githubusercontent.com/7101031/80803229-62716d00-8bba-11ea-9ccc-1cd4da972e57.png)
![after](https://user-images.githubusercontent.com/7101031/80803239-669d8a80-8bba-11ea-8978-5ae1fc42609e.png)
before:
after:
Test plan (required)
Clean start without upgrade
layout upgrade a)
layout upgrade b)
saving layout modifications
resetting layout (do after previous step)
view property saving
It would be useful if reviewer and maybe more people tried a bunch of random things to see if some sequence of operations or specific layout can cause layout to break.
Closing issues
Not closing #694 , that should be done after finishing second part and implementing layout management UI.
Closes #1921
Maybe closes #1737 . Doesn't do exactly what was asked there, but in my opinion solves the problem in a somewhat acceptable way.
Followup tasks