使用VCL Styles启用应用程序和显示缩放的Windows标题栏中的可视化错误 [英] Visual bug in Windows title bar with VCL Styles enabled application and display scaling

查看:361
本文介绍了使用VCL Styles启用应用程序和显示缩放的Windows标题栏中的可视化错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在测试支持VCL样式的应用程序的各个方面。



我注意到,Windows缩放比默认的96 dpi / 100%更高,
VCL表单的图标和标题栏文本的大小太大,而且两者都要关闭在一起,请参见附带的截图。对于200%或250%的更高的缩放比例(例如在4K显示屏和Windows 10上使用),这一点尤其如此,但即使是144 dpi / 150%的缩放比例,问题已经可见。



对于RAD Studio提供的所有样式都是如此。通过项目设置启用高清晰的清单意识。
如果我在应用程序中禁用VCL样式,图标和标题栏文本的大小是正确的。



我在这里遗漏了什么?传递的样式不应该在显示缩放启用的情况下开箱即用,而没有显示错误?或者有一些设置可以调整来解决这个问题。



谢谢,




解决方案

这里是我的视觉错误的解决方案,请看附件截图。我在Vcl.Forms.pas中的3个地方修复了。



第一个修复,与标题栏修复1进行了评论,解决了图标不正确的问题在具有VCL风格应用程序的默认96dpi Windows上绘制,即使没有缩放。我可以根据关于WM_GETICON,ICON_SMALL2的发现,从James Johnston,








Currently I am testing various aspects of VCL styles enabled applications.

I noticed, that with Windows scaling higher than the default 96 dpi/100%, the icon and the title bar text of the VCL Form are too big in size - and both are to close together -, please see attached screenshots. This is especially true with higher scalings like 200% or 250% (e.g. used on 4K displays and Windows 10), but even with a scaling of 144 dpi/150%, the problem is already visible.

This is true for all styles delivered with RAD Studio. High Dpi awareness for manifest is enabled via project settings. If I disable VCL Styles in the App, the icon and title bar text is correct in size.

Am I missing something here? Shouldn't the delivered styles work without such display errors out of the box with display scaling enabled? Or is there some setting somewhere I can adjust to fix this.

Thanks,

解决方案

Ok, here is my solution for the visual bugs, please see the attached screenshots. I did fixes in 3 places in Vcl.Forms.pas.

The first fix, commented with // Title bar fix 1, addresses the problem that the icon is not correctly drawn, even without scaling, on a default 96dpi Windows with a VCL styled application. I could fix this based on the findings about WM_GETICON, ICON_SMALL2, from James Johnston, http://stackoverflow.com/a/35067909 thanks, James, for that!

The other two fixes address the problem that the icon is drawn too big with display scaling enabled, and that the distance between the icon and the title bar text is too small. These are the fixes commented with // Title bar fix 2 and 3 in the code. GetDpi is just a getter for the current dpi value, which I get from my C sources within the application.

The result is in no way perfect, but it will do for now, with this the VCL styled application is at least acceptable under scaled circumstances.

Thanks to all for your input.

这篇关于使用VCL Styles启用应用程序和显示缩放的Windows标题栏中的可视化错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆