-
Notifications
You must be signed in to change notification settings - Fork 458
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
ENH: Friendlier segment editor widget for better intergration in layouts #1085
base: master
Are you sure you want to change the base?
ENH: Friendlier segment editor widget for better intergration in layouts #1085
Conversation
When we tried to do similar fixes in the past, there were always some bugs that came out when stress-testing that prevented applying that specific fix. So please try every option, in every effect, including the "Show details" button in the effect panels. Thanks! |
@che85 isn't this the problem you've been fighting with in SDT/SliceTracker? |
That's right, but after setting up my new development environment I didn't get to continue working on it. Definitely looks good to me! Qt can be such a pain when it comes to sizing widgets. |
So I tested this and it does appear to fix the empty space above and below the undo/redo buttons. However, when selecting an active effect, the options groupbox becomes visible and increases the size of the widget and upon switching back to "None" the widget maintains its size, but the table is the driving force and pushes the effect groupbox down the page farther. @che85 was trying to solve this in #942. This is most noticeable for an effect with a large options groupbox such as "Logical Operators". It is annoying when switching between effects for the effects groupbox to be moving up/down in the SegmentEditorWidget. I would suggest that the table be a fixed size so that the effects groupbox is always in the same position in the widget. This shouldn't be a problem because the table will show a vertical scroll bar once there are more contents than can be shown in the max size. |
8b40719
to
e812f09
Compare
Thanks everyone for the feedback ! I agree, layouts are finicky :) I amended my commit and I think that provides a satisfying user experience. The table widget is now properly resizable (up to a minimum of a 100 pixel. That particular value is arbitrary, feel free to change it ). The effect buttons resizes itself properly when switching to and from each effect without affecting the size of the table. |
I totally support that change for it to be resizeable instead of my suggested fixed size. The changes to keep the effect groupbox in the same location upon switching effects looks great! Good work! I'm also not sure why adjusting the bottom widget and then changing to none causes that jitter in the layout policy. I'll see if I can help out. This is pretty close to being complete. |
I have been messing around with this layout stuff for awhile without any success. When going to the "None" effect, the options groupbox and masking groupbox are hidden which results in the segments table in the expandable widget expanding instead of maintaining its currently expanded size and the widget downsizing. The flickering of the layout also exists in parts when simply collapsing/expanding the masking groupbox. So maybe worth trying to figure out that as a first step. |
Csaba and I have spent days with trying to improve the layout behavior. There have been many other "almost good" solutions, which were better in several aspects but had some unacceptable issues. I don't think there is a simple fix, just by manipulating existing widget options. I suspect that some of the CTK widgets that we use don't behave correctly and that throws off Qt's sizing strategy. We may fix the widgets, stop using certain widgets, or reorganize GUI layout to resolve this, but most likely this will require 1-2 weeks of work. |
Hi guys, Thanks for all the interest on this. I agree, with you @lassoan, I think that issues are coming from the CTK widget (particurarly the ctkExpadingWidget) and this is shaping up to be a much bigger change that I anticipated. Sorry for opening pandora's box :( If anything can be salvaged from this PR though, I think we could at least remove the spacer item from the widget and move it into the python widget (respectively from here and to here). I will let you decide what do with this PR, please feel free to close it, spin if off into an issue, cherry-pick part of it or whatever you think is appropriate. |
I am jumping into the conversation and i am probably missing some points but I was wondering if the ctkDynamicSpacer would be of any help.
|
This PR aims to simplify integration of the Segment Editor widget in other widget.
Here is an illustration of what it looks like with and without this PR.
The code used to generate this is here:
SegmentEditorUIFix.zip