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
Revert ability for move and show/hide toolbars #8719
Revert ability for move and show/hide toolbars #8719
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.
works for me
Codecov Report
@@ Coverage Diff @@
## master #8719 +/- ##
==========================================
+ Coverage 55.78% 56.09% +0.31%
==========================================
Files 900 900
Lines 65072 65099 +27
Branches 11745 11813 +68
==========================================
+ Hits 36300 36518 +218
+ Misses 25923 25666 -257
- Partials 2849 2915 +66
Flags with carried forward coverage won't be shown. Click here to find out more. |
In my case, that doesn't solve the main problem I introduced with #8572, that is that the "Branch/filter" toolbar is displayed before the "Main" toolbar: So, with this PR, this is somewhat worse because this layout is now no more changeable... @RussKie Do you know where the toolbar positions are saved? I would like to see if the values are well saved... |
I don't think this has anything to do with the saved data, as it is no longer used - I've removed all associated code. |
@pmiossec I've run this on two different PCs and haven't observed any issues. |
bb77960
to
de4ec45
Compare
Created a new worktree (so clean workspace) and I have this behavior (still the same):
I will still have a look... |
What didn't work:
But changing the DPI scale to 100% instead of 200% fix the toolbar positioning. |
So any latest build renders correctly on <200%, and incorrect on 200%? |
No, it took me some time to find the reason, so I just had some time to test 100% and 200% (that I use every days) with the code corresponding to this PR. I can just assert that every build since the introduction of the 2 toolbars (with this revert or not) display badly 200%. So before merging this revert, we have to test different dpi scaling to better understand. And if doesn't work, perhaps we will just have to revert the cut in 2 toolbars (until we find a fix) |
Quick test: only 100% display toolbars well. 125%, 150%, 175%, 200% and 225% failed (and I stopped here) |
I can repro the issue, thank you. Investigating |
Pushed a possible workaround, please try it. |
It took me awhile, but I got a clean repro: https://github.com/RussKie/Test-ToolStripOrder |
@pmiossec have had a chance to test? |
Yes, I reproduce with this repository |
Were you able to test the latest fix?
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
After a new test, work as expected.
2 things about the cutting of the toolbars.
I think we should create a new toolbar and display it after the 2 other toolbars to get something like that (so that we kept the toolbar layout in the current release):
Please have a look at my branch that did this 2 things: https://github.com/pmiossec/gitextensions/tree/new_toolbar_for_scripts |
Thank you, works for me :) |
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.
+1
// if the 1st one becomes longer than the 2nd toolbar's Location.X | ||
// the layout engine will be place the 2nd toolbar first | ||
toolPanel.TopToolStripPanel.Controls.Clear(); | ||
toolPanel.TopToolStripPanel.Controls.Add(ToolStripScripts); |
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.
If the order is left-to-right display order, should the order consistently be Filters, Sscripts, Main?
and I would prefer to remove/add button by button instead, splitting the toolbar is not adding much...
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.
splitting the toolbar is not adding much
It is adding if a) toolbar can be moved, and b) toolbars can be shown/hidden. "a" obviously doesn't work at this stage, but "b" is working just fine.
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.
should the order consistently be Filters, Sscripts, Main?
The order is: Main, Filters, Scripts.
We also need to restore persistence of shown/hidden state as well. |
Due to discovered layout and placement instability of toolbars reverting most of the functionality added in gitextensions#8572. Closes gitextensions#8680
e10a3d8
to
43cf6b5
Compare
Merging, we can deal with saving/restoring visibility of the toolbars separately. |
Reintroduce ability to move toolstrips (as proposed in gitextensions#8572). This implementation is heavily influenced by the original implementation ToolStripSettingsManager in Windows Forms, however we only track visibility and location of each individual toolstrip. We're also only saving specified toolstrips as opposed to saving all known toolstrips (which in various situations results in terminal failures to restore toolstrips information). There are two key changes: 1. Restore toolstrip locations after the form's geometry has been restored. This ensures the toolstrips can be placed at the same coords as they were saved. 2. Hosting ToolStripPanel's padding must be set to 0 before toolstrips' locations can be restored/saved. This mitigates dotnet/winforms#4449 Fixes gitextensions#8680 Reverts gitextensions#8719
Reintroduce ability to move toolstrips (as proposed in gitextensions#8572). This implementation is heavily influenced by the original implementation ToolStripSettingsManager in Windows Forms, however we only track visibility and location of each individual toolstrip. We're also only saving specified toolstrips as opposed to saving all known toolstrips (which in various situations results in terminal failures to restore toolstrips information). There are two key changes: 1. Restore toolstrip locations after the form's geometry has been restored. This ensures the toolstrips can be placed at the same coords as they were saved. 2. Hosting ToolStripPanel's padding must be set to 0 before toolstrips' locations can be restored/saved. This mitigates dotnet/winforms#4449 Fixes gitextensions#8680 Reverts gitextensions#8719
Reintroduce ability to move toolstrips (as proposed in gitextensions#8572). This implementation is heavily influenced by the original implementation ToolStripSettingsManager in Windows Forms, however we only track visibility and location of each individual toolstrip. We're also only saving specified toolstrips as opposed to saving all known toolstrips (which in various situations results in terminal failures to restore toolstrips information). There are two key changes: 1. Restore toolstrip locations after the form's geometry has been restored. This ensures the toolstrips can be placed at the same coords as they were saved. 2. Hosting ToolStripPanel's padding must be set to 0 before toolstrips' locations can be restored/saved. This mitigates dotnet/winforms#4449 Fixes gitextensions#8680 Reverts gitextensions#8719
Due to discovered layout and placement instability of toolbars
reverting most of the functionality added in #8572.
Closes #8680
✒️ I contribute this code under The Developer Certificate of Origin.