[balsa/wip/gtk4: 67/351] Gtk icon and drag-and-drop updates



commit 23a863de9f19468d9c6362a8b01d0b7f19277b68
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Thu Nov 16 18:05:53 2017 -0500

    Gtk icon and drag-and-drop updates
    
    The GtkIconSize enum has changed drastically, and the whole icon sizing
    API with it.
    
    Drag sources and destinations are now specified by a GtkTargetList
    instead of an array of GtkTargetEntry.

 libbalsa/address.c                |   19 ++++++++++++-------
 libbalsa/files.c                  |   11 +++--------
 libbalsa/files.h                  |    2 +-
 libbalsa/libbalsa-gpgme-widgets.c |    4 ++--
 libbalsa/source-viewer.c          |    2 +-
 src/ab-main.c                     |   10 +++++++---
 src/ab-window.c                   |    6 ++----
 src/balsa-icons.c                 |    3 +--
 src/balsa-index.c                 |    9 ++++++---
 src/balsa-mblist.c                |    9 +++++++--
 src/balsa-message.c               |   23 +++++++----------------
 src/balsa-mime-widget-crypto.c    |    5 ++---
 src/balsa-mime-widget-image.c     |    3 +--
 src/balsa-print-object-default.c  |    4 +---
 src/balsa-print-object-text.c     |    6 ++----
 src/filter-run-dialog.c           |   12 ++++--------
 src/main-window.c                 |   13 ++++++++-----
 src/sendmsg-window.c              |   36 +++++++++++++++++++++---------------
 src/toolbar-factory.c             |    4 ++--
 src/toolbar-prefs.c               |   18 +++++-------------
 20 files changed, 95 insertions(+), 104 deletions(-)
---
diff --git a/libbalsa/address.c b/libbalsa/address.c
index 17ba386..b85220a 100644
--- a/libbalsa/address.c
+++ b/libbalsa/address.c
@@ -861,7 +861,7 @@ add_row(GtkWidget*button, gpointer data)
     gtk_tree_path_free(path);
 }
 
-GtkTargetEntry libbalsa_address_target_list[2] = {
+GtkTargetEntry libbalsa_address_target_list[] = {
     {"text/plain",           0, LIBBALSA_ADDRESS_TRG_STRING },
     {"x-application/x-addr", GTK_TARGET_SAME_APP,LIBBALSA_ADDRESS_TRG_ADDRESS}
 };
@@ -974,6 +974,8 @@ libbalsa_address_get_edit_widget(const LibBalsaAddress *address,
         if (cnt == EMAIL_ADDRESS) {
             GtkWidget *box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 1);
             GtkWidget *but = gtk_button_new_with_mnemonic(_("A_dd"));
+            GtkTargetList *list;
+
             entries[cnt] = lba_address_list_widget(changed_cb,
                                                    changed_data);
             gtk_box_pack_start(GTK_BOX(box), label);
@@ -981,12 +983,15 @@ libbalsa_address_get_edit_widget(const LibBalsaAddress *address,
             lhs = box;
             g_signal_connect(but, "clicked", G_CALLBACK(add_row),
                              entries[cnt]);
-             gtk_drag_dest_set(entries[cnt],
-                               GTK_DEST_DEFAULT_MOTION |
-                               GTK_DEST_DEFAULT_HIGHLIGHT,
-                               libbalsa_address_target_list,
-                               2,              /* size of list */
-                               GDK_ACTION_COPY);
+
+            list = gtk_target_list_new(libbalsa_address_target_list,
+                                       G_N_ELEMENTS(libbalsa_address_target_list));
+            gtk_drag_dest_set(entries[cnt],
+                              GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT,
+                              list,
+                              GDK_ACTION_COPY);
+            gtk_target_list_unref(list);
+
             g_signal_connect(G_OBJECT(entries[cnt]), "drag-data-received",
                              G_CALLBACK(addrlist_drag_received_cb), NULL);
             g_signal_connect (G_OBJECT(entries[cnt]), "drag-drop",
diff --git a/libbalsa/files.c b/libbalsa/files.c
index afc7f1a..88715d7 100644
--- a/libbalsa/files.c
+++ b/libbalsa/files.c
@@ -105,17 +105,13 @@ libbalsa_icon_finder(GtkWidget         * widget,
                      const char        * mime_type,
                      const LibbalsaVfs * for_file,
                      gchar            ** used_type,
-                     GtkIconSize         size)
+                     gint                width)
 {
     const gchar *content_type;
     GdkPixbuf *pixbuf = NULL;
-    gint width, height;
     GtkIconTheme *icon_theme;
     GIcon *icon;
 
-    if (!gtk_icon_size_lookup(size, &width, &height))
-        width = 16;
-
     if (mime_type)
         content_type = mime_type;
     else if (for_file) {
@@ -132,9 +128,9 @@ libbalsa_icon_finder(GtkWidget         * widget,
     if (icon != NULL) {
         if (G_IS_THEMED_ICON(icon)) {
             gint i;
-            GStrv icon_names;
+            const gchar * const *icon_names;
 
-            g_object_get(G_OBJECT(icon), "names", &icon_names, NULL);
+            icon_names = g_themed_icon_get_names((GThemedIcon *) icon);
 
             if (icon_names != NULL) {
                 for (i = 0; pixbuf == NULL && icon_names[i] != NULL; i++) {
@@ -142,7 +138,6 @@ libbalsa_icon_finder(GtkWidget         * widget,
                         gtk_icon_theme_load_icon(icon_theme, icon_names[i], width,
                                                  GTK_ICON_LOOKUP_FORCE_SIZE, NULL);
                 }
-                g_strfreev(icon_names);
             }
         }
         g_object_unref(icon);
diff --git a/libbalsa/files.h b/libbalsa/files.h
index 48e9b27..dc93135 100644
--- a/libbalsa/files.h
+++ b/libbalsa/files.h
@@ -43,6 +43,6 @@ GdkPixbuf *libbalsa_icon_finder(GtkWidget         * widget,
                                 const char        * mime_type,
                                 const LibbalsaVfs * for_file,
                                 gchar            ** used_type,
-                                GtkIconSize         size);
+                                gint                width);
 
 #endif
diff --git a/libbalsa/libbalsa-gpgme-widgets.c b/libbalsa/libbalsa-gpgme-widgets.c
index 56ec8ab..a1bf4a9 100644
--- a/libbalsa/libbalsa-gpgme-widgets.c
+++ b/libbalsa/libbalsa-gpgme-widgets.c
@@ -234,7 +234,7 @@ libbalsa_key_dialog(GtkWindow            *parent,
        gtk_box_set_homogeneous(GTK_BOX(hbox), FALSE);
 
        /* standard key icon; "application-certificate" would be an alternative... */
-       icon = gtk_image_new_from_icon_name("dialog-password", GTK_ICON_SIZE_DIALOG);
+       icon = gtk_image_new_from_icon_name("dialog-password");
        gtk_box_pack_start(GTK_BOX(hbox), icon);
        gtk_widget_set_valign(icon, GTK_ALIGN_START);
 
@@ -401,7 +401,7 @@ create_key_label_with_warn(const gchar *text,
                gchar *buf;
 
                result = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
-               icon = gtk_image_new_from_icon_name("gtk-dialog-warning", GTK_ICON_SIZE_MENU);
+               icon = gtk_image_new_from_icon_name("gtk-dialog-warning");
                gtk_box_pack_start(GTK_BOX(result), icon);
                buf = g_markup_printf_escaped("<span fgcolor=\"red\">%s</span>", text);
                label = gtk_label_new(NULL);
diff --git a/libbalsa/source-viewer.c b/libbalsa/source-viewer.c
index 35727dd..9d2f98a 100644
--- a/libbalsa/source-viewer.c
+++ b/libbalsa/source-viewer.c
@@ -64,7 +64,7 @@ lsv_copy_activated(GSimpleAction * action,
     GtkClipboard *clipboard;
 
     display = gtk_widget_get_display(GTK_WIDGET(text));
-    clipboard = gtk_clipboard_get_for_display(display, GDK_NONE);
+    clipboard = gtk_clipboard_get_for_display(display, GDK_SELECTION_CLIPBOARD);
 
     gtk_text_buffer_copy_clipboard(buffer, clipboard);
 }
diff --git a/src/ab-main.c b/src/ab-main.c
index 0d864e5..5f6bc1c 100644
--- a/src/ab-main.c
+++ b/src/ab-main.c
@@ -715,6 +715,7 @@ bab_window_list_new(void)
     GtkCellRenderer *renderer;
     GtkTreeViewColumn *column;
     GtkTreeSelection *selection;
+    GtkTargetList *list;
 
     store =
         gtk_list_store_new(N_COLUMNS,
@@ -747,10 +748,14 @@ bab_window_list_new(void)
     gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
 
 
+    list = gtk_target_list_new(libbalsa_address_target_list,
+                               G_N_ELEMENTS(libbalsa_address_target_list));
     gtk_drag_source_set(GTK_WIDGET(tree),
                         GDK_BUTTON1_MASK,
-                        libbalsa_address_target_list, 2,
+                        list,
                         GDK_ACTION_COPY);
+    gtk_target_list_unref(list);
+
     g_signal_connect(G_OBJECT(tree), "drag-data-get",
                      G_CALLBACK(addrlist_drag_get_cb), NULL);
 
@@ -893,8 +898,7 @@ bab_get_filter_box(void)
     gtk_label_set_mnemonic_widget(GTK_LABEL(find_label), find_entry);
     button = gtk_button_new();
     gtk_container_add(GTK_CONTAINER(button),
-                      gtk_image_new_from_icon_name("gtk-ok",
-                                                   GTK_ICON_SIZE_BUTTON));
+                      gtk_image_new_from_icon_name("gtk-ok"));
     gtk_box_pack_start(GTK_BOX(search_hbox), button);
 
     g_signal_connect(G_OBJECT(find_entry), "activate",
diff --git a/src/ab-window.c b/src/ab-window.c
index 2b70a82..9ae4cbd 100644
--- a/src/ab-window.c
+++ b/src/ab-window.c
@@ -348,8 +348,7 @@ balsa_ab_window_init(BalsaAbWindow *ab)
     gtk_grid_attach(GTK_GRID(grid), ab->arrow_box, 1, 1, 1, 1);
     gtk_widget_show(ab->arrow_box);
 
-    w = gtk_button_new_from_icon_name("go-next-symbolic",
-                                      GTK_ICON_SIZE_BUTTON);
+    w = gtk_button_new_from_icon_name("go-next-symbolic");
     gtk_widget_set_hexpand(w, TRUE);
     gtk_box_pack_start(GTK_BOX(ab->arrow_box), w);
     gtk_widget_show(w);
@@ -357,8 +356,7 @@ balsa_ab_window_init(BalsaAbWindow *ab)
                     G_CALLBACK(balsa_ab_window_move_to_recipient_list),
                       ab);
 
-    w = gtk_button_new_from_icon_name("go-previous-symbolic",
-                                      GTK_ICON_SIZE_BUTTON);
+    w = gtk_button_new_from_icon_name("go-previous-symbolic");
     gtk_widget_set_hexpand(w, TRUE);
     gtk_box_pack_start(GTK_BOX(ab->arrow_box), w);
     gtk_widget_show(w);
diff --git a/src/balsa-icons.c b/src/balsa-icons.c
index da679e8..4dbeab1 100644
--- a/src/balsa-icons.c
+++ b/src/balsa-icons.c
@@ -226,10 +226,9 @@ balsa_register_pixbufs(GtkWidget * widget)
     for (i = 0; i < G_N_ELEMENTS(icons); i++) {
         GdkPixbuf *pixbuf;
         GError *err = NULL;
-        gint width, height;
+        gint width = 16;
         const gchar *use_id = balsa_icon_id(icons[i].icon);
 
-        gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height);
         pixbuf =
             gtk_icon_theme_load_icon(icon_theme, use_id, width,
                                      GTK_ICON_LOOKUP_USE_BUILTIN, &err);
diff --git a/src/balsa-index.c b/src/balsa-index.c
index 5ee3ea6..816a3d2 100644
--- a/src/balsa-index.c
+++ b/src/balsa-index.c
@@ -298,6 +298,7 @@ bndx_instance_init(BalsaIndex * index)
     GtkTreeSelection *selection = gtk_tree_view_get_selection(tree_view);
     GtkCellRenderer *renderer;
     GtkTreeViewColumn *column;
+    GtkTargetList *list;
 
 #if defined(TREE_VIEW_FIXED_HEIGHT)
     gtk_tree_view_set_fixed_height_mode(tree_view, TRUE);
@@ -447,11 +448,14 @@ bndx_instance_init(BalsaIndex * index)
                            NULL);
     gtk_tree_view_set_enable_search(tree_view, FALSE);
 
+    list = gtk_target_list_new(index_drag_types, G_N_ELEMENTS(index_drag_types));
     gtk_drag_source_set(GTK_WIDGET (index),
                         GDK_BUTTON1_MASK | GDK_SHIFT_MASK | GDK_CONTROL_MASK,
-                        index_drag_types, G_N_ELEMENTS(index_drag_types),
+                        list,
                         GDK_ACTION_DEFAULT | GDK_ACTION_COPY |
                         GDK_ACTION_MOVE);
+    gtk_target_list_unref(list);
+
     g_signal_connect(index, "drag-data-get",
                      G_CALLBACK(bndx_drag_cb), NULL);
 
@@ -1304,7 +1308,7 @@ void
 balsa_index_set_column_widths(BalsaIndex * index)
 {
     GtkTreeView *tree_view = GTK_TREE_VIEW(index);
-    gint icon_w;
+    gint icon_w = 16;
 
 #if defined(TREE_VIEW_FIXED_HEIGHT)
     /* so that fixed width works properly */
@@ -1314,7 +1318,6 @@ balsa_index_set_column_widths(BalsaIndex * index)
 #endif
     /* I have no idea why we must add 5 pixels to the icon width - otherwise,
        the icon will be clipped... */
-    gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &icon_w, NULL);
     gtk_tree_view_column_set_fixed_width(gtk_tree_view_get_column
                                          (tree_view, LB_MBOX_MARKED_COL),
                                          icon_w + 5);
diff --git a/src/balsa-mblist.c b/src/balsa-mblist.c
index 33279d7..2922565 100644
--- a/src/balsa-mblist.c
+++ b/src/balsa-mblist.c
@@ -1162,16 +1162,21 @@ balsa_mblist_close_lru_peer_mbx(BalsaMBList * mblist,
 void
 balsa_mblist_default_signal_bindings(BalsaMBList * mblist)
 {
+    GtkTargetList *list;
+
     g_signal_connect(G_OBJECT(mblist), "button_press_event",
                      G_CALLBACK(bmbl_button_press_cb), NULL);
     g_signal_connect_after(G_OBJECT(mblist), "size-allocate",
                            G_CALLBACK(bmbl_column_resize), NULL);
+
+    list = gtk_target_list_new(bmbl_drop_types, G_N_ELEMENTS(bmbl_drop_types));
     gtk_tree_view_enable_model_drag_dest(GTK_TREE_VIEW(mblist),
-                                         bmbl_drop_types,
-                                         G_N_ELEMENTS(bmbl_drop_types),
+                                         list,
                                          GDK_ACTION_DEFAULT |
                                          GDK_ACTION_COPY |
                                          GDK_ACTION_MOVE);
+    gtk_target_list_unref(list);
+
     g_signal_connect(G_OBJECT(mblist), "drag-data-received",
                      G_CALLBACK(bmbl_drag_cb), NULL);
 
diff --git a/src/balsa-message.c b/src/balsa-message.c
index ab7316c..8ecbc73 100644
--- a/src/balsa-message.c
+++ b/src/balsa-message.c
@@ -271,9 +271,7 @@ bm_header_tl_buttons(BalsaMessage * bm)
     array = g_ptr_array_new();
 
 #ifdef HAVE_GPGME
-    button =
-        gtk_button_new_from_icon_name(balsa_icon_id(BALSA_PIXMAP_GPG_RECHECK),
-                                      GTK_ICON_SIZE_BUTTON);
+    button = gtk_button_new_from_icon_name(balsa_icon_id(BALSA_PIXMAP_GPG_RECHECK));
     gtk_widget_set_tooltip_text(button,
                                _("Check cryptographic signature"));
     g_signal_connect(G_OBJECT(button), "focus_in_event",
@@ -288,9 +286,7 @@ bm_header_tl_buttons(BalsaMessage * bm)
     g_ptr_array_add(array, button);
 #endif
 
-    button =
-        gtk_button_new_from_icon_name(balsa_icon_id(BALSA_PIXMAP_ATTACHMENT),
-                                      GTK_ICON_SIZE_BUTTON);
+    button = gtk_button_new_from_icon_name(balsa_icon_id(BALSA_PIXMAP_ATTACHMENT));
     gtk_widget_set_tooltip_text(button,
                                _("Select message part to display"));
     g_signal_connect(G_OBJECT(button), "focus_in_event",
@@ -592,14 +588,14 @@ bm_find_bar_new(BalsaMessage * bm)
     gtk_container_add(GTK_CONTAINER(tool_item), hbox);
     gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
 
-    image = gtk_image_new_from_icon_name("pan-up-symbolic", GTK_ICON_SIZE_BUTTON);
+    image = gtk_image_new_from_icon_name("pan-up-symbolic");
     tool_item = gtk_tool_button_new(image, _("Previous"));
     bm->find_prev = GTK_WIDGET(tool_item);
     gtk_tool_item_set_is_important(tool_item, TRUE);
     g_signal_connect(tool_item, "clicked", G_CALLBACK(bm_find_prev_cb), bm);
     gtk_toolbar_insert(GTK_TOOLBAR(toolbar), tool_item, -1);
 
-    image = gtk_image_new_from_icon_name("pan-down-symbolic", GTK_ICON_SIZE_BUTTON);
+    image = gtk_image_new_from_icon_name("pan-down-symbolic");
     tool_item = gtk_tool_button_new(image, _("Next"));
     bm->find_next = GTK_WIDGET(tool_item);
     gtk_tool_item_set_is_important(tool_item, TRUE);
@@ -1454,9 +1450,7 @@ display_part(BalsaMessage * bm, LibBalsaMessageBody * body,
 #endif
         if (!content_icon)
            content_icon =
-               libbalsa_icon_finder(GTK_WIDGET(bm),
-                                     content_type, NULL, NULL,
-                                    GTK_ICON_SIZE_LARGE_TOOLBAR);
+               libbalsa_icon_finder(GTK_WIDGET(bm), content_type, NULL, NULL, 24);
         gtk_tree_store_set (GTK_TREE_STORE(model), iter,
                             PART_INFO_COLUMN, info,
                            PART_NUM_COLUMN, part_id,
@@ -1467,9 +1461,7 @@ display_part(BalsaMessage * bm, LibBalsaMessageBody * body,
         g_free(icon_title);
     } else {
        content_icon =
-           libbalsa_icon_finder(GTK_WIDGET(bm),
-                                 content_type, NULL, NULL,
-                                GTK_ICON_SIZE_LARGE_TOOLBAR);
+           libbalsa_icon_finder(GTK_WIDGET(bm), content_type, NULL, NULL, 24);
         gtk_tree_store_set (GTK_TREE_STORE(model), iter,
                             PART_INFO_COLUMN, NULL,
                            PART_NUM_COLUMN, part_id,
@@ -2687,8 +2679,7 @@ get_crypto_content_icon(LibBalsaMessageBody * body, const gchar * content_type,
     if (!icon_name)
         return NULL;
     icon =
-        gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), icon_name,
-                                 GTK_ICON_SIZE_LARGE_TOOLBAR, 0, NULL);
+        gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), icon_name, 24, 0, NULL);
     if (!icon_title)
         return icon;
 
diff --git a/src/balsa-mime-widget-crypto.c b/src/balsa-mime-widget-crypto.c
index 8c499b6..d0df5e6 100644
--- a/src/balsa-mime-widget-crypto.c
+++ b/src/balsa-mime-widget-crypto.c
@@ -177,8 +177,7 @@ balsa_mime_widget_crypto_frame(LibBalsaMessageBody * mime_body, GtkWidget * chil
     if (was_encrypted)
         gtk_box_pack_start(GTK_BOX(icon_box),
                            gtk_image_new_from_icon_name
-                           (balsa_icon_id(BALSA_PIXMAP_ENCR),
-                            GTK_ICON_SIZE_MENU));
+                           (balsa_icon_id(BALSA_PIXMAP_ENCR)));
     if (!no_signature) {
        const gchar * icon_name =
            balsa_mime_widget_signature_icon_name(libbalsa_message_body_protect_state(mime_body));
@@ -186,7 +185,7 @@ balsa_mime_widget_crypto_frame(LibBalsaMessageBody * mime_body, GtkWidget * chil
            icon_name = BALSA_PIXMAP_SIGN;
         gtk_box_pack_start(GTK_BOX(icon_box),
                            gtk_image_new_from_icon_name
-                           (balsa_icon_id(icon_name), GTK_ICON_SIZE_MENU));
+                           (balsa_icon_id(icon_name)));
     }
     gtk_frame_set_label_widget(GTK_FRAME(frame), icon_box);
     g_object_set(G_OBJECT(vbox), "margin", BMW_MESSAGE_PADDING, NULL);
diff --git a/src/balsa-mime-widget-image.c b/src/balsa-mime-widget-image.c
index d009be9..2325ffe 100644
--- a/src/balsa-mime-widget-image.c
+++ b/src/balsa-mime-widget-image.c
@@ -94,8 +94,7 @@ balsa_mime_widget_new_image(BalsaMessage * bm,
        return NULL;
     }
 
-    image = gtk_image_new_from_icon_name("image-missing",
-                                         GTK_ICON_SIZE_BUTTON);
+    image = gtk_image_new_from_icon_name("image-missing");
 
     g_object_set_data_full(G_OBJECT(image), "pixbuf", pixbuf, g_object_unref);
 
diff --git a/src/balsa-print-object-default.c b/src/balsa-print-object-default.c
index d221c5a..4facc5f 100644
--- a/src/balsa-print-object-default.c
+++ b/src/balsa-print-object-default.c
@@ -132,9 +132,7 @@ balsa_print_object_default(GList * list,
 
     /* get a pixbuf according to the mime type */
     conttype = libbalsa_message_body_get_mime_type(body);
-    pod->pixbuf =
-       libbalsa_icon_finder(NULL, conttype, NULL, NULL,
-                             GTK_ICON_SIZE_DND);
+    pod->pixbuf = libbalsa_icon_finder(NULL, conttype, NULL, NULL, 48);
     pod->c_image_width = gdk_pixbuf_get_width(pod->pixbuf);
     pod->c_image_height = gdk_pixbuf_get_height(pod->pixbuf);
 
diff --git a/src/balsa-print-object-text.c b/src/balsa-print-object-text.c
index 77e0091..40f0501 100644
--- a/src/balsa-print-object-text.c
+++ b/src/balsa-print-object-text.c
@@ -470,8 +470,7 @@ balsa_print_object_text_vcard(GList * list,
     if (!pod->pixbuf) {
        gchar *conttype = libbalsa_message_body_get_mime_type(body);
 
-       pod->pixbuf = libbalsa_icon_finder(NULL, conttype, NULL, NULL,
-                                           GTK_ICON_SIZE_DND);
+       pod->pixbuf = libbalsa_icon_finder(NULL, conttype, NULL, NULL, 48);
     }
     pod->c_image_width = gdk_pixbuf_get_width(pod->pixbuf);
     pod->c_image_height = gdk_pixbuf_get_height(pod->pixbuf);
@@ -617,8 +616,7 @@ balsa_print_object_text_calendar(GList * list,
     if (!pod->pixbuf) {
        gchar *conttype = libbalsa_message_body_get_mime_type(body);
 
-       pod->pixbuf = libbalsa_icon_finder(NULL, conttype, NULL, NULL,
-                                           GTK_ICON_SIZE_DND);
+       pod->pixbuf = libbalsa_icon_finder(NULL, conttype, NULL, NULL, 48);
     }
     pod->c_image_width = gdk_pixbuf_get_width(pod->pixbuf);
     pod->c_image_height = gdk_pixbuf_get_height(pod->pixbuf);
diff --git a/src/filter-run-dialog.c b/src/filter-run-dialog.c
index 6ceb66b..ba99dd4 100644
--- a/src/filter-run-dialog.c
+++ b/src/filter-run-dialog.c
@@ -370,8 +370,7 @@ void balsa_filter_run_dialog_init(BalsaFilterRunDialog * p)
 
     /* Right/Add button */
     p->add_button = button =
-        gtk_button_new_from_icon_name("go-next-symbolic",
-                                      GTK_ICON_SIZE_BUTTON);
+        gtk_button_new_from_icon_name("go-next-symbolic");
     gtk_widget_set_tooltip_text(button,
                                 _("Add selected filter to mailbox"));
     gtk_widget_set_sensitive(button, FALSE);
@@ -380,8 +379,7 @@ void balsa_filter_run_dialog_init(BalsaFilterRunDialog * p)
     gtk_container_add(GTK_CONTAINER(bbox), button);
     /* Left/Remove button */
     p->remove_button = button =
-        gtk_button_new_from_icon_name("go-previous-symbolic",
-                                      GTK_ICON_SIZE_BUTTON);
+        gtk_button_new_from_icon_name("go-previous-symbolic");
     gtk_widget_set_tooltip_text(button,
                                 _("Remove selected filter from mailbox"));
     gtk_widget_set_sensitive(button, FALSE);
@@ -424,8 +422,7 @@ void balsa_filter_run_dialog_init(BalsaFilterRunDialog * p)
 
     /* up button */
     p->move_up_button = button =
-        gtk_button_new_from_icon_name("go-up-symbolic",
-                                      GTK_ICON_SIZE_BUTTON);
+        gtk_button_new_from_icon_name("go-up-symbolic");
     gtk_widget_set_sensitive(button, FALSE);
     gtk_widget_set_tooltip_text(button,
                                 _("Move selected filter up"));
@@ -434,8 +431,7 @@ void balsa_filter_run_dialog_init(BalsaFilterRunDialog * p)
     gtk_container_add(GTK_CONTAINER(bbox), button);
     /* down button */
     p->move_down_button = button =
-        gtk_button_new_from_icon_name("go-down-symbolic",
-                                      GTK_ICON_SIZE_BUTTON);
+        gtk_button_new_from_icon_name("go-down-symbolic");
     gtk_widget_set_sensitive(button, FALSE);
     gtk_widget_set_tooltip_text(button,
                                 _("Move selected filter down"));
diff --git a/src/main-window.c b/src/main-window.c
index 8d71f90..6c12ba9 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -490,8 +490,7 @@ bw_create_index_widget(BalsaWindow *bw)
     button = gtk_button_new();
     gtk_box_pack_start(GTK_BOX(bw->sos_bar), button);
     gtk_container_add(GTK_CONTAINER(button),
-                      gtk_image_new_from_icon_name("gtk-ok",
-                                                    GTK_ICON_SIZE_BUTTON));
+                      gtk_image_new_from_icon_name("gtk-ok"));
     g_signal_connect(G_OBJECT(bw->sos_entry), "activate",
                      G_CALLBACK(bw_filter_entry_activate),
                      button);
@@ -2215,6 +2214,7 @@ balsa_window_new()
 #endif
     GtkAdjustment *hadj, *vadj;
     GAction *action;
+    GtkTargetList *list;
 
     /* Call to register custom balsa pixmaps with GNOME_STOCK_PIXMAPS
      * - allows for grey out */
@@ -2273,9 +2273,13 @@ balsa_window_new()
     gtk_notebook_set_scrollable (GTK_NOTEBOOK (window->notebook), TRUE);
     g_signal_connect(G_OBJECT(window->notebook), "switch_page",
                      G_CALLBACK(bw_notebook_switch_page_cb), window);
+
+    list = gtk_target_list_new(notebook_drop_types, NUM_DROP_TYPES);
     gtk_drag_dest_set (GTK_WIDGET (window->notebook), GTK_DEST_DEFAULT_ALL,
-                       notebook_drop_types, NUM_DROP_TYPES,
+                       list,
                        GDK_ACTION_DEFAULT | GDK_ACTION_COPY | GDK_ACTION_MOVE);
+    gtk_target_list_unref(list);
+
     g_signal_connect(G_OBJECT (window->notebook), "drag-data-received",
                      G_CALLBACK (bw_notebook_drag_received_cb), NULL);
     g_signal_connect(G_OBJECT (window->notebook), "drag-motion",
@@ -2801,8 +2805,7 @@ bw_notebook_label_new(BalsaMailboxNode * mbnode)
     g_signal_connect(but, "clicked",
                      G_CALLBACK(bw_mailbox_tab_close_cb), mbnode);
 
-    close_pix = gtk_image_new_from_icon_name("window-close-symbolic",
-                                             GTK_ICON_SIZE_MENU);
+    close_pix = gtk_image_new_from_icon_name("window-close-symbolic");
     gtk_container_add(GTK_CONTAINER(but), close_pix);
     gtk_box_pack_start(GTK_BOX(box), but);
 
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index 3a20132..aa73ade 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -1734,8 +1734,7 @@ add_attachment(BalsaSendmsg * bsmsg, const gchar *filename,
        content_type = g_strdup(forced_mime_type);
     pixbuf =
         libbalsa_icon_finder(GTK_WIDGET(bsmsg->window), forced_mime_type,
-                             file_uri, &content_type,
-                             GTK_ICON_SIZE_LARGE_TOOLBAR);
+                             file_uri, &content_type, 24);
     if (!content_type)
        /* Last ditch. */
        content_type = g_strdup("application/octet-stream");
@@ -1898,7 +1897,7 @@ add_urlref_attachment(BalsaSendmsg * bsmsg, gchar *url)
     /* get the pixbuf for the attachment's content type */
     pixbuf =
         gtk_icon_theme_load_icon(gtk_icon_theme_get_default(),
-                                 "go-jump", GTK_ICON_SIZE_MENU, 0, NULL);
+                                 "go-jump", 16, 0, NULL);
 
     /* create a new attachment info block */
     attach_data = balsa_attach_info_new(bsmsg);
@@ -2372,6 +2371,7 @@ create_email_entry(BalsaSendmsg         * bsmsg,
                    guint                  n_types)
 {
     GtkWidget *scroll;
+    GtkTargetList *list;
 
     *view = libbalsa_address_view_new(types, n_types,
                                       balsa_app.address_book_list,
@@ -2397,10 +2397,12 @@ create_email_entry(BalsaSendmsg         * bsmsg,
                      G_CALLBACK(to_add), NULL);
     g_signal_connect(*view, "open-address-book",
                     G_CALLBACK(address_book_cb), bsmsg);
+
+    list = gtk_target_list_new(email_field_drop_types, G_N_ELEMENTS(email_field_drop_types));
     gtk_drag_dest_set(GTK_WIDGET(*view), GTK_DEST_DEFAULT_ALL,
-                     email_field_drop_types,
-                     G_N_ELEMENTS(email_field_drop_types),
+                     list,
                      GDK_ACTION_COPY | GDK_ACTION_MOVE);
+    gtk_target_list_unref(list);
 
     libbalsa_address_view_set_domain(*view, bsmsg->ident->domain);
     g_signal_connect_swapped(gtk_tree_view_get_model(GTK_TREE_VIEW(*view)),
@@ -2619,6 +2621,7 @@ sw_attachment_list(BalsaSendmsg *bsmsg)
     GtkTreeView *view;
     GtkTreeViewColumn *column;
     GtkWidget *frame;
+    GtkTargetList *list;
 
     grid = gtk_grid_new();
     gtk_grid_set_row_spacing(GTK_GRID(grid), 6);
@@ -2706,9 +2709,12 @@ sw_attachment_list(BalsaSendmsg *bsmsg)
 
     g_signal_connect(G_OBJECT(bsmsg->window), "drag_data_received",
                     G_CALLBACK(attachments_add), bsmsg);
+
+    list = gtk_target_list_new(drop_types, G_N_ELEMENTS(drop_types));
     gtk_drag_dest_set(GTK_WIDGET(bsmsg->window), GTK_DEST_DEFAULT_ALL,
-                     drop_types, G_N_ELEMENTS(drop_types),
+                     list,
                      GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+    gtk_target_list_unref(list);
 
     frame = gtk_frame_new(NULL);
     gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
@@ -2853,6 +2859,7 @@ create_text_area(BalsaSendmsg * bsmsg)
 #endif                          /* HAVE_GSPELL_1_2 */
 #endif                          /* HAVE_GSPELL */
     GtkWidget *scroll;
+    GtkTargetList *list;
 
 #if HAVE_GTKSOURCEVIEW
     bsmsg->text = libbalsa_source_view_new(TRUE);
@@ -2914,10 +2921,13 @@ create_text_area(BalsaSendmsg * bsmsg)
     gtk_container_add(GTK_CONTAINER(scroll), bsmsg->text);
     g_signal_connect(G_OBJECT(bsmsg->text), "drag_data_received",
                     G_CALLBACK(drag_data_quote), bsmsg);
+
+    list = gtk_target_list_new(drop_types, G_N_ELEMENTS(drop_types));
     /* GTK_DEST_DEFAULT_ALL in drag_set would trigger bug 150141 */
     gtk_drag_dest_set(GTK_WIDGET(bsmsg->text), 0,
-                     drop_types, G_N_ELEMENTS(drop_types),
+                     list,
                      GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK);
+    gtk_target_list_unref(list);
 
     gtk_widget_show(scroll);
 
@@ -3329,8 +3339,7 @@ quote_parts_select_dlg(GtkTreeStore *tree_store, GtkWindow * parent)
     gtk_widget_set_halign(label, GTK_ALIGN_START);
     gtk_widget_set_valign(label, GTK_ALIGN_START);
 
-    image = gtk_image_new_from_icon_name("dialog-question",
-                                         GTK_ICON_SIZE_DIALOG);
+    image = gtk_image_new_from_icon_name("dialog-question");
     gtk_widget_set_valign(image, GTK_ALIGN_START);
 
     /* stolen form gtk/gtkmessagedialog.c */
@@ -4986,8 +4995,7 @@ subject_not_empty(BalsaSendmsg * bsmsg)
     gtk_box_pack_start (GTK_BOX (dialog_vbox), hbox);
     g_object_set(G_OBJECT(hbox), "margin", 6, NULL);
 
-    image = gtk_image_new_from_icon_name("dialog-question",
-                                         GTK_ICON_SIZE_DIALOG);
+    image = gtk_image_new_from_icon_name("dialog-question");
     gtk_box_pack_start (GTK_BOX (hbox), image);
     gtk_widget_set_valign(image, GTK_ALIGN_START);
 
@@ -5110,8 +5118,7 @@ check_suggest_encryption(BalsaSendmsg * bsmsg)
         gtk_widget_set_halign(hbox, GTK_ALIGN_CENTER);
         gtk_widget_set_valign(hbox, GTK_ALIGN_CENTER);
        gtk_container_add(GTK_CONTAINER(button), hbox);
-       image = gtk_image_new_from_icon_name(balsa_icon_id(BALSA_PIXMAP_GPG_ENCRYPT),
-                                             GTK_ICON_SIZE_BUTTON);
+       image = gtk_image_new_from_icon_name(balsa_icon_id(BALSA_PIXMAP_GPG_ENCRYPT));
        gtk_box_pack_start(GTK_BOX(hbox), image);
        label = gtk_label_new_with_mnemonic(_("Send _encrypted"));
        gtk_box_pack_start(GTK_BOX(hbox), label);
@@ -5125,8 +5132,7 @@ check_suggest_encryption(BalsaSendmsg * bsmsg)
         gtk_widget_set_halign(hbox, GTK_ALIGN_CENTER);
         gtk_widget_set_valign(hbox, GTK_ALIGN_CENTER);
        gtk_container_add(GTK_CONTAINER(button), hbox);
-       image = gtk_image_new_from_icon_name(balsa_icon_id(BALSA_PIXMAP_SEND),
-                                             GTK_ICON_SIZE_BUTTON);
+       image = gtk_image_new_from_icon_name(balsa_icon_id(BALSA_PIXMAP_SEND));
        gtk_box_pack_start(GTK_BOX(hbox), image);
        label = gtk_label_new_with_mnemonic(_("Send _unencrypted"));
        gtk_box_pack_start(GTK_BOX(hbox), label);
diff --git a/src/toolbar-factory.c b/src/toolbar-factory.c
index a412db0..a61fe36 100644
--- a/src/toolbar-factory.c
+++ b/src/toolbar-factory.c
@@ -550,8 +550,8 @@ tm_populate(GtkWidget * toolbar, BalsaToolbarModel * model)
             const GVariantType *type;
             gchar *prefixed_action;
 
-            icon = gtk_image_new_from_icon_name
-                (balsa_icon_id(entry->icon), GTK_ICON_SIZE_SMALL_TOOLBAR);
+            icon = gtk_image_new_from_icon_name(balsa_icon_id(entry->icon));
+            gtk_image_set_pixel_size((GtkImage *) icon, 24);
             action = g_action_map_lookup_action(action_map, entry->action);
             if (action &&
                 (type = g_action_get_state_type(action)) &&
diff --git a/src/toolbar-prefs.c b/src/toolbar-prefs.c
index 73e85c1..9c56a98 100644
--- a/src/toolbar-prefs.c
+++ b/src/toolbar-prefs.c
@@ -495,9 +495,7 @@ create_toolbar_page(BalsaToolbarModel * model, GActionMap * map)
 
     gtk_box_pack_start(GTK_BOX(center_button_box), button_box);
 
-    page->back_button =
-        gtk_button_new_from_icon_name("go-up-symbolic",
-                                      GTK_ICON_SIZE_BUTTON);
+    page->back_button = gtk_button_new_from_icon_name("go-up-symbolic");
     gtk_widget_set_tooltip_text(page->back_button,
                                 _("Move selected item up"));
     gtk_box_pack_start(GTK_BOX(button_box), page->back_button);
@@ -505,23 +503,17 @@ create_toolbar_page(BalsaToolbarModel * model, GActionMap * map)
     move_button_box=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
     gtk_box_pack_start(GTK_BOX(button_box), move_button_box);
 
-    page->remove_button =
-        gtk_button_new_from_icon_name("go-previous-symbolic",
-                                      GTK_ICON_SIZE_BUTTON);
+    page->remove_button = gtk_button_new_from_icon_name("go-previous-symbolic");
     gtk_widget_set_tooltip_text(page->remove_button,
                                 _("Remove selected item from toolbar"));
     gtk_box_pack_start(GTK_BOX(move_button_box), page->remove_button);
 
-    page->add_button =
-        gtk_button_new_from_icon_name("go-next-symbolic",
-                                      GTK_ICON_SIZE_BUTTON);
+    page->add_button = gtk_button_new_from_icon_name("go-next-symbolic");
     gtk_widget_set_tooltip_text(page->add_button,
                                 _("Add selected item to toolbar"));
     gtk_box_pack_start(GTK_BOX(move_button_box), page->add_button);
 
-    page->forward_button =
-        gtk_button_new_from_icon_name("go-down-symbolic",
-                                      GTK_ICON_SIZE_BUTTON);
+    page->forward_button = gtk_button_new_from_icon_name("go-down-symbolic");
     gtk_widget_set_tooltip_text(page->forward_button,
                                 _("Move selected item down"));
     gtk_box_pack_start(GTK_BOX(button_box), page->forward_button);
@@ -835,7 +827,7 @@ tp_store_set(GtkListStore * store, GtkTreeIter * iter, gint item)
         (item > 0
          ? gtk_icon_theme_load_icon(gtk_icon_theme_get_default(),
                                     toolbar_buttons[item].pixmap_id,
-                                    GTK_ICON_SIZE_LARGE_TOOLBAR, 0, NULL)
+                                    24, 0, NULL)
          : NULL);
     gtk_list_store_set(store, iter,
                        TP_TEXT_COLUMN, text,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]