如何使用两个Gtk.IconLookupFlags?

2024-10-03 11:26:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我想找到一个有两个标志(强制大小和无SVG)的应用程序图标,但我不知道怎么做!你知道吗

我已经尝试了以下方法:

icon = Gio.content_type_get_icon(mimetype)
theme = Gtk.IconTheme.get_default()
info = theme.choose_icon(icon.get_names(), size, Gtk.IconLookupFlags.NO_SVG, Gtk.IconLookupFlags.FORCE_SIZE)

返回错误,因为我给出了3个以上的参数

icon = Gio.content_type_get_icon(mimetype)
theme = Gtk.IconTheme.get_default()
info = theme.choose_icon(icon.get_names(), size, (Gtk.IconLookupFlags.NO_SVG, Gtk.IconLookupFlags.FORCE_SIZE))

返回错误,因为它要求的是标志类型而不是元组

icon = Gio.content_type_get_icon(mimetype)
theme = Gtk.IconTheme.get_default()
info = theme.choose_icon(icon.get_names(), size, Gtk.IconLookupFlags.NO_SVG and Gtk.IconLookupFlags.FORCE_SIZE)

返回错误大小的图标。你知道吗

我已经试过搜索,但找不到任何问题的答案


Tags: svginfodefaultgtkgetnamestypecontent