Recent

Author Topic: DesignTimePPI : is it possible to prevent automatic change ?  (Read 2423 times)

BrunoK

  • Hero Member
  • *****
  • Posts: 623
  • Retired programmer
When working on forms defined with DesignTimePPI of 96 on a system with PPI of 216, the form designer recalculates and switches dimensions to match PPI 216.

But, these form being designed by the Lazarus team, DesignTimePPI should not be allowed to change.

How, where, can one force the designer to retain the original DesignTimePPI  of 96 ?

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: DesignTimePPI : is it possible to prevent automatic change ?
« Reply #1 on: June 24, 2023, 12:44:35 am »
There is a hint on this page: https://wiki.freepascal.org/High_DPI#High_DPI_in_Lazarus_1.8_and_above
Quote
Hint: Do not develop under HighDPI Mode, always develop under normal mode and only test under HighDPI. Otherwise Lazarus IDE will set DesignTimePPI of the different forms to different values.

But I don't understand what that means. Because if you develop form under hi-DPI and someone will open it under low DPI it will scale down again. Even more, there'll be surely only hi-DPI desktops in a near future.

Try to ask on Lazarus mailing list, there is Ondřej Pokorný who developed hi-DPI support for Lazarus, he probably does not visit this forum.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

BrunoK

  • Hero Member
  • *****
  • Posts: 623
  • Retired programmer
Re: DesignTimePPI : is it possible to prevent automatic change ?
« Reply #2 on: June 24, 2023, 01:27:27 pm »
There is a hint on this page: https://wiki.freepascal.org/High_DPI#High_DPI_in_Lazarus_1.8_and_above
Quote
Hint: Do not develop under HighDPI Mode, always develop under normal mode and only test under HighDPI. Otherwise Lazarus IDE will set DesignTimePPI of the different forms to different values.
.
Easier said than done. I understand the interest of working at 96 PPI (that being that the minimal width of a line would be 1 in 96PPi up scale's acceptably well but down-scaling is going to create 0 width lines if defined as 2 pixel on my 212 PPI screen), but I tell you it si impossible on a 13.3" high resolution screen. A character being displayed with a height of maybe 1 mm, even with a very good sight, that's impossible.

I have looked on Lazarus mailing list and there has been a informative discussion, and a test of PPI conversion that sadly does not compile. I cant figure out how the participants could chat about it without a non compilable program.
 
Having read that and my recent experience of some patches to lazarus convince me that I'll have to do more testing. It has been hell to reverse my repository to keep 96 PPI dimensions while testing and preparing patches.



JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4541
  • I like bugs.
Re: DesignTimePPI : is it possible to prevent automatic change ?
« Reply #3 on: June 24, 2023, 04:26:15 pm »
I understand the interest of working at 96 PPI (that being that the minimal width of a line would be 1 in 96PPi up scale's acceptably well but down-scaling is going to create 0 width lines if defined as 2 pixel on my 212 PPI screen), but I tell you it si impossible on a 13.3" high resolution screen. A character being displayed with a height of maybe 1 mm, even with a very good sight, that's impossible.
Heh, I have now an oldish recycled 40" Sony Bravia TV as my monitor. I have to sit a little too close when typing. When I watch videos I sit further away and it is perfect.
Resolution is 1920 * 1080. No need for High-DPI.
I don't have a television in the traditional sense. No antenna, no cable. Everything I watch comes through internet. Some years ago I got fed up with the junk coming from TV.
This 40" screen is a big contrast to my passively cooled mini-PC. A small computer, a big screen.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

wp

  • Hero Member
  • *****
  • Posts: 12459
Re: DesignTimePPI : is it possible to prevent automatic change ?
« Reply #4 on: June 24, 2023, 05:11:21 pm »
There is a hint on this page: https://wiki.freepascal.org/High_DPI#High_DPI_in_Lazarus_1.8_and_above
Quote
Hint: Do not develop under HighDPI Mode, always develop under normal mode and only test under HighDPI. Otherwise Lazarus IDE will set DesignTimePPI of the different forms to different values.
.
Easier said than done. I understand the interest of working at 96 PPI (that being that the minimal width of a line would be 1 in 96PPi up scale's acceptably well but down-scaling is going to create 0 width lines if defined as 2 pixel on my 212 PPI screen), but I tell you it si impossible on a 13.3" high resolution screen. A character being displayed with a height of maybe 1 mm, even with a very good sight, that's impossible.

I have looked on Lazarus mailing list and there has been a informative discussion, and a test of PPI conversion that sadly does not compile. I cant figure out how the participants could chat about it without a non compilable program.
 
Having read that and my recent experience of some patches to lazarus convince me that I'll have to do more testing. It has been hell to reverse my repository to keep 96 PPI dimensions while testing and preparing patches.
Here is a little experiment: I am normally developing on Win-11 at 96ppi and wrote a simple project this way - nothing special, just a few controls, but I checked LCLScaling and selected the "on (True)" DPI scaling setting. This is the default setting, and it is enough to create a scaling application. The form has Scaled=true, and a Width=320 and Height=240 pixels. The attached image "1-..." is taken at runtime (at designtime, it looks the same, of course).

On my Windows system I have a second user which is setup to run at 144 ppi (150%). I switched to this user and ran the application compiled before at 96ppi. Image "2-..." is taken now at 144ppi - everything looks the same, just magnified by the factor 1.5. I started Lazarus which runs at 144 ppi now, and loaded the project - the form looks the same. I added an additional button; it has the size like the other buttons (--> Image "3-...") and compiled.

Returning to my standard user at 96 ppi, I ran the application again which was compiled at 144ppi - the screenshot looks like the first one, just the additonal button (image "4-..."). Loaded the project into the IDE - again no problems.

So, I wonder why people give false statements such as "Do not develop under High-DPI mode"... It is my impression that LCLScaling is rather simple for the application developer: just make the settings mentioned - that's it. Do not attempt to scale anything by yourself.

Scaling is more difficult for the component developer because he has to take care of scaling of the internal dimensions of the component and of the scaling of fonts (except for the standard "Font" property). There has been a recent discussion in the mailing list where Ondrej explained some details (https://lists.lazarus-ide.org/pipermail/lazarus/2023-June/240437.html).

BrunoK

  • Hero Member
  • *****
  • Posts: 623
  • Retired programmer
Re: DesignTimePPI : is it possible to prevent automatic change ?
« Reply #5 on: June 24, 2023, 06:07:06 pm »
I have made changes to PackageEditor form.
On the left, that's the current trunk that I took great care not to alter the .lfm (Actually edited it in notepad to make changes).

Then on the current trunk I just resized the form , recompiled my debug version and compare results in the below screens comparison.

I dont complain, well sort of, but it is not so easy.

BrunoK

  • Hero Member
  • *****
  • Posts: 623
  • Retired programmer
Re: DesignTimePPI : is it possible to prevent automatic change ?
« Reply #6 on: June 24, 2023, 06:08:15 pm »
Back to square one, but I'll figure it out ...

BrunoK

  • Hero Member
  • *****
  • Posts: 623
  • Retired programmer
Re: DesignTimePPI : is it possible to prevent automatic change ?
« Reply #7 on: June 24, 2023, 06:10:40 pm »
My screen 13.3", 2560x1600 points, used at 225%

 

TinyPortal © 2005-2018