I have obtained satisfactory results by adding observeElementSize to 
hostComponent.element (for Windows).

This could be an initial version:
https://github.com/mjesteve/royale-asjs/commit/ce3fc686073b44b75b25d4ef13ed4332e3a364e0

What do you think?

Hiedra

-----Mensaje original-----
De: Maria Jose Esteve <mjest...@iest.com> 
Enviado el: sábado, 30 de abril de 2022 12:01
Para: dev@royale.apache.org; cont...@cristallium.com
Asunto: RE: TileHorizontalLayout compute wrong margin-right in case of scroller 
(ignoring scrollbar width) (Issue #1193)

Yes, it will be necessary to put some "Observer". It occurs to me to look at 
the existing solution in Grid/GridCell.
Hiedra

-----Mensaje original-----
De: cont...@cristallium.com <cont...@cristallium.com> Enviado el: sábado, 30 de 
abril de 2022 10:42
Para: dev@royale.apache.org
Asunto: RE: TileHorizontalLayout compute wrong margin-right in case of scroller 
(ignoring scrollbar width) (Issue #1193)

Hi,

Sorry, I misunderstood your previous message. I belived that 
hostComponent.element.scrollWidth doesn't work properly on Mac.

If that's working properly then this piece of code will solve the issue
:

                 var adjustedHostWidth:Number = Math.floor(host.width - 
borderMetrics.left - borderMetrics.right);
                 if (hostComponent.containsClass("scroll") ==  true){
                     //Reserve some room for VScrollbar
                     adjustedHostWidth -= hostComponent.element.scrollWidth ;
                 }

But this need another fix to be totaly fonctional : layout() must be called 
again to update margin-right value if browser is redimensioned

What's your opinion ?

Fred



On 2022/04/29 08:39:23 Maria Jose Esteve wrote:

> Hi, I would like to get your opinion about the Cristallium PR:

> For THL to correctly calculate the internal width of the container you 
> need to know if the vertical scroll bar is visible and if so deduct 
> its width.

> 

> It seems that obtaining this value, the scroll width, depends on the
> environment:

> - Satisfactory tests have been obtained on Windows, with 
> hostComponent.element.scrollWidth.

> - On Mac, the scroll has a different behavior but it seems that the 
> tests are also satisfactory.

> 

> Several questions:

> With your experience, would using hostComponent.element.scrollWidth be 
> reliable enough?

> And for those of you who work with Mac, any particularities to 
> consider?

> 

> As a temporary solution, Cristallium proposes to create a property 
> "vscrollBarWidthReserve" where we would indicate, in each case, the 
> width we know the scroll will have, but I think we should focus on 
> getting the correct scroll width... What is your opinion?

> 

> Thx.

> 

> Hiedra

> 

> De: Cristallium <no...@github.com>

> Enviado el: jueves, 28 de abril de 2022 20:39

> Para: apache/royale-asjs <ro...@noreply.github.com>

> CC: Maria Jose Esteve <mj...@iest.com>; Mention 
> <me...@noreply.github.com>

> Asunto: Re: [apache/royale-asjs] TileHorizontalLayout compute wrong 
> margin-right in case of scroller (ignoring scrollbar width) (Issue
> #1193)

> 

> 

> Hi Maria,

> 

> I share the same thought from you : if there was a way to get, 
> truthfully or acceptably, the width of the scroll it would be better.
> When you said "mac" are you talking of "safari" web browser ? If yes I 
> search a little on Internet, but found nothing interessing to get 
> safari scrollbar width.

> Do you think other Apache Royale team would have an advice on it ?

> Actually I didn't see any solution except adding a new property ( or 
> bead but my level isn't hight enought to know what's better).

> Can we for now add property (or bead) and when all browsers will 
> propose to have a real way to get scroll width we could remove this 
> property ?

> 

> -

> Reply to this email directly, view it on
> GitHub<https://github.com/apache/royale-asjs/issues/1193#issuecomment-
> 1112538265>,
> or
> unsubscribe<https://github.com/notifications/unsubscribe-auth/ANJL3U3L6S2CLOZXSI4BFEDVHLLLLANCNFSM5TQLH3BA>.

> You are receiving this because you were mentioned.Message ID: 
> <ap...@github.com>

> 

Reply via email to