[Xfce4-commits] <xfce4-taskmanager:master> Replace image against radio menu items in the refresh rate menu

Mike Massonnet noreply at xfce.org
Sun May 30 18:44:01 CEST 2010


Updating branch refs/heads/master
         to 23ae93bc9eda35702378b8214e7e01d9f53bd6e7 (commit)
       from b1424a9b07a70ef35bee0533ca76b89a7b1f9408 (commit)

commit 23ae93bc9eda35702378b8214e7e01d9f53bd6e7
Author: Mike Massonnet <mmassonnet at xfce.org>
Date:   Sun May 30 18:24:56 2010 +0200

    Replace image against radio menu items in the refresh rate menu
    
    The stock items right-arrow are not always available (sad truth),
    therefore be smart and use a radio menu item that will always be
    displayed.

 src/process-window.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/process-window.c b/src/process-window.c
index 37c8d87..08d1462 100644
--- a/src/process-window.c
+++ b/src/process-window.c
@@ -245,11 +245,14 @@ menu_refresh_rate_append_item (GtkMenu *menu, gchar *title, guint refresh_rate,
 
 	g_object_get (settings, "refresh-rate", &cur_refresh_rate, NULL);
 
-	mi = gtk_image_menu_item_new_with_label (title);
 	if (cur_refresh_rate == refresh_rate)
 	{
-		GtkWidget *image = gtk_image_new_from_stock (GTK_STOCK_GO_FORWARD, GTK_ICON_SIZE_MENU);
-		gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), image);
+		mi = gtk_radio_menu_item_new_with_label (NULL, title);
+		gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mi), TRUE);
+	}
+	else
+	{
+		mi = gtk_menu_item_new_with_label (title);
 	}
 	gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
 	g_object_set_data (G_OBJECT (mi), "refresh-rate", GUINT_TO_POINTER (refresh_rate));



More information about the Xfce4-commits mailing list