[Xfce4-commits] r30296 - xfce4-appfinder/trunk/src

Nick Schermer nick at xfce.org
Sun Jul 12 23:35:37 CEST 2009


Author: nick
Date: 2009-07-12 21:35:37 +0000 (Sun, 12 Jul 2009)
New Revision: 30296

Modified:
   xfce4-appfinder/trunk/src/frap-icon-entry.c
   xfce4-appfinder/trunk/src/xfce-appfinder-window.c
Log:
Use Gtk api for entry icon, if available.

Modified: xfce4-appfinder/trunk/src/frap-icon-entry.c
===================================================================
--- xfce4-appfinder/trunk/src/frap-icon-entry.c	2009-07-12 14:04:55 UTC (rev 30295)
+++ xfce4-appfinder/trunk/src/frap-icon-entry.c	2009-07-12 21:35:37 UTC (rev 30296)
@@ -26,8 +26,8 @@
 
 #include "frap-icon-entry.h"
 
+#if !GTK_CHECK_VERSION (2, 16, 0)
 
-
 /* the margin around the icon */
 #define FRAP_ICON_ENTRY_ICON_MARGIN (2)
 
@@ -587,4 +587,4 @@
   gtk_widget_queue_resize (GTK_WIDGET (icon_entry));
 }
 
-
+#endif /* !GTK_CHECK_VERSION (2, 16, 0) */

Modified: xfce4-appfinder/trunk/src/xfce-appfinder-window.c
===================================================================
--- xfce4-appfinder/trunk/src/xfce-appfinder-window.c	2009-07-12 14:04:55 UTC (rev 30295)
+++ xfce4-appfinder/trunk/src/xfce-appfinder-window.c	2009-07-12 21:35:37 UTC (rev 30296)
@@ -278,8 +278,13 @@
   gtk_box_pack_start (GTK_BOX (vbox3), alignment, FALSE, TRUE, 0);
   gtk_widget_show (alignment);
 
+#if GTK_CHECK_VERSION (2, 16, 0)
+  window->search_entry = gtk_entry_new ();
+  gtk_entry_set_icon_from_stock (GTK_ENTRY (window->search_entry), GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_FIND);
+#else
   window->search_entry = frap_icon_entry_new ();
   frap_icon_entry_set_stock_id (FRAP_ICON_ENTRY (window->search_entry), GTK_STOCK_FIND);
+#endif
   g_signal_connect (window->search_entry, "changed", G_CALLBACK (_xfce_appfinder_window_entry_changed), window);
   g_signal_connect (window->search_entry, "activate", G_CALLBACK (_xfce_appfinder_window_entry_activated), window);
   g_signal_connect (window->search_entry, "focus-in-event", G_CALLBACK (_xfce_appfinder_window_entry_focused), window);
@@ -354,7 +359,7 @@
 
   button = gtk_dialog_add_button (GTK_DIALOG (window), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
   g_signal_connect_swapped (button, "clicked", G_CALLBACK (_xfce_appfinder_window_closed), window);
-  
+
   g_object_ref (G_OBJECT (GTK_DIALOG (window)->action_area));
   gtk_container_remove (GTK_CONTAINER (GTK_DIALOG (window)->vbox),
                         GTK_DIALOG (window)->action_area);




More information about the Xfce4-commits mailing list