为什么图标主题资源路径没有列在get_search_path



在 Gtk::IconTheme 的 GTKMM 参考文档中,add_resource_path(( 的部分说

void Gtk::IconTheme::add_resource_path ( conststd::string& path (

添加查找图标时将查看的资源路径, 类似于搜索路径。

此函数应用于制作特定于应用程序的图标 作为图标主题的一部分提供。

这些资源被视为 hicolor 图标主题的一部分,并且 必须位于 hicolor 图标中定义的子目录中 主题,例如@a路径/16x16/操作/运行.png。直接的图标 放置在资源路径而不是子目录中也 被认为是最终的后备。

自 gtkmm 3.14 起:

参数

       路径 资源路径

我为此创建了一个变量,下面是我的示例代码:

Glib::RefPtr<Gtk::IconTheme> window_icon_theme = Gtk::IconTheme::create();
window_icon_theme->add_resource_path("/home/keyikedalube/Source/basic-calc/icons")
// get the path lists
std::vector<Glib::ustring> path_lists = window_icon_theme->get_search_path();
for (auto i : path_lists)
std::cout << i << endl;

输出产生:

/home/keyikedalube/.local/share/icons
/home/keyikedalube/.icons
/usr/share/xfce4/icons
/home/keyikedalube/.local/share/flatpak/exports/share/icons
/var/lib/flatpak/exports/share/icons
/usr/local/share/icons
/usr/share/icons
/usr/share/icons
/usr/share/xfce4/pixmaps
/home/keyikedalube/.local/share/flatpak/exports/share/pixmaps
/var/lib/flatpak/exports/share/pixmaps
/usr/local/share/pixmaps
/usr/share/pixmaps
/usr/share/pixmaps

我的资源路径/home/keyikedalube/Source/basic-calc/icons未显示在列表中

我错过了什么?

引用"资源"路径的API谈论的是GResources内部的路径,而不是文件系统上的路径。

最新更新