Closed OwenChia closed 3 years ago
有什么办法可以获取屏幕的 DPI 么?有的话还是自己生成比较好………
当然有办法
Sent from my iPhone
On 13 Nov 2016, at 1:09 AM, Wenxuan Zhao notifications@github.com wrote:
有什么办法可以获取屏幕的 DPI 么?有的话还是自己生成比较好………
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
像这样 xdpyinfo | awk '/resolution/ {print $2}'
应该就可以获取 DPI 了,
不过好像这种解决方法(即通过 --force-device-scale-factor 参数)不是很完美,我这里像登录界面、迷你模式这种显示都有问题。
本来这种问题应该由上游解决的……
@OwenChia 这样的话需要再加一个依赖?还是让用户自己选择比较好? 的确应该上游解决的,但是上游貌似不再更新了……
QT_DEVICE_PIXEL_RATIO
,改用其他的环境变量。详见:http://doc.qt.io/qt-5/highdpi.html#high-dpi-support-in-qtdrop in : a388ef24408954f9fc575846f239f25e1b0430e7
因为现在的参数是写死的,所以在某些分辨率的屏幕上会有些问题. 比如 1080P 的 14 寸屏幕。
为了可以自定义,暂时的想法是提示用户自己创建个文件,然后更改现在的启动脚本为:
@vizv 有什么建议么?