Don't show 'not found' icon for plugins without an icon
I'm also thinking about a fallback icon. Although I'm not sure if it's better than no icon at all.
I'm also thinking about a fallback icon. Although I'm not sure if it's better than no icon at all.
Yes, I think it is a fine idea.
Well... I tried... Tbh I don't really like how it looks like, but I don't know how to make it better.
Well... I tried... Tbh I don't really like how does it look like, but I don't know how to make it better.
Ok, thanks. I'll have a look when I have some time.
@NamorNiradnug How about reusing the wcm.svg icon (that is the wayfire badge) like this?
diff --git a/src/wcm.cpp b/src/wcm.cpp
index 3624912..3db1d66 100644
--- a/src/wcm.cpp
+++ b/src/wcm.cpp
@@ -1128,10 +1128,18 @@ MainPage::Category::Category(const Glib::ustring & name,
void Plugin::init_widget()
{
+ const auto icon_path = WCM::get_instance()->find_icon("plugin-" + name + ".svg");
+ if (std::filesystem::exists(icon_path))
+ {
+ icon.set(icon_path);
+ } else
+ {
+ icon.set_from_icon_name("wcm", Gtk::ICON_SIZE_DND);
+ }
+
+ button_layout.pack_start(icon);
label.set_text(disp_name);
label.set_ellipsize(Pango::ELLIPSIZE_END);
- icon.set(WCM::get_instance()->find_icon("plugin-" + name + ".svg"));
- button_layout.pack_start(icon);
button_layout.pack_start(label);
button_layout.set_halign(Gtk::ALIGN_START);
button.set_tooltip_markup(tooltip);
Yeah, I think it looks better like this. I'll update the PR later today.
Thanks!