[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: RFR: JDK-8305248: TableView not rendered correctly after column is made visible if fixed cell si
From:       Marius Hanl <mhanl () openjdk ! org>
Date:       2023-03-31 11:16:31
Message-ID: prphRvhnj7ZHd0FF3JLTpixytTHdef8b147zbNwdwT0=.a76f782c-e8d0-4ba8-92d7-8f9862f5d6c3 () github ! com
[Download RAW message or body]

On Fri, 31 Mar 2023 08:40:15 GMT, Jose Pereda <jpereda@openjdk.org> wrote:

> > The determined `prefWidth` of a `TableCell` could be `0.0` when a `fixedCellSize` \
> > is set. This happened because the `TableCell` may not have a skin since it was \
> > never added to the scene graph yet. 
> > The fix is to make sure we get the `prefWidth` after the `TableCell` was added to \
> > the scene graph. That is also the reason why the problem only happened the first \
> > time and never again after (skin is then already created).
> 
> modules/javafx.controls/src/main/java/javafx/scene/control/skin/TableRowSkinBase.java \
> line 358: 
> > 356:                 // Note: We have to determine the pref width here because \
> >                 the add operation above may trigger the skin
> > 357:                 // creation first, which is what makes it possible to get a \
> >                 correct value here in the first place.
> > 358:                 width = tableCell.prefWidth(height);
> 
> Alternatively, you could have just kept the first call to `tableCell::prefWidth` as \
> it was, and add a second one only inside the above if expression, right after the \
> tableCell is added to the tableRow.  I take that, only for such case, there would \
> be two calls instead of one, but it seems to be somehow a cleaner patch and \
> explanation

True and I also thought about it, but I'm still in favor of calling it only as much \
as needed

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1077#discussion_r1154348166


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic