Hi Alex, El jue., 10 ene. 2019 a las 19:22, Alex Harui (<aha...@adobe.com.invalid>) escribió
> > I know Flex users are used to having these properties, and the emulation > components have them for backward compatibility (plus emulation isn't > focused on code-size) but I was thinking that in almost all other cases, > properties like min-width/max-width are going to be passed straight to CSS > since in most other Royale layouts we are trying to let the browser's CSS > do the layout. And if that's true, then I wonder if non-Flex users won't > expect these properties on the component and will expect to set them in > CSS. Some concrete components that has concrete sizing rules could have min-width, mx-widht (in fact, that happens currently in some Jewel components). But many other times, I find I need to configure per component. This means a property, in UIBase or to create a Bead that setup that. > UIBase supports the same inline style syntax as HTML does or you can > specify those styles in <fx:Style> or .css files. good point, but that's finally a definition of a class selector, and I can put it in the .css file as well. In fact, I use to keep .css organized per component. But for an instance of a component that could be certainly cumbersome for the developer. If I could add <fx:Style> tag to an instance of a component in a MXML (I mean not for the root tag, but for any of the subcomponents), that could be a solution, but if not this technique implies create a component exclusively for customization, what doesn't means very appropriate. > So if these values get passed to CSS, you can specify those values in an > MXML file without changing UIBase and it might be a more expected/familiar > way for non-Flex users. Or are you working with a layout that doesn't pass > these values to CSS? > Right, some times you don't have to pass this kind of values to CSS, you just want to limit the sizing of the component in one way or another. As I say I can do it vía CSS, but this doesn't seem to me very "Royale" style, or even platform agnostic > > I'm not sure what you mean by the width = NaN issue. I mean that setting width or height to NaN value, does not make that width or height change. IOW, for css NaN is like to do "style.width=initial", and we 're not doing that. What do you thing to complete UIBase.width and .height to deal with a NaN value? i.e: public function setWidth(value:Number, noEvent:Boolean = false):void { if (_width !== value) { _width = value; COMPILE::JS { this.positioner.style.width = isNaN(_width) ? "initial" : value.toString() + 'px'; } if (!noEvent) dispatchEvent(new Event("widthChanged")); } } > The width getter makes some attempt to compute a size, but others say that > if that computation is running then you might be asking for width too > soon/often since that computation might force the browser to run its layout. > mmm, I think I don't understand exactly what you refer in your latest sentence. As well the code I posted is done in the setWidth, but maybe could be in the getter... Thanks -- Carlos Rovira http://about.me/carlosrovira