Properties DesignPPI and ParenFont changed without warning when opening project
Original Reporter info from Mantis: emilt
-
Reporter name: Emil Totev
Original Reporter info from Mantis: emilt
- Reporter name: Emil Totev
Description:
The documentation at https://wiki.lazarus.freepascal.org/Autosize_/_Layout#DPI_auto-adjustment_and_absolute_layout_auto-adjustment says:
TCustomForm.DesignTimeDPI should store the DPI value of the system where the form was designed.
However when I open a form, designed at 96ppi on a display with 120ppi, this is automatically and without warning changed to 120, causing other changes to the form and controls properties. One of the changed properties is ParentFont, which is set to False for the form and the child controls.
Furthermore, it is not possible to change the DesignTimePPI back to the correct value.
As a result of this, the same project looks and behaves differently when opened built at different display PPIs.
This is on Lazarus 2.0.8 x64.
Steps to reproduce:
Set the scaling in Windows settings to 100%. Start lazarus, create a form with a group box on it and set on both ParentFont = True. The DesignPPI will be 96.
Save the form, close lazarus, set the scaling to 125%.
Start lazarus and open the form. ParentFont will be false for the form and the group box. DesignTimePPi will be 120, and not possible to change. Some other properties will be changed as well.
Additional information:
Note that only opening the project does not change the LFM file, so if the project is built, all will be OK. But if you make any change in the object inspector, e.g. to the caption, that will trigger saving the modified form and the next build will be wrong.
Working on the same project at different screen PPIs becomes virtually impossible.
Mantis conversion info:
- Mantis ID: 37227
- OS: Windows 10 x64
- Platform: Windows
- Monitored by: » emilt (Emil Totev), » @PascalDragon (Sven Barth)