High-DPI scaling issue of bottom-anchored controls when Mainmenu is present
Original Reporter info from Mantis: wp @wpam
-
Reporter name:
Original Reporter info from Mantis: wp @wpam
- Reporter name:
Description:
This issue is a bit difficult to explain and to reproduce...
Design a form at 96 ppi, make sure that LCL scaling is active:
- add a TListView (or any other "large" control)
- activate its bottom anchor (Anchors = [akLeft, akTop, akBottom])
- add a TMainMenu, add some menu items
- The project behaves correctly at 96 ppi (--> screenshot "Menu_BottomAnchoredListView_96ppi.png")
Now copy the exe and the sources to a system with higher ppi and continue there:
- Run the exe created at 96ppi: The bottom of the ListView is too high (--> "Menu_BottomAnchoredListView_144ppi_run.png")
- Open Lazarus and load the project. Don't modify the form!
- The form looks correctly at designtime (--> "Menu_BottomAnchoredListView_144ppi_design.png")
- But at runtime, the lower edge of the Listview again is too high (--> "Menu_BottomAnchoredListView_144ppi_run.png")
Other experiments:
- At high DPI: Change the size of the form by a few pixels and compile/run again: Now the ListView has correct size
- Copy the exe to the standard-resolution system again and run there: The bottom margin is too large again, now on the 96ppi system.
Or:
- At 96ppi, remove the anchor akTop, i.e. Anchor = [akLeft, akBottom].
- Transfer to, compile and run at a higher resolution: The top edge of the ListView has moved higher, in the modified project of the attached demo it is underneath the menu now.
Steps to reproduce:
The attached project was created at 96 ppi.
The too-large bottom margin will appear when this project is compiled & run (without any changes!) on the High-DPI system.
Additional information:
It must be emphasized that the issue is related to the presence of the MainMenu. I think that the MainMenu is not in the client area of the form, but this is not considered correctly when the form is loaded and scaled at runtime.
Version used: Laz trunk
Mantis conversion info:
- Mantis ID: 34331
- Monitored by: » @onpok (Ondrej Pokorny)