Skip to content
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

Layout Rewrite #556

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft

Layout Rewrite #556

wants to merge 4 commits into from

Conversation

cwensley
Copy link
Member

This PR is the initial layout re-write to move layout logic into Eto.Forms instead of relying on each platform control to provide this functionality (which each have hacks to make them behave similarly).

Ideally we can get rid of the hacks, and just make sure each control supports a Measure() and Layout() pass, where the Measure() would determine its preferred size based on the container, and Layout() would position its child controls. This would greatly simplify the layout logic, make it easier to add other platforms, and also make it much easier to add additional layout options, such as a FlowLayout (which is included in this PR), etc.

Squashed commits:
[18e0d3a] asdf
[423f618] more work
[e9151c4] Initial new TableLayout
[44e390a] label 2
[bcbb3d8] label
[646af20] woodle
[89b6f9a] Custom layout changes
@harry-cpp
Copy link
Contributor

I know Gtk doesn't like to be told specific sizes and also trying so set specific pixel sizes will probably break with Gtk when the user switches theme, since each element has it's size info stored with the theme. You might want to consider using Gtk layout way as a base, it might be a lot easier.

@cwensley
Copy link
Member Author

@cra0zy, the idea is to ask the platform which size each control should be, so it should still adjust based on the theme. Each control should be able to return its 'desired size', which will be platform specific. I'll look at the Gtk layout as a base, which could probably hook into this mechanism.

@harry-cpp
Copy link
Contributor

harry-cpp commented Aug 22, 2016

Each control should be able to return its 'desired size', which will be platform specific.

If the user changes theme while the app is running, the starting 'desired size' will be wrong. Not sure if gtk has a theme changed event, but if it does, you will need to reset sizes when it occurs.

@cwensley
Copy link
Member Author

This should fix #462 when implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants