ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #07241
Re: [Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/lok-new-zoom-modes+spreadsheet-zoom into lp:ubuntu-docviewer-app
Ok, I tried to use the GRID_UNIT used by the UITK, instead of assuming the size of the document on DPI.
Screenshot - BQ E5: https://imgur.com/FobrTSK
Screenshot - desktop: https://imgur.com/2ODW93W
It seems to provide the result we were expecting.
---
Basically, the idea is to make the size of the document depending on perceived size of the screen[1], instead of being the same size in inches on any screen/device.
This way the value of the 1.0x zoom factor *should* also depend on the distance between the device and the user (which is kinda important for a proper scaling of a phone GUI).
The logic behind this would be taken from the UITK and *should* work on any device, regardless is an Ubuntu device or not.
That's how it works:
1) Read GRID_UNIT_PX variable (Ubuntu Touch/Personal specific)
2) If GRID_UNIT_PX not found, read QT_DEVICE_PIXEL_RATIO variable (Qt specific, works on any platform)
3) If the Qt variable is not found, just assume it's a desktop with the standard 96 DPI value.
This is done using qgetenv(), which is a Qt function and works even on MS Windows.
Further informations can be found here:
http://bazaar.launchpad.net/~ubuntu-sdk-team/ubuntu-ui-toolkit/staging/view/head:/src/Ubuntu/Components/plugin/ucunits.cpp
======
[1] i.e. physical quality of the screen + scope of the device - see "Screen Pixel Ratio" section at
https://developer.ubuntu.com/en/start/ubuntu-for-devices/porting-new-device/
--
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/lok-new-zoom-modes+spreadsheet-zoom/+merge/281385
Your team Ubuntu Document Viewer Developers is subscribed to branch lp:ubuntu-docviewer-app.
References