[Xfce4-commits] [xfce/xfce4-appfinder] 01/13: Ported a few things to GTK3. Taking care of deprecations right now. Preferences crashes when debug is set to full (due to assertions).

noreply at xfce.org noreply at xfce.org
Mon Jul 17 03:22:08 CEST 2017


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

a   n   d   r   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 xfce/xfce4-appfinder.

commit 46b20c5c8e933041a93e33aa9ae2e08600818dfc
Author: Eduard Roccatello <eduard at xfce.org>
Date:   Wed Aug 19 19:43:47 2015 +0200

    Ported a few things to GTK3. Taking care of deprecations right now.
    Preferences crashes when debug is set to full (due to assertions).
---
 .gitignore                      |  35 +++++++++++++
 AUTHORS                         |   1 +
 configure.ac.in                 |  27 +++-------
 src/appfinder-model.c           |  11 ++---
 src/appfinder-preferences.c     |   4 +-
 src/appfinder-preferences.glade |   6 +--
 src/appfinder-private.h         |  15 ++++++
 src/appfinder-window.c          | 107 ++++++++++++++++------------------------
 8 files changed, 111 insertions(+), 95 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..4f615a6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,35 @@
+/autom4te.cache
+/aclocal.m4
+/compile
+/configure
+/depcomp
+/install-sh
+/missing
+/stamp-h1
+
+config.guess
+config.h.in
+config.log
+config.status
+config.sub
+configure
+configure.ac
+depcomp
+INSTALL
+install-sh
+ltmain.sh
+Makefile
+Makefile.in
+missing
+po/.deps/
+po/Makefile.in.in
+src/.deps/
+
+intltool-extract.in
+intltool-merge.in
+intltool-update.in
+src/appfinder-preferences-ui.h
+src/xfce4-appfinder
+
+*.gmo
+*.o
diff --git a/AUTHORS b/AUTHORS
index e4fc2e7..2ef1434 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,3 +1,4 @@
 Jannis Pohlmann <jannis at xfce.org>
 Jasper Huijsmans <jasper at xfce.org>
 Nick Schermer <nick at xfce.org>
+Eduard Roccatello <eduard at xfce.org>
diff --git a/configure.ac.in b/configure.ac.in
index 8f2b0c6..c9d254b 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -21,7 +21,7 @@ m4_define([appfinder_debug_default], [ifelse(xfce4_appfinder_version_tag(), [git
 dnl ***************************
 dnl *** Initialize autoconf ***
 dnl ***************************
-AC_COPYRIGHT([Copyright (c) 2008-2011 The Xfce development team. All rights reserved.])
+AC_COPYRIGHT([Copyright (c) 2008-2015 The Xfce development team. All rights reserved.])
 AC_INIT([xfce4-appfinder], [xfce4_appfinder_version], [http://bugzilla.xfce.org/], [xfce4-appfinder])
 AC_REVISION([$Id$])
 AC_PREREQ([2.60])
@@ -78,21 +78,12 @@ XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.10.0])
 XDT_CHECK_PACKAGE([GARCON], [garcon-1], [0.3.0])
 XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.10.0])
 
-dnl ************************************
-dnl *** Compile against GTK3 or GTK2 ***
-dnl ************************************
-AC_ARG_ENABLE([gtk3],
-              [AC_HELP_STRING([--enable-gtk3],
-                              [Compile against GTK+-3.0 (default=disabled)])],
-              [enable_gtk3=$enableval], [enable_gtk3=no])
-if test "x$enable_gtk3" = "xyes"; then
-  XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.10.0])
-  XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.2.0])
-else
-  XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.10.0])
-  XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.24.0])
-fi
-AM_CONDITIONAL([ENABLE_GTK3], [test "x$enable_gtk3" = "xyes"])
+dnl ****************************
+dnl *** Compile against GTK3 ***
+dnl ****************************
+XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.10.0])
+XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.14.0])
+AM_CONDITIONAL([ENABLE_GTK3], 1)
 
 dnl ***********************************
 dnl *** Check for debugging support ***
@@ -130,11 +121,7 @@ dnl ***************************
 echo
 echo "Build Configuration:"
 echo
-if test x"$enable_gtk3" = x"yes"; then
 echo " * Toolkit:           GTK+-3"
-else
-echo " * Toolkit:           GTK+-2"
-fi
 echo " * Debugging Support: $enable_debug"
 echo
 
diff --git a/src/appfinder-model.c b/src/appfinder-model.c
index be9c9eb..efcffea 100644
--- a/src/appfinder-model.c
+++ b/src/appfinder-model.c
@@ -37,7 +37,6 @@
 #define BOOKMARKS_PATH "xfce4/appfinder/bookmarks"
 
 
-
 static void               xfce_appfinder_model_tree_model_init        (GtkTreeModelIface        *iface);
 static void               xfce_appfinder_model_get_property           (GObject                  *object,
                                                                        guint                     prop_id,
@@ -232,8 +231,8 @@ xfce_appfinder_model_init (XfceAppfinderModel *model)
   model->items_hash = g_hash_table_new (g_str_hash, g_str_equal);
   model->bookmarks_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
   model->icon_size = XFCE_APPFINDER_ICON_SIZE_DEFAULT_ITEM;
-  model->command_icon = xfce_appfinder_model_load_pixbuf (GTK_STOCK_EXECUTE, model->icon_size);
-  model->command_icon_large = xfce_appfinder_model_load_pixbuf (GTK_STOCK_EXECUTE, XFCE_APPFINDER_ICON_SIZE_48);
+  model->command_icon = xfce_appfinder_model_load_pixbuf (XFCE_APPFINDER_STOCK_EXECUTE, model->icon_size);
+  model->command_icon_large = xfce_appfinder_model_load_pixbuf (XFCE_APPFINDER_STOCK_EXECUTE, XFCE_APPFINDER_ICON_SIZE_48);
   model->command_category = xfce_appfinder_model_get_command_category ();
   model->collect_cancelled = g_cancellable_new ();
 
@@ -2344,11 +2343,11 @@ xfce_appfinder_model_icon_theme_changed (XfceAppfinderModel *model)
   /* reload the command icons */
   if (model->command_icon != NULL)
     g_object_unref (G_OBJECT (model->command_icon));
-  model->command_icon = xfce_appfinder_model_load_pixbuf (GTK_STOCK_EXECUTE, model->icon_size);
+  model->command_icon = xfce_appfinder_model_load_pixbuf (XFCE_APPFINDER_STOCK_EXECUTE, model->icon_size);
 
   if (model->command_icon_large != NULL)
     g_object_unref (G_OBJECT (model->command_icon_large));
-  model->command_icon_large = xfce_appfinder_model_load_pixbuf (GTK_STOCK_EXECUTE, XFCE_APPFINDER_ICON_SIZE_48);
+  model->command_icon_large = xfce_appfinder_model_load_pixbuf (XFCE_APPFINDER_STOCK_EXECUTE, XFCE_APPFINDER_ICON_SIZE_48);
 
   /* update the model items */
   for (li = model->items, idx = 0; li != NULL; li = li->next, idx++)
@@ -2519,7 +2518,7 @@ xfce_appfinder_model_get_command_category (void)
     {
       category = g_object_new (GARCON_TYPE_MENU_DIRECTORY,
                                "name", _("Commands History"),
-                               "icon-name", GTK_STOCK_EXECUTE,
+                               "icon-name", XFCE_APPFINDER_STOCK_EXECUTE,
                                NULL);
       appfinder_refcount_debug_add (G_OBJECT (category), "commands");
       g_object_add_weak_pointer (G_OBJECT (category), (gpointer) &category);
diff --git a/src/appfinder-preferences.c b/src/appfinder-preferences.c
index 147ee9c..e3cd0c6 100644
--- a/src/appfinder-preferences.c
+++ b/src/appfinder-preferences.c
@@ -216,7 +216,7 @@ xfce_appfinder_preferences_clear_history (XfceAppfinderPreferences *preferences)
 
   appfinder_return_if_fail (XFCE_IS_APPFINDER_PREFERENCES (preferences));
 
-  if (xfce_dialog_confirm (GTK_WINDOW (preferences->dialog), GTK_STOCK_CLEAR, _("C_lear"),
+  if (xfce_dialog_confirm (GTK_WINDOW (preferences->dialog), XFCE_APPFINDER_STOCK_CLEAR, _("C_lear"),
                            _("This will permanently clear the custom command history."),
                            _("Are you sure you want to clear the command history?")))
     {
@@ -327,7 +327,7 @@ xfce_appfinder_preferences_action_remove (GtkWidget                *button,
                       -1);
 
   if (xfce_dialog_confirm (GTK_WINDOW (gtk_widget_get_toplevel (button)),
-                           GTK_STOCK_DELETE, NULL,
+                           XFCE_APPFINDER_STOCK_DELETE, NULL,
                            _("The custom action will be deleted permanently."),
                            _("Are you sure you want to delete pattern \"%s\"?"),
                            pattern))
diff --git a/src/appfinder-preferences.glade b/src/appfinder-preferences.glade
index f1b6cc3..3f27320 100644
--- a/src/appfinder-preferences.glade
+++ b/src/appfinder-preferences.glade
@@ -57,7 +57,7 @@
   <object class="GtkImage" id="image3">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="stock">gtk-clear</property>
+    <property name="icon-name">edit-clear</property>
   </object>
   <object class="XfceTitledDialog" id="dialog">
     <property name="can_focus">False</property>
@@ -482,7 +482,7 @@
                                   <object class="GtkImage" id="image1">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="stock">gtk-add</property>
+                                    <property name="icon-name">list-add</property>
                                   </object>
                                 </child>
                               </object>
@@ -503,7 +503,7 @@
                                   <object class="GtkImage" id="image2">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="stock">gtk-delete</property>
+                                    <property name="icon-name">edit-delete</property>
                                   </object>
                                 </child>
                               </object>
diff --git a/src/appfinder-private.h b/src/appfinder-private.h
index 0e98d68..a39a132 100644
--- a/src/appfinder-private.h
+++ b/src/appfinder-private.h
@@ -52,6 +52,21 @@ void    appfinder_refcount_debug_add (GObject     *object,
 #define appfinder_return_val_if_fail(expr,val) G_STMT_START{ (void)0; }G_STMT_END
 #endif
 
+#define XFCE_APPFINDER_STOCK_CLEAR "edit-clear"
+#define XFCE_APPFINDER_STOCK_CLOSE "window-close"
+#define XFCE_APPFINDER_STOCK_DELETE "edit-delete"
+#define XFCE_APPFINDER_STOCK_DIALOG_ERROR "dialog-error"
+#define XFCE_APPFINDER_STOCK_EDIT "gtk-edit"
+#define XFCE_APPFINDER_STOCK_EXECUTE "system-run"
+#define XFCE_APPFINDER_STOCK_FIND "edit-find"
+#define XFCE_APPFINDER_STOCK_GO_DOWN "go-down"
+#define XFCE_APPFINDER_STOCK_GO_UP "go-up"
+#define XFCE_APPFINDER_STOCK_PREFERENCES "preferences-system"
+#define XFCE_APPFINDER_STOCK_REVERT_TO_SAVED "document-revert"
+#define XFCE_APPFINDER_STOCK_REMOVE "list-remove"
+
+
+
 void appfinder_window_new (const gchar *startup_id,
                            gboolean     expanded);
 
diff --git a/src/appfinder-window.c b/src/appfinder-window.c
index 11c10d2..4a55f10 100644
--- a/src/appfinder-window.c
+++ b/src/appfinder-window.c
@@ -53,6 +53,7 @@
 #define DEFAULT_WINDOW_HEIGHT  400
 #define DEFAULT_PANED_POSITION 180
 
+#define XFCE_APPFINDER_LOCAL_PREFIX "file://"
 
 
 static void       xfce_appfinder_window_finalize                      (GObject                     *object);
@@ -197,7 +198,6 @@ xfce_appfinder_window_init (XfceAppfinderWindow *window)
   GtkWidget          *sidepane;
   GtkWidget          *image;
   GtkWidget          *hbox;
-  GtkWidget          *align;
   GtkTreeViewColumn  *column;
   GtkCellRenderer    *renderer;
   GtkTreeSelection   *selection;
@@ -220,59 +220,39 @@ xfce_appfinder_window_init (XfceAppfinderWindow *window)
   gtk_window_set_title (GTK_WINDOW (window), _("Application Finder"));
   integer = xfconf_channel_get_int (window->channel, "/last/window-width", DEFAULT_WINDOW_WIDTH);
   gtk_window_set_default_size (GTK_WINDOW (window), integer, -1);
-  gtk_window_set_icon_name (GTK_WINDOW (window), GTK_STOCK_EXECUTE);
-#if GTK_CHECK_VERSION (3, 0, 0)
-  gtk_window_set_has_resize_grip (GTK_WINDOW (window), FALSE);
-#endif
+  gtk_window_set_icon_name (GTK_WINDOW (window), XFCE_APPFINDER_STOCK_EXECUTE);
 
-  if (xfconf_channel_get_bool (window->channel, "/always-center", FALSE))
+  if (xfconf_channel_get_bool (window->channel, "/always-center", FALSE)) {
     gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
+  }
 
-#if GTK_CHECK_VERSION (3, 0, 0)
   vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
-  vbox = gtk_vbox_new (FALSE, 6);
-#endif
   gtk_container_add (GTK_CONTAINER (window), vbox);
   gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
   gtk_widget_show (vbox);
 
-#if GTK_CHECK_VERSION (3, 0, 0)
   hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-#else
-  hbox = gtk_hbox_new (FALSE, 6);
-#endif
   gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
   gtk_widget_show (hbox);
 
-  align = gtk_alignment_new (0.5, 0.0, 0.0, 0.0);
-  gtk_box_pack_start (GTK_BOX (hbox), align, FALSE, FALSE, 0);
-  gtk_widget_show (align);
-
-  window->icon_find = xfce_appfinder_model_load_pixbuf (GTK_STOCK_FIND, XFCE_APPFINDER_ICON_SIZE_48);
+  window->icon_find = xfce_appfinder_model_load_pixbuf (XFCE_APPFINDER_STOCK_FIND, XFCE_APPFINDER_ICON_SIZE_48);
   window->image = image = gtk_image_new_from_pixbuf (window->icon_find);
   gtk_widget_set_size_request (image, 48, 48);
-  gtk_container_add (GTK_CONTAINER (align), image);
+  gtk_widget_set_halign(image, GTK_ALIGN_CENTER);
+  gtk_container_add (GTK_CONTAINER (hbox), image);
   gtk_widget_show (image);
 
-#if GTK_CHECK_VERSION (3, 0, 0)
   vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
-#else
-  vbox2 = gtk_vbox_new (FALSE, 6);
-#endif
   gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
   gtk_widget_show (vbox2);
-
-  align = gtk_alignment_new (0.0, 0.0, 1.0, 0.0);
-  gtk_box_pack_start (GTK_BOX (vbox2), align, TRUE, TRUE, 0);
-  gtk_widget_show (align);
-
+  
   window->entry = entry = gtk_entry_new ();
-  gtk_container_add (GTK_CONTAINER (align), entry);
+  gtk_widget_set_halign(entry, GTK_ALIGN_FILL);
+  gtk_container_add (GTK_CONTAINER (vbox2), entry);
   g_signal_connect (G_OBJECT (entry), "icon-release",
       G_CALLBACK (xfce_appfinder_window_entry_icon_released), window);
   g_signal_connect (G_OBJECT (entry), "realize",
-      G_CALLBACK (xfce_appfinder_window_set_padding), align);
+      G_CALLBACK (xfce_appfinder_window_set_padding), entry);
   g_signal_connect_swapped (G_OBJECT (entry), "changed",
       G_CALLBACK (xfce_appfinder_window_entry_changed), window);
   g_signal_connect (G_OBJECT (entry), "activate",
@@ -281,7 +261,7 @@ xfce_appfinder_window_init (XfceAppfinderWindow *window)
       G_CALLBACK (xfce_appfinder_window_entry_key_press_event), window);
   gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
                                      GTK_ENTRY_ICON_SECONDARY,
-                                     GTK_STOCK_GO_DOWN);
+                                     XFCE_APPFINDER_STOCK_GO_DOWN);
   gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
                                    GTK_ENTRY_ICON_SECONDARY,
                                    _("Toggle view mode"));
@@ -299,11 +279,8 @@ xfce_appfinder_window_init (XfceAppfinderWindow *window)
   gtk_box_pack_start (GTK_BOX (vbox2), window->bin_collapsed, FALSE, TRUE, 0);
   gtk_widget_show (window->bin_collapsed);
 
-#if GTK_CHECK_VERSION (3, 0, 0)
+
   window->paned = pane = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
-#else
-  window->paned = pane = gtk_hpaned_new ();
-#endif
   gtk_box_pack_start (GTK_BOX (vbox), pane, TRUE, TRUE, 0);
   integer = xfconf_channel_get_int (window->channel, "/last/pane-position", DEFAULT_PANED_POSITION);
   gtk_paned_set_position (GTK_PANED (pane), integer);
@@ -360,30 +337,22 @@ xfce_appfinder_window_init (XfceAppfinderWindow *window)
   gtk_box_pack_start (GTK_BOX (vbox), window->bin_expanded, FALSE, TRUE, 0);
   gtk_widget_show (window->bin_expanded);
 
-#if GTK_CHECK_VERSION (3, 0, 0)
   window->bbox = hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-#else
-  window->bbox = hbox = gtk_hbox_new (FALSE, 6);
-#endif
   gtk_widget_show (hbox);
 
-  window->button_preferences = button = gtk_button_new_from_stock (GTK_STOCK_PREFERENCES);
+  window->button_preferences = button = gtk_button_new_with_label (XFCE_APPFINDER_STOCK_PREFERENCES);
   gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
   g_signal_connect (G_OBJECT (button), "clicked",
       G_CALLBACK (xfce_appfinder_window_preferences), window);
 
-#if GTK_CHECK_VERSION (3, 0, 0)
   bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
   gtk_box_set_spacing (GTK_BOX (bbox), 6);
-#else
-  bbox = gtk_hbutton_box_new ();
-  gtk_button_box_set_spacing (GTK_BUTTON_BOX (bbox), 6);
-#endif
+
   gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_END);
   gtk_box_pack_start (GTK_BOX (hbox), bbox, TRUE, TRUE, 0);
   gtk_widget_show (bbox);
 
-  button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
+  button = gtk_button_new_with_label (XFCE_APPFINDER_STOCK_CLOSE);
   gtk_container_add (GTK_CONTAINER (bbox), button);
   g_signal_connect_swapped (G_OBJECT (button), "clicked",
       G_CALLBACK (gtk_widget_destroy), window);
@@ -394,9 +363,10 @@ xfce_appfinder_window_init (XfceAppfinderWindow *window)
   g_signal_connect_swapped (G_OBJECT (button), "clicked",
       G_CALLBACK (xfce_appfinder_window_launch_clicked), window);
   gtk_widget_set_sensitive (button, FALSE);
+  gtk_button_set_always_show_image(GTK_BUTTON(button), TRUE);
   gtk_widget_show (button);
 
-  image = gtk_image_new_from_stock (GTK_STOCK_EXECUTE, GTK_ICON_SIZE_BUTTON);
+  image = gtk_image_new_from_icon_name (XFCE_APPFINDER_STOCK_EXECUTE, GTK_ICON_SIZE_BUTTON);
   gtk_button_set_image (GTK_BUTTON (button), image);
 
   window->icon_theme = gtk_icon_theme_get_for_screen (gtk_window_get_screen (GTK_WINDOW (window)));
@@ -900,7 +870,7 @@ xfce_appfinder_window_popup_menu_revert (GtkWidget           *mi,
   if (name == NULL)
     return;
 
-  if (xfce_dialog_confirm (GTK_WINDOW (window), GTK_STOCK_REVERT_TO_SAVED, NULL,
+  if (xfce_dialog_confirm (GTK_WINDOW (window), XFCE_APPFINDER_STOCK_REVERT_TO_SAVED, NULL,
           _("This will permanently remove the custom desktop file from your home directory."),
           _("Are you sure you want to revert \"%s\"?"), name))
     {
@@ -995,6 +965,8 @@ xfce_appfinder_window_popup_menu (GtkWidget           *view,
   gchar        *uri;
   GtkWidget    *mi;
   GtkWidget    *image;
+  GtkWidget    *box;
+  GtkWidget    *label;
   gchar        *path;
   gboolean      uri_is_local;
   gboolean      is_bookmark;
@@ -1014,7 +986,7 @@ xfce_appfinder_window_popup_menu (GtkWidget           *view,
           return FALSE;
         }
 
-      uri_is_local = g_str_has_prefix (uri, "file://");
+      uri_is_local = g_str_has_prefix (uri, XFCE_APPFINDER_LOCAL_PREFIX);
 
       menu = gtk_menu_new ();
       g_object_set_data_full (G_OBJECT (menu), "uri", uri, g_free);
@@ -1032,35 +1004,41 @@ xfce_appfinder_window_popup_menu (GtkWidget           *view,
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
       gtk_widget_show (mi);
 
-      mi = gtk_image_menu_item_new_with_mnemonic (is_bookmark ? _("Remove From Bookmarks") : _("Add to Bookmarks"));
+      mi = gtk_menu_item_new ();
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
       g_signal_connect (G_OBJECT (mi), "activate",
           G_CALLBACK (xfce_appfinder_window_popup_menu_toggle_bookmark), window);
-      gtk_widget_show (mi);
 
       if (is_bookmark)
-        image = gtk_image_new_from_stock (GTK_STOCK_REMOVE, GTK_ICON_SIZE_MENU);
+        image = gtk_image_new_from_icon_name (XFCE_APPFINDER_STOCK_REMOVE, GTK_ICON_SIZE_MENU);
       else
         image = gtk_image_new_from_icon_name ("bookmark-new", GTK_ICON_SIZE_MENU);
-      gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), image);
+
+      box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+      label = gtk_label_new (is_bookmark ? _("Remove From Bookmarks") : _("Add to Bookmarks"));
+      gtk_container_add (GTK_CONTAINER (box), image);
+      gtk_container_add (GTK_CONTAINER (box), label);
+
+      gtk_container_add (GTK_CONTAINER (mi), box);
+      gtk_widget_show_all (mi);
 
       mi = gtk_separator_menu_item_new ();
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
       gtk_widget_show (mi);
 
-      mi = gtk_image_menu_item_new_from_stock (GTK_STOCK_EXECUTE, NULL);
+      mi = gtk_menu_item_new_with_mnemonic (XFCE_APPFINDER_STOCK_EXECUTE);
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
       g_signal_connect (G_OBJECT (mi), "activate",
           G_CALLBACK (xfce_appfinder_window_popup_menu_execute), window);
       gtk_widget_show (mi);
 
-      mi = gtk_image_menu_item_new_from_stock (GTK_STOCK_EDIT, NULL);
+      mi = gtk_menu_item_new_with_mnemonic (XFCE_APPFINDER_STOCK_EDIT);
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
       g_signal_connect (G_OBJECT (mi), "activate",
           G_CALLBACK (xfce_appfinder_window_popup_menu_edit), window);
       gtk_widget_show (mi);
 
-      mi = gtk_image_menu_item_new_from_stock (GTK_STOCK_REVERT_TO_SAVED, NULL);
+      mi = gtk_menu_item_new_with_mnemonic (XFCE_APPFINDER_STOCK_REVERT_TO_SAVED);
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
       g_signal_connect (G_OBJECT (mi), "activate",
           G_CALLBACK (xfce_appfinder_window_popup_menu_revert), window);
@@ -1069,7 +1047,7 @@ xfce_appfinder_window_popup_menu (GtkWidget           *view,
       gtk_widget_show (mi);
       g_free (path);
 
-      mi = gtk_image_menu_item_new_with_mnemonic (_("_Hide"));
+      mi = gtk_menu_item_new_with_mnemonic (_("_Hide"));
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
       gtk_widget_set_sensitive (mi, uri_is_local);
       g_signal_connect (G_OBJECT (mi), "activate",
@@ -1112,7 +1090,8 @@ xfce_appfinder_window_set_padding (GtkWidget *entry,
   /* 48 is the icon size of XFCE_APPFINDER_ICON_SIZE_48 */
   gtk_widget_get_allocation (entry, &alloc);
   padding = (48 - alloc.height) / 2;
-  gtk_alignment_set_padding (GTK_ALIGNMENT (align), MAX (0, padding), 0, 0, 0);
+  // gtk_alignment_set_padding (GTK_ALIGNMENT (align), MAX (0, padding), 0, 0, 0);
+  gtk_widget_set_margin_top (align, MAX (0, padding));
 }
 
 
@@ -1348,7 +1327,7 @@ xfce_appfinder_window_drag_begin (GtkWidget           *widget,
     }
   else
     {
-      gtk_drag_set_icon_stock (drag_context, GTK_STOCK_DIALOG_ERROR, 0, 0);
+      gtk_drag_set_icon_name (drag_context, XFCE_APPFINDER_STOCK_DIALOG_ERROR, 0, 0);
     }
 }
 
@@ -1610,7 +1589,7 @@ xfce_appfinder_window_icon_theme_changed (XfceAppfinderWindow *window)
 
   if (window->icon_find != NULL)
     g_object_unref (G_OBJECT (window->icon_find));
-  window->icon_find = xfce_appfinder_model_load_pixbuf (GTK_STOCK_FIND, XFCE_APPFINDER_ICON_SIZE_48);
+  window->icon_find = xfce_appfinder_model_load_pixbuf (XFCE_APPFINDER_STOCK_FIND, XFCE_APPFINDER_ICON_SIZE_48);
 
   /* drop cached pixbufs */
   if (G_LIKELY (window->model != NULL))
@@ -1740,8 +1719,8 @@ xfce_appfinder_window_execute (XfceAppfinderWindow *window,
 
   if (!only_custom_cmd)
     {
-      gtk_entry_set_icon_from_stock (GTK_ENTRY (window->entry), GTK_ENTRY_ICON_PRIMARY,
-                                     result ? NULL : GTK_STOCK_DIALOG_ERROR);
+      gtk_entry_set_icon_from_icon_name (GTK_ENTRY (window->entry), GTK_ENTRY_ICON_PRIMARY,
+                                     result ? NULL : XFCE_APPFINDER_STOCK_DIALOG_ERROR);
       gtk_entry_set_icon_tooltip_text (GTK_ENTRY (window->entry), GTK_ENTRY_ICON_PRIMARY,
                                        error != NULL ? error->message : NULL);
     }
@@ -1805,7 +1784,7 @@ xfce_appfinder_window_set_expanded (XfceAppfinderWindow *window,
 
   /* toggle icon */
   gtk_entry_set_icon_from_icon_name (GTK_ENTRY (window->entry), GTK_ENTRY_ICON_SECONDARY,
-                                     expanded ? GTK_STOCK_GO_UP : GTK_STOCK_GO_DOWN);
+                                     expanded ? XFCE_APPFINDER_STOCK_GO_UP : XFCE_APPFINDER_STOCK_GO_DOWN);
   gtk_entry_set_icon_from_icon_name (GTK_ENTRY (window->entry), GTK_ENTRY_ICON_PRIMARY, NULL);
 
   /* update completion (remove completed text of restart completion) */

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


More information about the Xfce4-commits mailing list