[easytag] Remove album pixmap, use themed icon instead



commit dd418d953620891e34aca542147e6ea0e628b980
Author: David King <amigadave amigadave com>
Date:   Sat Nov 2 11:59:38 2013 +0000

    Remove album pixmap, use themed icon instead
    
    Use the media-optical-cd-audio icon to replace the album pixmap, and use
    it in the artist and album view.

 Makefile.am            |    1 -
 data/pixmaps/album.xpm |  289 ------------------------------------------------
 src/browser.c          |   32 +++--
 src/browser.h          |    2 +-
 src/misc.c             |    2 -
 5 files changed, 20 insertions(+), 306 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 69ba60e..a184160 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -164,7 +164,6 @@ nodist_man_MANS = doc/easytag.1
 endif
 
 pixmaps = \
-       data/pixmaps/album.xpm \
        data/pixmaps/all_downcase.xpm \
        data/pixmaps/all_uppercase.xpm \
        data/pixmaps/artist.xpm \
diff --git a/src/browser.c b/src/browser.c
index 9f5b484..d6afba0 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -2127,20 +2127,27 @@ Browser_Album_List_Load_Files (GList *albumlist, ET_File *etfile_to_select)
     // Create a line for each album of the artist
     for (l = albumlist; l != NULL; l = g_list_next (l))
     {
+        GIcon *icon;
+
         // Insert a line for each album
         etfilelist = (GList *)l->data;
         etfile     = (ET_File *)etfilelist->data;
         albumname  = ((File_Tag *)etfile->FileTag->data)->album;
 
-        // Add the new row
+        /* TODO: Make the icon use the symbolic variant. */
+        icon = g_themed_icon_new_with_default_fallbacks ("media-optical-cd-audio");
+
+        /* Add the new row. */
         gtk_list_store_insert_with_values (albumListModel, &iter, G_MAXINT,
-                                           ALBUM_PIXBUF, "easytag-album",
+                                           ALBUM_GICON, icon,
                                            ALBUM_NAME, albumname,
                                            ALBUM_NUM_FILES,
                                            g_list_length (g_list_first (etfilelist)),
                                            ALBUM_ETFILE_LIST_POINTER,
                                            etfilelist, -1);
 
+        g_object_unref (icon);
+
         if ( (!albumname && !album_to_select)
         ||   (albumname &&  album_to_select && strcmp(albumname,album_to_select) == 0) )
         {
@@ -3274,14 +3281,14 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(ScrollWindowAlbumList),
                                    GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
 
-    albumListModel = gtk_list_store_new(ALBUM_COLUMN_COUNT,
-                                        G_TYPE_STRING, // Stock-id
-                                        G_TYPE_STRING,
-                                        G_TYPE_UINT,
-                                        G_TYPE_POINTER,
-                                        PANGO_TYPE_STYLE,
-                                        G_TYPE_INT,
-                                        GDK_TYPE_COLOR);
+    albumListModel = gtk_list_store_new (ALBUM_COLUMN_COUNT,
+                                         G_TYPE_ICON,
+                                         G_TYPE_STRING,
+                                         G_TYPE_UINT,
+                                         G_TYPE_POINTER,
+                                         PANGO_TYPE_STYLE,
+                                         G_TYPE_INT,
+                                         GDK_TYPE_COLOR);
 
     BrowserAlbumList = gtk_tree_view_new_with_model(GTK_TREE_MODEL(albumListModel));
     g_object_unref (albumListModel);
@@ -3295,9 +3302,8 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
 
     renderer = gtk_cell_renderer_pixbuf_new();
     gtk_tree_view_column_pack_start(column, renderer, FALSE);
-    gtk_tree_view_column_set_attributes(column, renderer,
-                                       "stock-id",        ALBUM_PIXBUF,
-                                        NULL);
+    gtk_tree_view_column_set_attributes (column, renderer, "gicon",
+                                         ALBUM_GICON, NULL);
     renderer = gtk_cell_renderer_text_new();
     gtk_tree_view_column_pack_start(column, renderer, FALSE);
     gtk_tree_view_column_set_attributes(column, renderer,
diff --git a/src/browser.h b/src/browser.h
index 9df5475..5965379 100644
--- a/src/browser.h
+++ b/src/browser.h
@@ -114,7 +114,7 @@ enum
 
 enum
 {
-    ALBUM_PIXBUF,
+    ALBUM_GICON,
     ALBUM_NAME,
     ALBUM_NUM_FILES,
     ALBUM_ETFILE_LIST_POINTER,
diff --git a/src/misc.c b/src/misc.c
index e94638d..ef4358c 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -564,7 +564,6 @@ void Set_Unbusy_Cursor (void)
 /*
  * Add easytag specific icons to GTK stock set
  */
-#include "data/pixmaps/album.xpm"
 #include "data/pixmaps/all_uppercase.xpm"
 #include "data/pixmaps/all_downcase.xpm"
 #include "data/pixmaps/artist.xpm"
@@ -580,7 +579,6 @@ void Set_Unbusy_Cursor (void)
 void Init_Custom_Icons (void)
 {
     Create_Xpm_Icon_Factory((const char**)artist_xpm,               "easytag-artist");
-    Create_Xpm_Icon_Factory((const char**)album_xpm,                "easytag-album");
     Create_Xpm_Icon_Factory((const char**)invert_selection_xpm,     "easytag-invert-selection");
     Create_Xpm_Icon_Factory((const char**)unselect_all_xpm,         "easytag-unselect-all");
     Create_Xpm_Icon_Factory((const char**)mask_xpm,                 "easytag-mask");


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