Recent

Author Topic: Design DPI > 96 with TSPKToolbar  (Read 839 times)

ChristianH

  • New Member
  • *
  • Posts: 49
Design DPI > 96 with TSPKToolbar
« on: September 03, 2025, 09:24:38 pm »
Hi,

i stumbled over an issue which I don't see to fix easily. I switched to a new system and the DPI of my System is now no longer 96 and this is something SPK Toolbar dislike. I thought maybe I should use a newer build from https://sourceforge.net/p/lazarus-ccr/, but it did not solved the problem.

My workaround is to put SpkInitLayoutConsts(96,Screen.PixelsPerInch);  in formshow, but this does not seem to be correct.

Christian
« Last Edit: September 03, 2025, 09:44:08 pm by ChristianH »

wp

  • Hero Member
  • *****
  • Posts: 13277
Re: Design DPI > 96 with TSPKToolbar
« Reply #1 on: September 04, 2025, 01:31:37 am »
i stumbled over an issue which I don't see to fix easily. I switched to a new system and the DPI of my System is now no longer 96 and this is something SPK Toolbar dislike.
What is happening?

I just designed a small test project on a 144ppi system, but did not notice anything which looks wrong.

ChristianH

  • New Member
  • *
  • Posts: 49
Re: Design DPI > 96 with TSPKToolbar
« Reply #2 on: September 04, 2025, 07:42:26 am »
It looks like this if I do not rescale the toolbar.

Christian

wp

  • Hero Member
  • *****
  • Posts: 13277
Re: Design DPI > 96 with TSPKToolbar
« Reply #3 on: September 04, 2025, 10:44:34 am »
I've never seen this... Could it be that this form was created with a very old version of TSpkToolbar in which scaling was not or differently implemented than today? Can you switch your system to 96ppi (or use a VM with 96ppi) and load and save the project with a current version of TSpkToolbar? Make sure that LCLScaling in the project options is checked. When you then reload the project at your new PPI settings hopefully the scaling should be adapted. Another idea: Close the IDE, and open the lfm file of the form with the SpkToolbar in an external editor. Is there a line DesignTimePPI? Delete it and save. When you now load the project into the IDE will the toolbar scale correctly? Needless to say: make a backup copy of your project before doing these changes.

dseligo

  • Hero Member
  • *****
  • Posts: 1625
Re: Design DPI > 96 with TSPKToolbar
« Reply #4 on: November 18, 2025, 04:49:57 am »
I have same problem, I work with scale 125% (Windows 11).
When same application is run on Windows with scale 100%, this problem shows (I attached screenshots from sample application).

If I remove line 'DesignTimePPI = 120' from .lfm and recompile the project, it is fine on 100% too.

Problem is that Lazarus insert line 'DesignTimePPI = 120' as soon as some change is made to form, so this solution is not practical.

I tried with SpkToolbar from OPM and from CCR.

wp

  • Hero Member
  • *****
  • Posts: 13277
Re: Design DPI > 96 with TSPKToolbar
« Reply #5 on: November 18, 2025, 06:22:48 pm »
Thanks for submitting this test project, now I can confirm the issue. I must confess that I never tested this case of designing at higher dpi than viewing.

Please update your SpkToolbar from the CCR repository and check.

dseligo

  • Hero Member
  • *****
  • Posts: 1625
Re: Design DPI > 96 with TSPKToolbar
« Reply #6 on: November 19, 2025, 02:04:45 am »
Thanks for submitting this test project, now I can confirm the issue. I must confess that I never tested this case of designing at higher dpi than viewing.

Please update your SpkToolbar from the CCR repository and check.

Great, it works in my tests and in my application.

Thank you!

 

TinyPortal © 2005-2018