Re: StyledLayoutBase - new "waitForSize" public property
External UI sets like Spectrum and MDL works ok, but I found when I did MDL library that we need to build our own set in Royale, since while things provided natively by MDL worked ok, many times I was without solutions for many typical use cases like we had in Flex, for that reason I started Jewel, to try to get best of both worlds. So Jewel tries to give solutions for typical Flex use cases with dataproviders, item renders, layouts, and more, and can left other less frequent use cases for external libraries (for example a scheduler?, or an echart?, or maybe a box diagram?)...but I think with time will be able to cover even those use cases too. El jue., 4 jun. 2020 a las 18:11, Harbs () escribió: > Yes. The most painful point we had when working with Royale was layouts. > > FWIW, in Spectrum, I am not using any layout beads at all (or hardly). The > layout is basically all handled by the Spectrum css. > > > On Jun 4, 2020, at 7:05 PM, Carlos Rovira > wrote: > > > > If you get a better way, that will be a great improvement so far, since I > > think Royale has still things to solve regarding layouts easeness > > for user consume. > > -- Carlos Rovira http://about.me/carlosrovira
Re: StyledLayoutBase - new "waitForSize" public property
Yes. The most painful point we had when working with Royale was layouts. FWIW, in Spectrum, I am not using any layout beads at all (or hardly). The layout is basically all handled by the Spectrum css. > On Jun 4, 2020, at 7:05 PM, Carlos Rovira wrote: > > If you get a better way, that will be a great improvement so far, since I > think Royale has still things to solve regarding layouts easeness > for user consume.
Re: StyledLayoutBase - new "waitForSize" public property
Hi Harbs please take a look when you have time. I didn't find any other way to deal with this issue. For now, if not doing that, you can layout right when using % measures. Maybe I'm missing something there If you get a better way, that will be a great improvement so far, since I think Royale has still things to solve regarding layouts easeness for user consume. For now, just let you know I just check for width/height, and if not get sizing just call requestAnimationFrame until the check is right. thanks El jue., 4 jun. 2020 a las 17:10, Harbs () escribió: > I wonder how this effects performance. > > I’d need to look at exactly the flow (which I don’t have time for now), > but one thing to keep in mind is that if reads and writes are not carefully > plan, it could cause forced layouts which is a performance killer. > > Not sure if this effects what you did or not, but definitely something to > keep in mind. > > HTH, > Harbs > > > On Jun 4, 2020, at 5:49 PM, Carlos Rovira > wrote: > > > > Hi, > > > > as part of the Jewel Tile Layout improvement, I want to let you know > about > > an important addition. > > > > until now I had very hard time dealing with width/height of a component > in > > layout classes when the width or height are a percentage > > or not set. > > > > Since that depends on other containers, I found while working on Jewel > > DataGrid that I need to make "requestAnimationFrame" calls > > until I get the proper measurements. > > > > So I set up a "waitForSize" public property that is available in all > Jewel > > layouts, since all comes from StyledLayoutBase. > > This is false by default, so you need to put to true to use this > feature. I > > didn't other way to get this measures, I think maybe this could have > > some performance hit, for that reason, I let users choose. If you know > > something better, let me know :) > > > > If you check that code you'll find that performanceLayout is now using > > "checkHostSize()" (if waitForSize is true).The code is this: > > > > /** > > * We call requestAnimationFrame until we get width and height > > */ > > COMPILE::JS > > protected function checkHostSize():void { > > if(sizeInitialized) return; > > if((host.width == 0 && !isNaN(host.percentWidth)) || > > (host.height == 0 && !isNaN(host.percentHeight))) > > { > > requestAnimationFrame(checkHostSize); > > } else > > { > > sizeInitialized = true; > > executeLayout(); > > } > > } > > > > when we get the size, we continue as usual. > > As I said before if you left "waitForSize" to false (default), it will > work > > as always. > > > > For example, new tile horizontal layout is using it in TDJ: > > > > > > > > > > > > > > Any comment are welcome > > > > Thanks > > > > -- > > Carlos Rovira > > http://about.me/carlosrovira > > -- Carlos Rovira http://about.me/carlosrovira
Re: StyledLayoutBase - new "waitForSize" public property
I wonder how this effects performance. I’d need to look at exactly the flow (which I don’t have time for now), but one thing to keep in mind is that if reads and writes are not carefully plan, it could cause forced layouts which is a performance killer. Not sure if this effects what you did or not, but definitely something to keep in mind. HTH, Harbs > On Jun 4, 2020, at 5:49 PM, Carlos Rovira wrote: > > Hi, > > as part of the Jewel Tile Layout improvement, I want to let you know about > an important addition. > > until now I had very hard time dealing with width/height of a component in > layout classes when the width or height are a percentage > or not set. > > Since that depends on other containers, I found while working on Jewel > DataGrid that I need to make "requestAnimationFrame" calls > until I get the proper measurements. > > So I set up a "waitForSize" public property that is available in all Jewel > layouts, since all comes from StyledLayoutBase. > This is false by default, so you need to put to true to use this feature. I > didn't other way to get this measures, I think maybe this could have > some performance hit, for that reason, I let users choose. If you know > something better, let me know :) > > If you check that code you'll find that performanceLayout is now using > "checkHostSize()" (if waitForSize is true).The code is this: > > /** > * We call requestAnimationFrame until we get width and height > */ > COMPILE::JS > protected function checkHostSize():void { > if(sizeInitialized) return; > if((host.width == 0 && !isNaN(host.percentWidth)) || > (host.height == 0 && !isNaN(host.percentHeight))) > { > requestAnimationFrame(checkHostSize); > } else > { > sizeInitialized = true; > executeLayout(); > } > } > > when we get the size, we continue as usual. > As I said before if you left "waitForSize" to false (default), it will work > as always. > > For example, new tile horizontal layout is using it in TDJ: > > > > > > > Any comment are welcome > > Thanks > > -- > Carlos Rovira > http://about.me/carlosrovira
StyledLayoutBase - new "waitForSize" public property
Hi, as part of the Jewel Tile Layout improvement, I want to let you know about an important addition. until now I had very hard time dealing with width/height of a component in layout classes when the width or height are a percentage or not set. Since that depends on other containers, I found while working on Jewel DataGrid that I need to make "requestAnimationFrame" calls until I get the proper measurements. So I set up a "waitForSize" public property that is available in all Jewel layouts, since all comes from StyledLayoutBase. This is false by default, so you need to put to true to use this feature. I didn't other way to get this measures, I think maybe this could have some performance hit, for that reason, I let users choose. If you know something better, let me know :) If you check that code you'll find that performanceLayout is now using "checkHostSize()" (if waitForSize is true).The code is this: /** * We call requestAnimationFrame until we get width and height */ COMPILE::JS protected function checkHostSize():void { if(sizeInitialized) return; if((host.width == 0 && !isNaN(host.percentWidth)) || (host.height == 0 && !isNaN(host.percentHeight))) { requestAnimationFrame(checkHostSize); } else { sizeInitialized = true; executeLayout(); } } when we get the size, we continue as usual. As I said before if you left "waitForSize" to false (default), it will work as always. For example, new tile horizontal layout is using it in TDJ: Any comment are welcome Thanks -- Carlos Rovira http://about.me/carlosrovira