[easytag] Use a separator row in the album view



commit bea6a388583970ac506f5d6f21d59a3b256e8fa4
Author: David King <amigadave amigadave com>
Date:   Fri Nov 28 21:42:50 2014 +0000

    Use a separator row in the album view

 data/browser.ui |    1 +
 src/browser.c   |   27 ++++++++++++++++++++++++---
 2 files changed, 25 insertions(+), 3 deletions(-)
---
diff --git a/data/browser.ui b/data/browser.ui
index ee2e878..587749a 100644
--- a/data/browser.ui
+++ b/data/browser.ui
@@ -59,6 +59,7 @@
             <column type="gint"/>
             <column type="GdkRGBA"/>
             <column type="gboolean"/>
+            <column type="gboolean"/>
         </columns>
     </object>
     <object class="GtkDialog" id="open_directory_dialog">
diff --git a/src/browser.c b/src/browser.c
index 2e6b9dd..19eb418 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -161,6 +161,7 @@ enum
     ALBUM_FONT_WEIGHT,
     ALBUM_ROW_FOREGROUND,
     ALBUM_ALL_ALBUMS_ROW,
+    ALBUM_ALL_ALBUMS_SEPARATOR_ROW,
     ALBUM_COLUMN_COUNT
 };
 
@@ -2554,13 +2555,18 @@ Browser_Album_List_Load_Files (EtBrowser *self,
     }
 
     gtk_list_store_insert_with_values (priv->album_model, &iter, G_MAXINT,
-                                       ALBUM_NAME, _("<All albums>"),
+                                       ALBUM_NAME, _("All albums"),
                                        ALBUM_NUM_FILES,
                                        g_list_length (g_list_first (etfilelist)),
                                        ALBUM_ETFILE_LIST_POINTER, etfilelist,
                                        ALBUM_ALL_ALBUMS_ROW, TRUE,
                                        -1);
 
+    gtk_list_store_insert_with_values (priv->album_model, &iter, G_MAXINT,
+                                       ALBUM_ALL_ALBUMS_ROW, FALSE,
+                                       ALBUM_ALL_ALBUMS_SEPARATOR_ROW, TRUE,
+                                       -1);
+
     // Create a line for each album of the artist
     for (l = albumlist; l != NULL; l = g_list_next (l))
     {
@@ -2581,8 +2587,7 @@ Browser_Album_List_Load_Files (EtBrowser *self,
                                            ALBUM_NUM_FILES,
                                            g_list_length (g_list_first (etfilelist)),
                                            ALBUM_ETFILE_LIST_POINTER,
-                                           etfilelist,
-                                           ALBUM_ALL_ALBUMS_ROW, FALSE, -1);
+                                           etfilelist, -1);
 
         g_object_unref (icon);
 
@@ -3814,6 +3819,19 @@ File_Selection_Window_For_Directory (GtkWidget *entry)
                                 GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
 }
 
+static gboolean
+album_list_separator_func (GtkTreeModel *model,
+                           GtkTreeIter *iter,
+                           gpointer user_data)
+{
+    gboolean separator_row;
+
+    gtk_tree_model_get (model, iter, ALBUM_ALL_ALBUMS_SEPARATOR_ROW,
+                        &separator_row, -1);
+
+    return separator_row;
+}
+
 /*
  * Create item of the browser (Entry + Tree + List).
  */
@@ -3949,6 +3967,9 @@ create_browser (EtBrowser *self)
                                                                 "album_model"));
     priv->album_list = GTK_WIDGET (gtk_builder_get_object (builder,
                                                            "album_view"));
+    gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW (priv->album_list),
+                                          album_list_separator_func, NULL,
+                                          NULL);
     gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->album_list)),
                                  GTK_SELECTION_SINGLE);
 


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