FAForever / downlords-faf-client

Official client for Forged Alliance Forever
https://faforever.com
MIT License
194 stars 117 forks source link

basic UI scaling fix: 1.25x, 1.5x, 1.75x #3195

Closed K-ETFreeman closed 3 weeks ago

K-ETFreeman commented 4 weeks ago

Resolves issue when popup had wrong size when UI scaling is enabled: image

I did not find any meaningful explanation for the adjustment values which needed to be made. Probably some rounding error in javaFX, but maybe not. Anyways, this works on 1.25x, 1.5x, 1.75x scaling and does nothing in any other case, so should be good enough.

Sheikah45 commented 4 weeks ago

I don't like this solution for how brittle it is and it only covers I think windows machines for specific scaling values. And adds complexity and handles the UI in a way that isn't done anywhere else in the client.

K-ETFreeman commented 4 weeks ago

I don't like this solution for how brittle it is and it only covers I think windows machines for specific scaling values. And adds complexity and handles the UI in a way that isn't done anywhere else in the client.

I can test on non-windows machine if you want Without deep understanding of the nature of the issue no better solution will be available any time soon, and i believe this is far better than broken UI-scaled popup which we have currently

Code which works for more users > code which works for less users

K-ETFreeman commented 4 weeks ago

Now its working for all UI scales about changes: 1) using tilePane instead flowPane allowed to fix the UI scaling issue and remove some code 2) using some styles magic allowed to remove scrollbar-fix code 3) when(showing) was deleted because it prevents resize function from launching when it should 4) changed the moment when we hide loading pane. This way allows to remove default 530 size from scrollpane while causing no popup srinking the moment loadingPane is hidden (because now its being hidden exactly when maps appears, no frames between removal and maps added like it was before)