Make Container Collapse (Fit Content) - flutter-layout

I want to make something similar to a modal window, centered vertically and horizontally in the center of the screen. When I put Row or Column in a Container, it wants to expand to fit the screen. I want it to do the opposite. Like have the Container "shrinkwrap" to fit the content of the Column or Row. Is there an attribute I can add to the Container? Or another Widget I can use, that won't blow up, but rather shrink down?
FWIW I come from the HTML/CSS world, and I think this is causing me issues in how I visualize things...

Related

Creating a custom layout for horizontal buttons with wrapping

I wasn't sure what to title this without explaining it all there. Essentially, I want to populate part of a screen with a bunch of buttons. The buttons should have text from an ArrayList (or other structure) and they should be aligned horizontally to each other from the left to the right of the screen. When there is no more room to the right, it starts a new row. I've attached an example. Example layout here
I know how to make custom list adapters for my objects and how to make listeners for parts within the list items, but I'm just not sure how to make the "list" of buttons go horizontally with wrapping to the next line.
It seems https://github.com/google/flexbox-layout might help you.
You can use FlexboxLayoutManager as adapter, or simply place all the buttons inside FlexboxLayout, they will wrap automatically depending on their width.

Style Grid border in case Grid height is calculated

I have a case which want to get vaadin-grid the maximum height possible in screen.
So, this is easy.
the problem is that despite the vaadin-grid size is ok, the tbody might be shorter than vaadin-grid.
So, whenever there is not enough rows we get empty space.
it would be ok in case had no border. But, because we do use border on the grid, empty space comes up.
Sure can shift the border to thead and tbody and get it looks good, but than the opposite happen cause bottom border will get lost when tbody in longer than vaadin-grid.
Is there a clean way, non dirty js, to distinguish cases? something else?
Thanks
I think you should be able to get at least very close by using the :host([overflow~="bottom"]) state attribute selector. Add/remove the borders based on that. The overflow attribute value changes based on if rows are overflowing the from the bottom of the grid viewport.
The only issue I see is that the border will disappear when the user scrolls to the bottom of the grid.

How to make a vaadin combobox overlay wider than container element?

I have a vaadin-combobox inside a slim grid cell/column, when I open the combobox the contents is restricted horizontally to the space in the cell and I can't see the values. Vertically it overlaps correctly. I have been searching for some CSS to make the overlay of values wider like you do with a normal HTML picklist but I couldn't find it.
Thanks for any pointers.

TableWrapData: widgets won't left align properly

My program uses TableWrapLayout with numColumns set to 2. I then have the following code: (background colors are set to show you that the widgets aren't using the blank space).
Label label = toolkit.createLabel(container, "Resource Type":);
label.setLayoutData(new TableWrapData(TableWrapData.LEFT,TableWrapData.MIDDLE));
label.setBackground(DiagramSettings.NODE_BACKGROUND_COLOR);
resourceComboMenu = new Combo(container, SWT.READ_ONLY);
resourceComboMenu.setBackground(DiagramSettings.NODE_BACKGROUND_COLOR);
resourceComboMenu.setLayoutData(new TableWrapData(TableWrapData.LEFT,TableWrapData.MIDDLE));
However as you can see in the picture the combo box refuses to left align properly. But that I mean I want it to start right after the label, not have a bunch of blank space.
One workaround would be to put the row inside it's own Composite just like I do Resource Icon and Geolocation. But I feel like I shouldn't need to since the widgets on this row equals the number of columns set by the layout. I've created this workaround for now but would like to understand this TableWrapData behavior for the future.
Any insight would be helpful, thanks.
I pretty much answered my question in the question. The composite that contains everything in the picture had TableWrapData with columns set to 2. TableWrapData essentially draws a straight, vertical line between each column then makes sure widgets from one column don't cross it.
So to fix this (like I mentioned in my question) you simply make another composite with nested widgets (which in the case would be the resource type label and resourceComboMenu). I just didn't realize that is what you're supposed to do.

CSS: variable width side panels with fixed centre

I require the following layout, with three columns, left, content & right.
The left and right content simply will have an image within them, and the left col. Image needs to stay to the left of the browser, and the right col. Image to the right side of the browser, so when the browser width is resized both the columns stay to their edge.
Where as the content/centre column needs to be a fixed with of 960px and also remain in the middle of the screen.
So on resize the browser width the content stays in the middle, but then when the browser is width is reduced both left and right columns do not go over the main content but stay either side.
I have tried multiple times but am having much success at present, any help would be appreciated.
thanks si
UPDATE:
As requested I have added a jsfiddle of what I have tried:
http://jsfiddle.net/UcmBj/
I get to 99% of what I want but the content remains centred and the right stays to the right but ideally I would like it so the content and the panels remain centered.
At the moment if scaled down the left column and part of the content is viewable but I would like the content to be viewed in the window/centred so the left column is displaced to the left off the screen. thanks hope the link helps.
Bit of details: side columns should be min width of 280 and the content section width of 960 set, thus the outer container min 1520.
Does this help you at all?
http://www.manisheriar.com/holygrail/index.htm
http://jsfiddle.net/andresilich/6vPqA/3/show/
Well having looked around, looks as if Its not possible just yet for how I wanted to do it, so what I did was have my left and right columns positioned using css to the left and right, then using css media queries added a negative margin to each so that they would move so not interrupting the main content.

Resources