GType type;
} column_desc_t;
-const static column_desc_t playlist_columns[] =
+static const column_desc_t playlist_columns[] =
{
{
"REM",
},
{
"B",
- G_TYPE_STRING
+ G_TYPE_OBJECT
},
{
"CH",
gtk_widget_show (treeview);
for(i = 0, count = 0; columns[i].title; i++, count++)
- list_store_types[i] = columns[i].type;
+ list_store_types[i] = (columns[i].type == G_TYPE_OBJECT)?GDK_TYPE_PIXBUF:columns[i].type;
+ list_store_types[count + 1] = G_TYPE_INT;
+
+ list_store = gtk_list_store_newv(count + 1, list_store_types);
- list_store = gtk_list_store_newv(count, list_store_types);
gtk_tree_view_set_model( GTK_TREE_VIEW( treeview ), GTK_TREE_MODEL( list_store ) );
for(i = 0; columns[i].title; i++)
{
- renderer = gtk_cell_renderer_toggle_new();
+ char* prop;
+
+ if(columns[i].type == G_TYPE_OBJECT)
+ {
+ renderer = gtk_cell_renderer_pixbuf_new();
+ gtk_cell_renderer_set_padding(renderer, 0, 0);
+ prop = "pixbuf";
+ }
+ else if(columns[i].type == G_TYPE_BOOLEAN)
+ {
+ renderer = gtk_cell_renderer_toggle_new();
+ prop = "active";
+ }
+ else
+ {
+ renderer = gtk_cell_renderer_text_new();
+ prop = "text";
+ }
+
column = gtk_tree_view_column_new_with_attributes(
- columns[i].title, renderer, "text", i, NULL);
+ columns[i].title, renderer, prop, i, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW( treeview ), column);
};
gtk_container_add (GTK_CONTAINER (wnd),
pane_top(wnd, app));
+ app->playlist.block_icons[OMNPLAY_PLAYLIST_ITEM_BLOCK_BEGIN] =
+ create_pixbuf("block_type_block_start_16x16.png");
+ app->playlist.block_icons[OMNPLAY_PLAYLIST_ITEM_BLOCK_BODY] =
+ create_pixbuf("block_type_block_middle_16x16.png");
+ app->playlist.block_icons[OMNPLAY_PLAYLIST_ITEM_BLOCK_END] =
+ create_pixbuf("block_type_block_end_16x16.png");
+ app->playlist.block_icons[OMNPLAY_PLAYLIST_ITEM_BLOCK_SINGLE] =
+ create_pixbuf("block_type_block_single_16x16.png");
+ app->playlist.block_icons[OMNPLAY_PLAYLIST_ITEM_LOOP_BEGIN] =
+ create_pixbuf("block_type_loop_start_16x16.png");
+ app->playlist.block_icons[OMNPLAY_PLAYLIST_ITEM_LOOP_BODY] =
+ create_pixbuf("block_type_loop_middle_16x16.png");
+ app->playlist.block_icons[OMNPLAY_PLAYLIST_ITEM_LOOP_END] =
+ create_pixbuf("block_type_loop_end_16x16.png");
+ app->playlist.block_icons[OMNPLAY_PLAYLIST_ITEM_LOOP_SINGLE] =
+ create_pixbuf("block_type_block_loop_16x16.png");
+
return wnd;
}