-
Notifications
You must be signed in to change notification settings - Fork 1
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
ScrollPanelWidget not working properly #8
Comments
This might help you: In the Widgets that use layout not support children, (TextWidget's wantedSize is size of the text, any other Widgets' is (0,0).) In the Widgets that are use layout support children: style.box.size.width = Scalar.Auto // Uses wantedSize. (PanelWidget's wantedSize is usually (0,0). So you can expand as big as possible if specify Scalar.Auto.) The parent means given size. |
auto scroll = new VerticalScrollPanelWidget;
scroll.style.box.size.width = 100.pixel;
scroll.style.box.size.height = 100.pixel;
addChild( scroll );
auto panel1 = new PanelWidget;
panel1.setLayout!VerticalLineupLayout;
scroll.contents.addChild( panel1 );
foreach ( i; 0..10 ) {
auto panel2 = new PanelWidget;
panel2.setLayout!VerticalMonospacedSplitLayout;
panel1.addChild( panel2 );
auto panel3 = new PanelWidget;
panel3.setLayout!HorizontalLineupLayout;
panel3.style.box.size.height = Scalar.Auto;
panel2.addChild( panel3 );
auto text1 = new TextWidget;
text1.loadText( "hogehogehoge", fontface );
panel3.addChild( text1 );
auto text2 = new TextWidget;
text2.loadText( "fugafugafuga", fontface );
panel3.addChild( text2 );
auto text3 = new TextWidget;
text3.loadText( "piyopiyopiyo", fontface );
text3.style.box.size.height = Scalar.None;
panel2.addChild( text3 );
auto text4 = new TextWidget;
text4.loadText( "fuyofuyofuyo", fontface );
text4.style.box.size.height = Scalar.None;
panel2.addChild( text4 );
} It worked for me without problem. |
And what version are you using? My code worked at e962ca7. |
I have the full code on https://gitlab.com/WebFreak001/TTRLauncherLite but when I come home today I will try to make a reproducible test case |
https://gitlab.com/WebFreak001/TTRLauncherLite/blob/master/source/widget/root.d#L54 LineupLayout gives children a client size of the owner whenever. If A's height is 50%, and B's height is 100%:
|
oh yep that fixed it thanks. Maybe you could add some ddoc to the layouts so it's clear what they all do |
I have this layout:
the scrollbar doesn't go all the way down if the parent container is not big enough (children are clipped outside). After manually setting the
{x10}
PanelWidget height to 80px it works for more sizes, but it's still broken.Am I using the ScrollPanelWidget wrong?
The text was updated successfully, but these errors were encountered: