GTK4:主题解析器错误:需要有效的颜色

问题描述 投票:0回答:0

我想把“对勾”图标的颜色改成蓝色,但是颜色没有变。 相反,我收到以下错误:

(main.py:23000): Gtk-WARNING **: 15:13:17.402: Theme parser error: style.css:25:58-59: Expected a valid color.

我的 CSS 代码如下所示:

.checkmark {
    -gtk-icon-style: symbolic;
    -gtk-icon-source: -gtk-recolor(url("checkmark"), blue);
}

这就是我实现图标的方式(使用 Python):

checkmark = Gtk.Image.new_from_gicon(Gio.Icon.new_for_string("checkmark"))
checkmark.add_css_class("checkmark")
#I later append it to the window

如何在 GTK4 中重新着色复选标记图标?

python css gtk pygtk gtk4
© www.soinside.com 2019 - 2024. All rights reserved.