Reducing the width of the HBox shrinks the first element below the allowable - extjs

I have an HBox which contains 4 items, like this:
Normal display of the component
The green element in the hbox has flex = 1
Other elements have flex = 0 and the dimensions are fixed to width
After reducing the width of the parent block or zooming in the browser, the green element shrinks to invalid values.
green element shrinked
It is necessary, when reducing the length of the green block to an unacceptable one, to add a horizontal scroll on vbox or transfer elements (yellow, blue, red) to the next line.
For a solution I tried:
1)
on green:
flexShrink = 0
on vbox:
autoScroll = true
The green element overlaps the rest when reduced
2)
on hbox:
flexWrap = 'wrap'
Nothing changed
3)
I tried manually in the resize handler of the parent block, when an invalid width of the green block is reached, turn off flex and calculate the width of the green element, relative to the parent block and adjacent elements. Everything is broken ;)

Related

In Solr Dashboard how to auto increase the height of tagcloud panel when the height of terms panel increases due to legend addition?

I have two panels "The term panel as a bar chart" and "The tagcloud panel" in a single row inside banana dashboard.If a "legend" is added to the top or the bottom of the bar chart the height of the entire row increases to the height of the terms panel. But the height of the tagcloud panel remains to its same size.
I want the height of the tagcloud panel also to auto increase to the height of the row.
Inside the method $scope.close_edit of the panels/terms I added $scope.$broadcast('render'); but that doesn't help me to resize the neighbouring panel to the increased row height after adding the legend to the terms panel.
Any help on how to fix this issue would be great, thanks!

Angular svg icon size

I'm making an angular js application and I'm using the icons found https://materialdesignicons.com/
I'm having trouble creating large icons in my project. I'm currently assigning the icons like so.
app.config(function($mdIconProvider) {
$mdIconProvider
.defaultIconSet('assets/icon/materialdesignicons.svg')
.iconSet(['large'], 'assets/icon/materialdesignicons.svg');
});
I know the default size is 24px, but if I put in a number like 48, the image shrinks instead of gets larger.
What should I put in instead of large?
If your icon svg element has a viewBox attribute, it won't be overwritten by the $mdIconProvider size attribute.
The size parameter defines the viewBox height and width. viewBox only affects the coordinate system of an SVG element. It should match the dimension of your icon; if they don't match, md-icon might show a zoomed in/out view of the icon.
However, the actual size of a md-icon element will be defined by its height and width (defined with css); the SVG element will scale up and down inside the md-icon.
viewBox is a requirement for a svg element to scale. It sets which portion of its grid to show and how the element in the svg element should scale with it. it just doesn't decide the actual size of the icon which grow with md-iconelement size.
If viewBox is not set, the svg elements will not scale (that's the
jQuery bug); one unite will be 1px regardless of the svg element
size.
If you set the size to something smaller than the svg grid (e.g. "0 0
12 12" for a 24x24 grid), you will zoom onto the top left corner of
the icon.
If you set the size to something bigger than the grid (e.g. "0 0 48
48" for a 24 x 24 grid), you will zoom out with the the icon placed
in the top left corner of the svg element.
You can find lot more details here.
I managed to figure out the problem. The icon was being used as a button, but I had the class md-icon-button for the button in addition to the icon. Removing the class from the button fixed the issue.

How to maintain scroll position on window resize while using scrollmagic

I have a fixed container of 100vh x 100vw that contains 6 absolutely positioned divs that are 100vh x 100vw.
I use a dummy element that is positioned relative w/ 6 divs that are 100vh to trigger each scene.
When I resize the window, the scene's animation moves forward and backward in time. Is there a way to prevent that from happening?
The issue is that when you resize the window, the position of the scroll bar remains fixed at an absolute number of pixels. However, because your content is based on view height, the height of the document changes dynamically as you resize the window. Thus, the window scroll position as a percentage of the document body height is also changing, and this is what ScrollMagic bases progress on.
To illustrate with simplified math:
A) Given a window height of 1000px, your document height will be 6vh * 1000px = 6000px tall. If your window scroll position is 1200px, you'll be 20% of the way through the overall ScrollMagic timeline.
B) If you resize the browser to 800px tall, that changes the document height to 6hv * 800px = 4800px tall. However the window scroll position will remain at 1200px, which is now 25% of the way through the ScrollMagic timeline.
The simplest solution is probably to keep your document a fixed height.

Canvas layout and widget lingering with maxWidth/maxHeight

In this example, the green block has equal top and bottom layout properties. When the browser window gets resized, the block lingers to the top; that means, top offset remains constant, while bottom offset varies according to maxHeight widget property. (The block would also linger to the left should left layout property and maxWidth widget property be set.)
How do I reverse the behavior, so that the widget lingers to the bottom/right corner?
Add a composite as the root widget, give it a grid layout
add the widget you want to position fixed to the lower left corner of the screen to the composite, with row 1 and column 1
set the flex of row 0 and column 0 to 1
set a fixed height/width for rows 1 and 2 and columns 1 and 2
Width of column 1 and height of row 1 should be the dimensions you want for your widget.
Alternatively, you can play with row/column min/max height/width - see the grid layout API for all possibilities.
Yet another alternative is to use a canvas layout, where widgets stay where you put them, and their position or size is never recalculated automatically, and add a listener to the resize event of the container, in which you manually recompute everything. However, I never found a situation in which qooxdoo's containers and layouts didn't allow me to avoid this.
The demo you link to is a demo for what its name says - minimum and maximum sizes of widgets, not positioning. Controlling positioning in qooxdoo happens via layouts. (To some extent, layouts can also be used to specify rules for sizing, though.)

WPF Grid Row Height Auto

This seems close to some other questions I've seen out here, but not close enough...
I have a grid with three rows. The first row holds a custom grid that I want to have as much space as possible. I set its Height to "*". The second row is a row of buttons; it is "Auto". The third row is a user control that contains another custom grid that has an unpredictable number of rows (none at design-time, filled in at run-time).
If I set the third row to "Auto", it doesn't get any space at all. I need to understand what I have to do after I load the third-row's grid to make it then figure out what "Auto" should be. Or, if "Auto" doesn't apply, how else do I get the third row to take up Just Enough space?
Does my custom grid have to fire something like a resized event after it is loaded?
You shouldn't have to do anything
If the 3rd row's Height is Auto, it will resize according to the size of it's contents. If the size of the contents change at runtime, so will the size of the Row.
You can also set limitations on the Row's Height by setting MinHeight and MaxHeight on the 3rd Row so it doesn't get smaller or larger than a specified height.
Cells will collapse to fit their contents. If the contents don't have any specified size then the cell will collapse to nothing. I'm guessing for your middle row the buttons have fixed sizes, so the row collapses to the size of the buttons, but your third row has nothing with a fixed size so it collapses to nothing. Try giving your third row a fixed size either for the whole row or for each row in the contained grid.

Resources