-
Notifications
You must be signed in to change notification settings - Fork 256
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
Fluid support for Fl_Flex #523
Conversation
@MatthiasWM I would like to work further on Fl_Flex and if you don't mind pick your fixes and push them in my next commit. You would have to rebase and merge your own branch then. Would it be OK for you if I committed your fixes? OTOH, how far is your fluid support? I won't be able to test much today, I'll try to find some time tomorrow. Would you be ready to merge the fluid support part soon (together with your fixes)? |
@MatthiasWM FYI: I added two comments to the Fl_Flex diffs. I didn't review the fluid part in any way - and I'm not sure if I will understand the code but I'll try to test it to get a feeling how it works. Thank you very much for adding fluid support of Fl_Flex which covers something I would likely not have been able to do without investing much more time. |
@MatthiasWM Another question: you moved the resize statement
(and added the comment) to an if clause where it is only executed " Maybe these two issues are related? |
Hi @MatthiasWM, I took the freedom to fix the formatting issue in src/Fl_Flex.cxx (see one of my comments) and pushed it to your branch. |
@MatthiasWM I also tested the new fluid from your branch and created a working demo layout with one horizontal and one vertical Fl_Flex widget, a few buttons, and a working Everything went smoothly except handling of fixed and non-fixed widgets. The tooltip of the "Flex Parent" size field says " For the record: here is the example fluid file I created: flex1.fl. |
Note that I also noticed some new compiler warnings when building fluid:
These should be fixed and then I believe that this PR can be merged. Thank you very much for fluid support of |
The Fluid part uses a lot of trickery because, well, Fluid is just not very clean to begin with. I have done several attempts to clean things up. The funny thing is, the more I clean it up, the more it seems to grow (in number of files), but it's actually just the unravelling of the very densely packed source files. For the time being, Fluid works. I will every once in a while go back into it and clean up a bit here and there. As for the resize statement: I moved the resize() to the end of set_size(), because set_size(w, 0) is the only way to remove a widget from the lookup array, but if the widget is already deleted, resize() will crash (this can happen when FLTK eagerly delete all children of a widget while deleting the group widget, but I forgot the details). resize() does not serve much of a purpose in this general format here anyway. I will change that, so it also satisfies PR #518:
|
As for Fluid and the size / check button combo: I did change my original code and forgot to update the tooltips. The size always shows the current size of the widget, and the check box indicates if it is fixed. I don't like the association that 0 means not fixed. Also, if you drag the edge of one of the children of Fl_Flex, the size entry in Fluid changes with it, and the widget is marked as "fixed". |
As for the unused variables, I removed them. I guess I should also update the warnings flags for Xcode in CMake. |
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.
Good to go, IMHO.
Please rebase (if necessary) and squash to merge. Thanks.
PS: tried to make a formally correct review, still learning "GitHub".
Thanks for fixing the remaining issues. Please select "Squash and merge" to merge. |
This PR adds Fl_Flex support for Fluid (90% done). There are two bugs fixes for
Fl_Flex::set_size(Fl_Widget*, int)
that should be applied to master in any case.Features:
Fl_Flex has a new line of parameters for setting the gap and margins:
Children of Fl_Flex will be positioned or sized by Fl_Flex, so the size line is replace by a single Flex Size field. Enter a valid integer, and the Widget will be fixed in that height or width (vertical or horizontal Flex). Enter zero, and Fl_Flex will automatically resize the widget:
Fixes: