[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 94/473: Add icons to context menu.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:54:24 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 9fad231ebcb3293f05828788c181251bda55a144
Author: Graeme Gott <graeme at gottcode.org>
Date:   Fri Jul 12 17:00:30 2013 -0400

    Add icons to context menu.
---
 src/favorites_page.cpp |    8 ++++++--
 src/page.cpp           |    8 ++++++--
 src/recent_page.cpp    |    4 +++-
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/favorites_page.cpp b/src/favorites_page.cpp
index 416ae76..c4d613c 100644
--- a/src/favorites_page.cpp
+++ b/src/favorites_page.cpp
@@ -70,11 +70,15 @@ void FavoritesPage::extend_context_menu(GtkWidget* menu)
 	GtkWidget* menuitem = gtk_separator_menu_item_new();
 	gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
 
-	menuitem = gtk_menu_item_new_with_label(_("Sort Alphabetically A-Z"));
+	menuitem = gtk_image_menu_item_new_with_label(_("Sort Alphabetically A-Z"));
+	GtkWidget* image = gtk_image_new_from_stock(GTK_STOCK_SORT_ASCENDING, GTK_ICON_SIZE_MENU);
+	gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
 	g_signal_connect(menuitem, "activate", SLOT_CALLBACK(FavoritesPage::sort_ascending), this);
 	gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
 
-	menuitem = gtk_menu_item_new_with_label(_("Sort Alphabetically Z-A"));
+	menuitem = gtk_image_menu_item_new_with_label(_("Sort Alphabetically Z-A"));
+	image = gtk_image_new_from_stock(GTK_STOCK_SORT_DESCENDING, GTK_ICON_SIZE_MENU);
+	gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
 	g_signal_connect(menuitem, "activate", SLOT_CALLBACK(FavoritesPage::sort_descending), this);
 	gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
 }
diff --git a/src/page.cpp b/src/page.cpp
index 4231cee..4f0e604 100644
--- a/src/page.cpp
+++ b/src/page.cpp
@@ -179,13 +179,17 @@ void Page::create_context_menu(GtkTreeIter* iter, GdkEventButton* event)
 
 	if (!m_menu->get_favorites()->contains(launcher))
 	{
-		menuitem = gtk_menu_item_new_with_label(_("Add to Favorites"));
+		menuitem = gtk_image_menu_item_new_with_label(_("Add to Favorites"));
+		GtkWidget* image = gtk_image_new_from_icon_name("stock_add-bookmark", GTK_ICON_SIZE_MENU);
+		gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
 		g_signal_connect_swapped(menuitem, "activate", SLOT_CALLBACK(Page::add_selected_to_favorites), this);
 		gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
 	}
 	else
 	{
-		menuitem = gtk_menu_item_new_with_label(_("Remove From Favorites"));
+		menuitem = gtk_image_menu_item_new_with_label(_("Remove From Favorites"));
+		GtkWidget* image = gtk_image_new_from_stock(GTK_STOCK_REMOVE, GTK_ICON_SIZE_MENU);
+		gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
 		g_signal_connect_swapped(menuitem, "activate", SLOT_CALLBACK(Page::remove_selected_from_favorites), this);
 		gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
 	}
diff --git a/src/recent_page.cpp b/src/recent_page.cpp
index 3cebac2..bc312cd 100644
--- a/src/recent_page.cpp
+++ b/src/recent_page.cpp
@@ -67,7 +67,9 @@ void RecentPage::extend_context_menu(GtkWidget* menu)
 	GtkWidget* menuitem = gtk_separator_menu_item_new();
 	gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
 
-	menuitem = gtk_menu_item_new_with_label(_("Clear Recently Used"));
+	menuitem = gtk_image_menu_item_new_with_label(_("Clear Recently Used"));
+	GtkWidget* image = gtk_image_new_from_stock(GTK_STOCK_CLEAR, GTK_ICON_SIZE_MENU);
+	gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image);
 	g_signal_connect(menuitem, "activate", SLOT_CALLBACK(RecentPage::clear_menu), this);
 	gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
 }

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


More information about the Xfce4-commits mailing list