Skip to content

Commit 49c68a7

Browse files
Correclty load icons of panels with whitespaces in their name (#1241) (#1244)
(cherry picked from commit d390a55) Co-authored-by: Patrick Roncagliolo <[email protected]>
1 parent 7bdb154 commit 49c68a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rviz_common/include/rviz_common/factory/pluginlib_factory.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ class PluginlibFactory : public ClassIdRecordingFactory<Type>
177177
return loadPixmap(default_icon_path);
178178
}
179179

180-
auto base_path = "package://" + info.package + "/icons/classes/" + info.name;
180+
auto encoded_name = info.name;
181+
encoded_name.replace(" ", "%20");
182+
auto base_path = "package://" + info.package + "/icons/classes/" + encoded_name;
181183
QIcon icon = loadPixmap(base_path + ".svg");
182184
if (icon.isNull()) {
183185
icon = loadPixmap(base_path + ".png");

0 commit comments

Comments
 (0)