【发布时间】:2011-04-26 15:12:42
【问题描述】:
我正在编写一个 Gedit 插件并为它创建了一个 SVG 图标(当然可以导出为任何格式)。如何配置此插件以在 Edit > Preferences > Plugins 对话框的插件列表中显示此图标?
【问题讨论】:
标签: python plugins icons pygtk gedit
我正在编写一个 Gedit 插件并为它创建了一个 SVG 图标(当然可以导出为任何格式)。如何配置此插件以在 Edit > Preferences > Plugins 对话框的插件列表中显示此图标?
【问题讨论】:
标签: python plugins icons pygtk gedit
.plugin 文件接受Icon 字段——如本例所示:
[Gedit Plugin]
Loader=python
Module=TextWrap
IAge=2
Icon=gtk-ok
[... and so on ...]
取自TextWrap插件源。
要将自定义图标添加到现有图标主题,请将其放在适当的文件夹中 - 即
$prefix/share/icons/hicolor/scalable/apps
正如 ptomato 建议的那样,(如果你使用 linux,$prefix 可能是 /usr)然后运行
$ gtk-update-icon-cache $prefix/share/icons/hicolor
如果图标文件名是gedit-plug.svg,它现在应该是gedit-plug。请注意,我实际上是在 gnome 主题上测试的,而不是 hicolor 主题。
【讨论】:
您应该在$prefix/share/icons/hicolor/scalable/apps 中安装您的图标:参见Free Desktop Icon Theme Specificaton。
【讨论】: