WinJS ListView flexible item height via GroupInfo appending gray boxes - windows-8

I am showing a ListView control with items of varying height. The items' height varies depending on a header text element. I read about the GridLayout's groupInfo property, which works like a charm in terms of sizing up the items. I set the height of the cell to be rather small so that my items can be fit into the closest cell span.
Long story short, I needed to add always have a particular item at the end of the list. I do this by manually popping the item, inserting new data, adding the item to the back of the list. This works. My rendering function recognizes the item and renders the item itself correctly (it has different css classes from the rest of the items), but it always adds these gray boxes in the next column. The size of these boxes corresponds to the size of the groupInfo cellwidth/cellheight.
Why would this be showing up?

So just as I typed this up I figured out a way to get rid of these. Still don't understand why they would show up. I looked at the css I was using for the item I was appending at the end. I was setting a padding on it. When I removed the padding, the gray boxes no longer showed up.
I changed the rendered html from:
<div class='item extraclasswithpadding'>
Content
</div>
to:
<div class='item'>
<div class='extraclasswithpadding'>
Content
</div>
</div>
and everything is looking great now. Not exactly an answer to the ListView would do this, but certainly a solid workaround.

Related

TornadoFX: Layout of listview shifts if content is modified

I have a ListView inside of a TornadoFX form builder field that can be added to and removed from by some buttons off to the side. However whenever the contents of the list is modified from the buttons, the list moves vertically downwards. The height of the ListView remains the same, but it's almost as if there is padding being generated along the top whenever the content length is modified. The height change is then reset as soon as there is some change in focus, either by clicking on another component in the view, or by unfocussing and refocussing the window.
I've tried to limit the ability for this to happen by enforcing a max height, both on the form field and on the ListView itself, but neither worked.
Using listeners to print out all the values I could think of that would result in this change, I found that the "bounds in Parent" were changing, adding a value of 17 to both the minY and maxY values. I've not been able to determine where this value of 17 comes from.
The current code for the view is here: https://pastebin.com/6qFVvxvP
I also have some images to help visualize what the problem is:
Before removing content:
After removing content:

Bootstrap navbar right side falls under the left

Please look at the official navbar example:
https://getbootstrap.com/examples/navbar/
If you try to resize your browser you see this:
Today I found the same problem on my website.
How to easily fix this behavior?
This menu has not enough space in one row. The right side part just does not fit in the same line. You can:
reduce the number of menu items
(for example, hide one of them by adding the hidden-sm class)
make names of items shorter
hide a word from the name:
<li>Something else<span class="hidden-sm"> here</span></li>
reduce the distance between menu items
reduce the width of the logo for this screen width
expand the container or use container-fluid instead

Changing Template10 Header Height

I have a Template10 UWP application that I am developing, and for the most part everything is coming together nicely. However, I am a little stumped about the behavior of the PageHeader control when an AppBarButton has a Label set.
As you can see in the shot below, the header does not show the Label under the displayed Icon.
But when I click on the ... to expand the SecondaryCommands, the height adjusts to accomodate the Label and the dropdown menu is displayed properly. Is there a way to set this as the default behavior of the PageHeader and have the back arrow and title be vertically centered? It looks a little odd once the header expands and the title is still top aligned.
EDIT
I would like to note, that simply changing the VerticalAlignment of the PageHeader does not change this behavior at all. The result still looks the same. I thought perhaps if I changed the alignment then I would just have to manually set the Height. Also, even manually setting the Height doesn't change anything either, the Background stays the same height and the text doesn't move either.
EDIT 2
Sorry for the poor scaling, but here is what it looks like animated, for the most part:
I am hoping to vertically align the back arrow, Invoice Details, the AppBarSeparator, and the ellipses. The AppBarSeparator is easy, I just added VerticalAlignment="Center" and it adjusts. What I'm looking for is the expanded version of the header, with the mentioned items centered, that doesn't change height when clicking the ellipses.
I've looked through the source code for Template 10, and the closest thing I can find is the IsOpen property on PageHeader but if I set that to True then the header just looks like the second picture with the menu expanded. I am just looking for something to make the header look expanded, but without the menu (and stay expanded when menu appears, etc.)

Bootstrap 3 navbar jumping onto two lines rather than collapsing?

Think I'm missing the obvious here, but I have a Bookstrap 3 navbar that works great in desktop view but as I squeeze the width and it gets to tablet size rather than collapsing into the toggle menu it's jumping the menu onto two lines:
http://www.doorsets.org.uk/
I've tried reducing the text size in the navbar via a media query but that isn't solving it.
What am I missing?
Appreciate it. Thank you.
NJ
One solution might be to change the point at which the navbar collapses, you can do this by creating a customized Bootstrap and setting the #grid-float-breakpoint to a larger number.
This variable unfortunately also influences the dt and dd inside a .dl-horizontal which might be a problem.
If you want to use a media query to reduce the font-size you can use the .navbar-default .navbar-nav > li > a selector. It however needs to become 9px at the smallest viewport size to still stay on a single row which is quite unreadable.
From the Bootstrap documentation:
Overflowing content
Since Bootstrap doesn't know how much space the content in your navbar needs, you might run into issues with content wrapping into a second row. To resolve this, you can:
Reduce the amount or width of navbar items.
Hide certain navbar items at certain screen sizes using responsive utility classes.
Change the point at which your navbar switches between collapsed and horizontal mode. Customize the #grid-float-breakpoint variable or add your own media query.
It goes on to say:
Changing the collapsed mobile navbar breakpoint
The navbar collapses into its vertical mobile view when the viewport is narrower than #grid-float-breakpoint, and expands into its horizontal non-mobile view when the viewport is at least #grid-float-breakpoint in width. Adjust this variable in the Less source to control when the navbar collapses/expands. The default value is 768px (the smallest "small" or "tablet" screen).

Relative maximum width in XUL

I'm working on a Firefox extension, and am having problems getting relative constraints on the width of elements in the sidebar. For example, I want a description element in the sidebar that will always be as big as the sidebar when the sidebar is resized, and has text wrapping accordingly.
If I put a description in a box with a fixed maximum width, it will wrap correctly, but I can't get relative widths to work correctly using css. If is set the max-width to be 100% in css, it seems to just ignore it and the text will be on a single line and will overflow the sidebar. Any suggestions on how to put relative width constraints on a box in XUL so that text will wrap correctly?
It sounds like setting maximum width isn't what you really want. Have a look at https://developer.mozilla.org/en/XUL_Tutorial/The_Box_Model, setting flex attribute would be the right approach to make an element fill all the available space (typically flex="1"). The corresponding CSS property would be -moz-box-flex: 1.