[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 93/473: Show launcher name in context menu.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:54:23 CET 2015


This is an automated email from the git hooks/post-receive script.

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit a11ae0aea66884025bd0310005802ea7ba61f505
Author: Graeme Gott <graeme at gottcode.org>
Date:   Fri Jul 12 15:32:37 2013 -0400

    Show launcher name in context menu.
---
 src/launcher.cpp |    8 ++++----
 src/launcher.hpp |    6 ++++++
 src/page.cpp     |    7 ++++++-
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/launcher.cpp b/src/launcher.cpp
index cacd82d..d7b08ca 100644
--- a/src/launcher.cpp
+++ b/src/launcher.cpp
@@ -132,7 +132,7 @@ Launcher::Launcher(GarconMenuItem* item) :
 
 	// Create display text
 	const gchar* direction = (gtk_widget_get_default_direction() != GTK_TEXT_DIR_RTL) ? "\342\200\216" : "\342\200\217";
-	const gchar* display_name = (f_show_name || exo_str_is_empty(generic_name)) ? name : generic_name;
+	m_display_name = (f_show_name || exo_str_is_empty(generic_name)) ? name : generic_name;
 	if (f_show_description)
 	{
 		const gchar* details = garcon_menu_item_get_comment(m_item);
@@ -140,7 +140,7 @@ Launcher::Launcher(GarconMenuItem* item) :
 		{
 			details = generic_name;
 		}
-		m_text = g_markup_printf_escaped("%s<b>%s</b>\n%s%s", direction, display_name, direction, details);
+		m_text = g_markup_printf_escaped("%s<b>%s</b>\n%s%s", direction, m_display_name, direction, details);
 
 		// Create search text for comment
 		gchar* normalized = g_utf8_normalize(details, -1, G_NORMALIZE_DEFAULT);
@@ -151,11 +151,11 @@ Launcher::Launcher(GarconMenuItem* item) :
 	}
 	else
 	{
-		m_text = g_markup_printf_escaped("%s%s", direction, display_name);
+		m_text = g_markup_printf_escaped("%s%s", direction, m_display_name);
 	}
 
 	// Create search text for display name
-	gchar* normalized = g_utf8_normalize(display_name, -1, G_NORMALIZE_DEFAULT);
+	gchar* normalized = g_utf8_normalize(m_display_name, -1, G_NORMALIZE_DEFAULT);
 	gchar* utf8 = g_utf8_casefold(normalized, -1);
 	m_search_name = utf8;
 	g_free(utf8);
diff --git a/src/launcher.hpp b/src/launcher.hpp
index d471ded..98fa06c 100644
--- a/src/launcher.hpp
+++ b/src/launcher.hpp
@@ -37,6 +37,11 @@ public:
 	explicit Launcher(GarconMenuItem* item);
 	~Launcher();
 
+	const gchar* get_display_name() const
+	{
+		return m_display_name;
+	}
+
 	const gchar* get_icon() const
 	{
 		return m_icon;
@@ -78,6 +83,7 @@ private:
 
 private:
 	GarconMenuItem* m_item;
+	const gchar* m_display_name;
 	gchar* m_icon;
 	gchar* m_text;
 	std::string m_search_name;
diff --git a/src/page.cpp b/src/page.cpp
index 4c608bb..4231cee 100644
--- a/src/page.cpp
+++ b/src/page.cpp
@@ -170,7 +170,12 @@ void Page::create_context_menu(GtkTreeIter* iter, GdkEventButton* event)
 	g_signal_connect(menu, "selection-done", SLOT_CALLBACK(Page::destroy_context_menu), this);
 
 	// Add menu items
-	GtkWidget* menuitem = NULL;
+	GtkWidget* menuitem = gtk_menu_item_new_with_label(launcher->get_display_name());
+	gtk_widget_set_sensitive(menuitem, false);
+	gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
+
+	menuitem = gtk_separator_menu_item_new();
+	gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
 
 	if (!m_menu->get_favorites()->contains(launcher))
 	{

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list