Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

Singleton layout that positions its children #340

Open
jasongrout opened this issue May 20, 2018 · 4 comments
Open

Singleton layout that positions its children #340

jasongrout opened this issue May 20, 2018 · 4 comments

Comments

@jasongrout
Copy link
Member

Currently the SingletonLayout provides a nice simplification of PanelLayout (i.e., a single CSS-positioned child). It would be great if we had a similar singleton layout that simplified BoxLayout (i.e., that explicitly positioned its single child, so size information propagated up and down through the layout).

For now, I'll use a Layout attribute which internally I know is a BoxLayout with one child.

@jasongrout jasongrout changed the title Singleton layout Singleton layout that positions its children May 20, 2018
jasongrout added a commit to jasongrout/jupyterlab that referenced this issue May 20, 2018
The BoxLayout positions its children, so size information propagates up and down. See phosphorjs/phosphor#340 for more details.

In particular, I was seeing issues with using SingletonLayout in the editor, where the codemirror editor was not understanding it was inside a small window and needed to have scrollbars.
@sccolbert
Copy link
Member

Can you use a StackedLayout with one child?

@jasongrout
Copy link
Member Author

Thanks. That's enough better than BoxLayout (e.g., I don't have to set stretch factors, etc.) that it works well for my usecase: jupyterlab/jupyterlab@4efcad2

@sccolbert
Copy link
Member

sccolbert commented May 22, 2018

Glad that worked for your case. I'm going to re-open this though. I think it would be nice to have an "absolute mode" or something for SingletonLayout.

@sccolbert sccolbert reopened this May 22, 2018
@jasongrout
Copy link
Member Author

Thanks, that's great too. That would convey more clearly my intent instead of using a stacked layout with one child.

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

No branches or pull requests

2 participants