有没有办法在 Unity(Compiz 窗口管理器)中获取窗口框架半径?我应该通过解析事件窗口主题来这样做吗?如果是这样,我应该解析哪些文件?任何其他方式也被接受。另外,如果您知道任何其他 WM 的解决方案,请写下来。
我使用 Qt,据我所知,它不提供这种“即装即用”的功能。但是,如果您知道任何 Qt 选项,它们是首选。
在窗框半径下我指的是以下区域(红色边框,不包括红色):
例如,在插图中,边框半径为 6 px,因为红色边框内的正方形边长为 6 px。
最佳答案
对于 Ubuntu 14.04.02 LTS/Unity,半径由/usr/share/themes/<主题名称>/gtk-3.0/apps/unity.css 中的 CSS 控制
找到“border-radius:”行,如下文所示。 根据标准 CSS 半径规则更改值。默认值为:6px 6px 0 0;
这只会更改顶部的标题栏并应用于标题栏的 4 个角。
注销/登录以使更改生效。
下面显示的文字来自/usr/share/themes/Radiance/gtk-3.0/apps/unity.css中的“Radiance”主题修改后。
UnityDecoration.top {
border: 1px solid rgba (85, 40, 0, 0.04); /* shade (@dark_bg_color) (shade (#edebe6, 1.06) */
border-bottom-width: 0;
--> border-radius: 3px 3px 0 0;
padding: 1px 6px 0 6px;
box-shadow: inset 0 0 transparent, inset 0 0 transparent,
inset 0 1px shade (#edebe6, 1.065), inset 0 0 transparent;
background-color: transparent;
background-clip: border-box;
background-image: -gtk-gradient (linear, left top, left bottom,
from (shade (#edebe6, 1.06)),
to (@dark_bg_color));
color: shade (@dark_bg_color, 0.4);
text-shadow: 1px 0 shade (@dark_bg_color, 1.06), -1px 0 shade (@dark_bg_color, 1.06),
0 1px shade (@dark_bg_color, 1.06), 0 -1px shade (@dark_bg_color, 1.06);
}
关于linux - 如何在 Unity/Compiz 中获取窗框半径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16750928/