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

[Gtk] refactor layout system measuring #68

Open
lytico opened this issue Mar 25, 2024 · 0 comments
Open

[Gtk] refactor layout system measuring #68

lytico opened this issue Mar 25, 2024 · 0 comments

Comments

@lytico
Copy link
Collaborator

lytico commented Mar 25, 2024

issue to fix

the layout system doesn't work properly.

it fails eg. for LayoutView, Label, CollectionView's

possible solution

a suggestion to handle it:

implementation as in Gtk4

for each Widget that has it's own size handling, eg. LayoutView, implement a method like

https://docs.gtk.org/gtk4/vfunc.Widget.measure.html

and implement it using this rules:
https://docs.gtk.org/gtk4/class.Widget.html#height-for-width-geometry-management

then call measure in overrides for
OnGetPreferredHeight/OnGetPreferredWidth/OnGetPreferredWidthForHeight/OnGetPreferredHeightForWidth

decorate all that Widget with an interface IWidgetMeasurable

and call it in https://github.com/lytico/maui/blob/4e98afc5e53bdbc469b4e80edee2ac8fb0718386/src/Core/src/Platform/Gtk/WidgetExtensions.cs GetDesiredSize:

if(platformView is IWidgetMeasurable measurable){
        var size = measurable.Measure 
        ....
} else {
      // existing code
}
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

No branches or pull requests

1 participant