View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001375 | Double Commander | Graphical user interface | public | 2016-05-14 19:46 | 2021-09-05 15:10 |
Reporter | bugboy | Assigned To | Alexx2000 | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Projection | none | ETA | none | ||
Product Version | 1.0.0 (trunk) | ||||
Summary | 0001375: Wrong control spacing on HiDPI screens | ||||
Description | The application assumes that the application is running with 100% font-scaling. On HiDPI screens this results in incorrect spacing between controls. It seems that all coordinates are based on physical pixels, instead of logical pixels. The fonts are rendered according to the scaling factor. The file panels can be tweaked so they look reasonable fine on HiDPI displays, but this makes it difficult when switching between HiDPI and normal mode. I have added a screen-shot of the configuration pane on 175%. | ||||
Steps To Reproduce | Change your Windows font-scaling to 200% to illustrate the effect. | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Fixed in Revision | |||||
Operating system | Windows | ||||
Widgetset | |||||
Architecture | |||||
|
I have investigated the application's manifest (built-in resource) and the manifest specifies that this application is DPI aware (which it isn't). After removing this setting, the application looks like any other non DPI-aware application. It's not as crisp anymore, but the spacing is fixed. Patching the application's manifest is not for the faint of heart, but I wanted to try it to make sure this was causing this issue. |
|
There is an article on this in Lazarus wiki http://wiki.lazarus.freepascal.org/High_DPI This can be worked out by little loop which will be scaling control size, spacing and font size, if it's not 0 (auto). uscaledpi from LazPaint is given as example. This should be called in OnCreate of every form. Options isn't only form that needs to be scaled. There are also forms like copy dialog, search form, find dialog in viewer etc etc Font size in main panels seem to be properly scaled already. Unsure with image viewer, which itself should render pixel to pixel, yet toolbar needs to be scaled. |
|
IMO only need to set Autosize for comboboxes. in screenshot. DpiAware must be on as now in menifest. Treeview v-arrow scaling. Is fixed in Laz 1.7 trunk. |
|
DPIaware manifest doesn't scale anything. It only tells system that the app controls dpi scaling by itself, so draws win32 controls natively without scaling. If it doesn't tell the system, it will raster scale entire window, doing it pretty bad with huge compression that results in blur. Aside of manifest, for Windows, all control, size, constraints, borderspacings and other elemts such as column width, if they have fixed width and more, if any needed, in any OS and Widgetset should be resized manually respective of system scale settings. There are little functions for that in Lazarus - ScaleX and ScaleY. And there is example from LazPaint in link above on how could it be done with a little loop that could be fired during OnCreate. function ScaleX(const SizeX, FromDPI: Integer): Integer; function ScaleY(const SizeY, FromDPI: Integer): Integer; Any form saves DesignTimeDPI, which could be used with those functions. Looking down the wiki article, there is seem to be an improvement for scaling in current trunk - AutoAdjustLayout. Didn't try it though. |
|
Lazarus 1.8 will have hiDPI scaling, it seem been under active development recent days, so better just wait for it. |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-05-14 19:46 | bugboy | New Issue | |
2016-05-14 19:46 | bugboy | File Added: Capture.PNG | |
2016-06-01 20:48 | bugboy | Note Added: 0001727 | |
2016-11-15 13:15 | user01 | Note Added: 0001999 | |
2016-11-15 13:16 | user01 | Note Edited: 0001999 | |
2016-11-15 23:19 | Alextp | Note Added: 0002000 | |
2016-11-16 00:20 | user01 | Note Added: 0002001 | |
2016-12-08 17:42 | user01 | Note Added: 0002031 | |
2017-03-08 13:00 | Alexx2000 | Relationship added | related to 0001742 |
2017-03-08 13:09 | Alexx2000 | Status | new => acknowledged |
2018-07-22 18:20 | Alexx2000 | Status | acknowledged => resolved |
2018-07-22 18:20 | Alexx2000 | Resolution | open => fixed |
2018-07-22 18:20 | Alexx2000 | Assigned To | => Alexx2000 |
2021-09-05 15:10 | Alexx2000 | Status | resolved => closed |