Center-align items in QML flow structure - qt

I want to align items in the following manner:
desired alignment
I want to have as many items as can fit in one row, and also I want them to be centered. I managed to do the former using Flow QML Type and got this result:
flow alignment
but it seems that it doesn't have an option to auto center items. Is there anything I missed in Flow documentation or can other type accomplish such alignment?

Related

Organize semi-tabular grid so that columns are all the same width based

I have an object with keys and values that I want to represent in a responsive way so that are always next to each other, but two k/v entries are stacked because of overflow on the horizontal direction, they will be aligned like a table.
Here is an example of what I am trying to accomplish:
This looks close to what I want, but does not account for the content size. max-content does not work
This also touches on it but recommends flex instead, but flex rows are all calculated independently so that rules that out.

Freeze/float cell while keeping other cell scrollable

I am creating a table where I need to freeze some cell while keeping the other cell scrollable. The table must be responsive to screen size that is why I need to make some cell scrollable.
Based on the picture above, I want to keep the blue area floating/or freeze while the red area scrollable.
How is this possible in google app maker?
First of all, this widget that you refer to as a table in your sample screen is actually a composite widget where it combines several basic widgets like the list, horizontal panel, and pager.
There is another table widget under charts, called Table chart, that can be used to present your data in rows and columns. But if you are looking for a property that can achieve this UI effect, then I'm afraid AppMaker does not support this yet.
If you are really keen to make this work, I would suggest that you combine two table widgets that inherit the same data source then wrap them SIDE-BY-SIDE in a horizontal panel. The left side will only contain columns that you want to freeze while the right size will have the rest of the column that can be scrollable.
Make sure to set the height of both tables to auto-grow based on the content (Fit to content). This will give the effect that the two tables are merged when doing vertical scrolling.
I have here a sample implementation as I described above. I gave a background to the main container to better understand the concept. I also added a small gap to show that I used two table widgets.
Here is the set-up in editor view (screen-shot)
See it in action here (video)

The usage of block grid and reason of its existence in Foundation5

I recently found Foundation5 has Block Grid which has rarely found use case online anywhere to demostrate the importance of using it... or is it even a great function to have? Because I am currently using Bootstrap3 and found it does not have Block Grid. So I wonder if its really a big feature one should watch out for.
Maybe some critical user case that will be so much better to use Block Grid other than Column based Grid.
Thanks!
There are several differences between the block grid and regular column grid..
The block grid is always evenly spaced and distributed
The block grid requires less markup
The block grid doesn't have inner padding
Take a look at this demo: http://codeply.com/go/XiyFxtMcXT, and you'll see the differences. Notice how the block-grid evenly wraps the items when the items exceed one row.
Block grids give you a way to evenly split contents of a list within the grid. If you wanted to create a row of five images or paragraphs that need to stay evenly spaced no matter the screen size, the block grid is for you.
You could just as easily use a percentage based grid system to achieve the same result.
I think the benefit of the 'block grid' is:
Items are displayed in a 'ul' which will group them together (good, for accessibility).
It's quicker to add one style to a 'ul' that will automatically make each 'li' a 'column' than it is to add "col-x" to each 'li' manually
They've already built it so you don't need to.

Image does not horizontally line up with the text above and below it with 960 grid

Any idea why my image does not horizontally line up with the text above and below it please?
http://dl.dropbox.com/u/2306276/site/index.html
You're using a different class for the image element than for the text elements you want on the right column. Set the image's class to grid_13 (same as the text) and add push_3, so it moves 3 columns to the right.
It'd be better to rearrange your elements into divs though; otherwise you'll have to give each element specific properties, and that beats the purpose of using a grid system.
In the 960 Grid system, every nested class has to have a "grid_x". You div's in between ("Status" etc) which don't use the grid system, I imagine these are throwing it off.
Try adding grid classes to these, using "alpha" and "omega" where appropriate.

Centering item renderers in a HorizontalList

I am trying to center itemRenderers in a horizontal list if the number of items in the list is less than the maximum visible number. Has anyone found a good way to do this?
See an illustration of what I mean if it is hard to picture.
Thanks!
Override the measure() method - I've writen a blog entry here: http://flexmonkey.blogspot.com/2010/05/centre-aligned-horizontallist-in-flex.html
simon
One solution that comes to mind would be to add invisible renderers to achieve the same centering.
You might want to consider using a horizontal box or "Hbox" instead of a horizontal list component. This will allow you to use the horizontal align property to set center. If not, simply extend the horizontal list component to accept a center align property, and copy it from the hbox to your new extended component.
Would paddingRight or paddingLeft accomplish what you're looking for? If you combine it with setting the columnWidth and the columnCount, that would allow you to adjust where the items first appear.

Resources