[英]How do you add icons to application in GTK#
自答案:
你需要有像这样结构的图标目录:
icons/
├── Adwaita
│ ├── 16x16
│ ├── 22x22
│ ├── 24x24
│ ├── 256x256
│ ├── 32x32
│ ├── 48x48
│ ├── 512x512
│ ├── 64x64
│ ├── 8x8
│ ├── 96x96
│ ├── cursors
│ ├── icon-theme.cache
│ ├── index.theme
│ ├── scalable
│ └── scalable-up-to-32
└── hicolor
├── 128x128
├── 16x16
├── 192x192
├── 22x22
├── 24x24
├── 256x256
├── 32x32
├── 36x36
├── 48x48
├── 512x512
├── 64x64
├── 72x72
├── 96x96
├── icon-theme.cache
├── index.theme
├── scalable
└── symbolic
然后,你必须指定图标的路径/
Gtk.IconTheme.Default.AppendSearchPath(@"D:\dev\git\GtkApp1\bin\Debug\icons");
您还可以选择要使用的所需图标主题
Gtk.Settings.Default.IconThemeName = "Adwaita";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.