On Mon, 29 Aug 2022 22:29:22 GMT, Andy Goryachev <ango...@openjdk.org> wrote:
>> The corner region is currently laid out with this assumption: >> >> // position the top-right rectangle (which sits above the scrollbar) >> >> However, the vertical scrollbar is not always visible. Therefore, when that >> is the case, the corner region is laid out on top of the table column >> headers, overlapping any of their graphic or text content. In case of the >> last visible column header, it is not always possible to scroll horizontally >> to see the full content, either because of a constrained resize policy or >> because there is no more space left after the last column. >> >> This PR fixes this issue by considering as padding for the last visible >> column header the presence of the corner region over it, only when the >> vertical scrollbar is not visible and the corner region is. >> >> A couple of tests have been added to both TableViewTest and >> TreeTableViewTest. >> >> Test 1: Before and after the changes : >> >> <img width="312" alt="image" >> src="https://user-images.githubusercontent.com/2043230/187190928-efc29e38-8de2-4daf-8eff-a218d6fae181.png"> >> <img width="312" alt="image" >> src="https://user-images.githubusercontent.com/2043230/187190991-deaa88b3-2f52-48bc-b3ec-107a5151f7b5.png"> >> >> Test 2: Before (sort arrow is there, but not visible) and after the changes: >> <img width="412" alt="image" >> src="https://user-images.githubusercontent.com/2043230/187191310-fb348d8c-84fc-4254-a1a5-91811bf09b79.png"> >> <img width="412" alt="image" >> src="https://user-images.githubusercontent.com/2043230/187191358-0d4937cb-b3b4-4530-9489-ff8cbf0c8443.png"> > > modules/javafx.controls/src/main/java/javafx/scene/control/skin/TableColumnHeader.java > line 381: > >> 379: } >> 380: >> 381: double cornerRegionPadding = tableHeaderRow == null ? 0d : >> tableHeaderRow.cornerPadding.get(); > > minor: could we use consistent 0 or 0.0 or 0d? > (I'd suggest 0.0 to avoid int->double conversion, or 0d as very few people > use 0d) Indeed it is not consistent at all throughout all the source code... > or 0d as very few people use 0d do you mean `or 0 as very few people use 0d` or `or 0d as very few people use 0`? Checking Controls source code, doubles use `0` or `0d` or `0.0d` as well as 0.0, so it will be hard to be consistent without making too many changes... For instance, next line is `double sortWidth = 0;`. If I go to 0.0, should I change it as well? ------------- PR: https://git.openjdk.org/jfx/pull/886