我正在尝试通过在我的 C++ 应用程序中调用外部 CSS 文件来创建一个圆形按钮。
我设法获得了一个圆形按钮,但仍然存在一些矩形边框,我找不到如何去除该边框。
CSS文件内容:
GtkButton {
-GtkWidget-focus-line-width: 1px;
border-width: 1px;
border-radius: 30px;
background-image: -gtk-gradient (linear,
left top,
left bottom,
from (@win_bg),
color-stop (0.5, @win_dark),
to (@win_bg));
}
PS:我省略了颜色定义以使其更短。
最佳答案
我正在运行 Debian Wheezy(目前正在测试),在安装 gtk unico 引擎(apt-get install gtk3-engines-unico)并修改我的 css 后它起作用了(矩形边框消失了)
GtkButton {
engine: unico;
-GtkWidget-focus-line-width: 1px;
border-width: 1px;
border-radius: 30px;
background-image: -gtk-gradient (linear,
left top,
left bottom,
from (@win_bg),
color-stop (0.5, @win_dark),
to (@win_bg));
}
关于c++ - GTK 和 CSS : Rounded buttons,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16421544/