[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 01/06: Use applications-other as category fallback icon.
noreply at xfce.org
noreply at xfce.org
Tue Jan 14 11:43:54 CET 2020
This is an automated email from the git hooks/post-receive script.
g o t t c o d e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository panel-plugins/xfce4-whiskermenu-plugin.
commit 5f255ec86befc24f549335e81fc9657b51ab855e
Author: Graeme Gott <graeme at gottcode.org>
Date: Mon Oct 16 06:12:09 2017 -0400
Use applications-other as category fallback icon.
---
panel-plugin/category.cpp | 17 ++++++-----------
panel-plugin/category.h | 4 ++--
2 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/panel-plugin/category.cpp b/panel-plugin/category.cpp
index e5314df..9c257df 100644
--- a/panel-plugin/category.cpp
+++ b/panel-plugin/category.cpp
@@ -22,6 +22,7 @@
#include <algorithm>
+#include <exo/exo.h>
#include <glib/gi18n-lib.h>
using namespace WhiskerMenu;
@@ -57,10 +58,9 @@ Category::Category(GarconMenuDirectory* directory) :
}
else
{
- icon = "applications-other";
text = _("All Applications");
}
- set_icon(icon ? icon : "");
+ set_icon(!exo_str_is_empty(icon) ? icon : "applications-other");
set_text(text ? text : "");
set_tooltip(tooltip ? tooltip : "");
}
@@ -108,7 +108,7 @@ GtkTreeModel* Category::get_model()
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_POINTER);
- insert_items(model, NULL, get_icon());
+ insert_items(model, NULL);
m_model = GTK_TREE_MODEL(model);
}
else
@@ -180,7 +180,7 @@ void Category::sort()
//-----------------------------------------------------------------------------
-void Category::insert_items(GtkTreeStore* model, GtkTreeIter* parent, const gchar* fallback_icon)
+void Category::insert_items(GtkTreeStore* model, GtkTreeIter* parent)
{
for (std::vector<Element*>::size_type i = 0, end = m_items.size(); i < end; ++i)
{
@@ -193,24 +193,19 @@ void Category::insert_items(GtkTreeStore* model, GtkTreeIter* parent, const gcha
continue;
}
- const gchar* icon = category->get_icon();
- if (!gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), icon))
- {
- icon = fallback_icon;
- }
gchar* text = g_markup_escape_text(category->get_text(), -1);
const gchar* tooltip = category->get_tooltip();
GtkTreeIter iter;
gtk_tree_store_insert_with_values(model,
&iter, parent, INT_MAX,
- LauncherView::COLUMN_ICON, icon,
+ LauncherView::COLUMN_ICON, category->get_icon(),
LauncherView::COLUMN_TEXT, text,
LauncherView::COLUMN_TOOLTIP, tooltip,
LauncherView::COLUMN_LAUNCHER, NULL,
-1);
g_free(text);
- category->insert_items(model, &iter, icon);
+ category->insert_items(model, &iter);
}
else if (element)
{
diff --git a/panel-plugin/category.h b/panel-plugin/category.h
index 400a593..164db8c 100644
--- a/panel-plugin/category.h
+++ b/panel-plugin/category.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2017 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -69,7 +69,7 @@ public:
void sort();
private:
- void insert_items(GtkTreeStore* model, GtkTreeIter* parent, const gchar* fallback_icon);
+ void insert_items(GtkTreeStore* model, GtkTreeIter* parent);
void insert_items(GtkListStore* model);
void merge();
void unset_model();
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list