Windows 10 上 C++ 应用程序的深色主题 [英] Dark Theme for C++ application on Windows 10
问题描述
我在 Windows 10 上使用应用程序 Qalculate.Qalculate 是用 C++ 编写的.我想应用一个黑暗的主题,可能会为 Github 项目做出贡献.
Qalculate 网站上的屏幕截图显示了一个黑暗的主题:
我已经联系了主要开发人员 Hanna-kn,了解如何应用深色主题.这是她的回复:
<块引用>您可以添加环境变量(在高级系统属性中)GTK_THEME,其值为 Adwaita:dark,或者在文件夹 C:\Program Files\Qalculate\share\gtk-3.0 或 C:\ 中创建一个名为 settings.ini 的文件Users[用户名]\AppData\Local\gtk-3.0,内容如下
【设置】gtk-application-prefer-dark-theme=true
似乎她使用的是 Linux,并且在 Windows 10 中将主题应用于特定应用程序的过程与 Linux 不同.
需要在 Github 项目中添加哪些代码才能使用深色主题?或者是否有其他应用程序允许在 Windows 10 中使用特定于应用程序的深色主题.
注意:Windows 10 设置中已启用深色主题:
开发人员 Hanna-kn 更新了她的代码以允许使用深色主题.此处代码前后:
https://github.com/Qalculate/qalculate-gtk/commit/d16c0f424d5bb71dd6a69291d1972b45a2b84f4a
I am using the application Qalculate on Windows 10. Qalculate is written in C++. I would like to apply a dark theme, possibly contributing to the Github project.
GitHub
GitHub Libraries
Website
Screenshots
Here is what the app currently looks like on my system:
The screenshots on the Qalculate website show a dark theme:
I've contacted the primary developer Hanna-kn about how to apply the dark theme. This was her reply:
You can either add environment variable (in advanced system properties) GTK_THEME with value Adwaita:dark, or create a file named settings.ini, in folder C:\Program Files\Qalculate\share\gtk-3.0 or C:\Users[username]\AppData\Local\gtk-3.0, with the following contents
[Settings] gtk-application-prefer-dark-theme=true
It appears that she is using Linux and the process to apply a theme to a specific application in Windows 10 is different than Linux.
What code would need to be added to the Github project to allow a dark theme? Or is there another application that would allow an application specific dark theme in Windows 10.
Note:
Dark theme is already turned on in the Windows 10 settings:
Developer Hanna-kn updated her code to allow a dark theme. Before and After code here:
https://github.com/Qalculate/qalculate-gtk/commit/d16c0f424d5bb71dd6a69291d1972b45a2b84f4a
这篇关于Windows 10 上 C++ 应用程序的深色主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!