[英]How to get window frame radius in Unity/Compiz?
Is there a way to get window frame radius in Unity (Compiz window manager)? 有没有办法在Unity(Compiz窗口管理器)中获取窗口框架半径? Should I do such by parsing active window theme?
我应该通过解析活动窗口主题来做到这一点吗? If so, what files should I parse?
如果是这样,我应该解析哪些文件? Any other ways are accepted too.
任何其他方式也可以接受。 Plus, if you know a solution for any other WM, write it please.
另外,如果您知道其他WM的解决方案,请写下。
I use Qt, and, as good as I know, it doesn't provide such functionality 'of the box'. 我使用Qt,据我所知,它没有提供“即用即用”的功能。 But, if you know any Qt options, they are preferred.
但是,如果您知道任何Qt选项,则首选它们。
Under window frame radius I mean the following area (bordered by red, red is not included): 在窗框半径下,我指的是以下区域(以红色为边框,不包括红色):
For example, at the illustration, frame border radius is 6 px because the side of the square inside red border is 6px. 例如,在插图中,边框的半径为6像素,因为红色边框内部的正方形边为6像素。
For Ubuntu 14.04.02 LTS/Unity, radius is controlled by CSS in /usr/share/themes/< theme name >/gtk-3.0/apps/unity.css 对于Ubuntu 14.04.02 LTS / Unity,半径由/ usr / share / themes / < 主题名称 > /gtk-3.0/apps/unity.css中的CSS控制
Locate the line "border-radius:" as indicated in the text below. 如以下文本所示,找到“边界半径:”行。 Change the values according to standard CSS radius rules.
根据标准CSS半径规则更改值。 Default values are: 6px 6px 0 0;
默认值为:6px 6px 0 0;
This changes ONLY the title bar across the top and applies to the 4 corners of the title bar. 这仅会更改顶部的标题栏,并应用于标题栏的四个角。
Logout/login for changes to take effect. 注销/登录以使更改生效。
The text displayed below is from the "Radiance" theme in /usr/share/themes/Radiance/gtk-3.0/apps/unity.css after modification. 修改后,下面显示的文本来自/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);
}
It is defined in the shell theme's css file under 它是在shell主题的css文件下定义的
/usr/share/themes
What you are searching for is the 您正在寻找的是
border-radius
property of the windows. 窗户的属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.