summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2013-07-24 18:28:01 +0100
committerPhillip Wood <phillip.wood@dunelm.org.uk>2013-08-20 10:48:56 +0100
commit50c4b53d917271dcbe8afe9138149a009132ed33 (patch)
tree25afcefd4f022c6a82e2d30a86a9ca81a234d8e5
parent03caf8b839242d317642231790c4169cd7325791 (diff)
Replace stock icons with named icons
This works around GTK bug #702423 which stops the playback icon showing on GTK 3.8 & later. This is also a small first step towards removing deprecated stock items. https://bugzilla.gnome.org/show_bug.cgi?id=705131
-rw-r--r--src/sj-main.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/sj-main.c b/src/sj-main.c
index a91be5a..ea67637 100644
--- a/src/sj-main.c
+++ b/src/sj-main.c
@@ -322,16 +322,20 @@ static void number_cell_icon_data_cb (GtkTreeViewColumn *tree_column,
gtk_tree_model_get (tree_model, iter, COLUMN_STATE, &state, -1);
switch (state) {
case STATE_IDLE:
- g_object_set (G_OBJECT (cell), "stock-id", NULL, NULL);
+ g_object_set (G_OBJECT (cell), "icon-name", NULL, NULL);
break;
case STATE_PLAYING:
- g_object_set (G_OBJECT (cell), "stock-id", GTK_STOCK_MEDIA_PLAY, NULL);
+ {
+ gboolean rtl = gtk_widget_get_direction (track_listview) == GTK_TEXT_DIR_RTL;
+ gchar *name = rtl ? "media-playback-start-rtl" : "media-playback-start";
+ g_object_set (G_OBJECT (cell), "icon-name", name, NULL);
+ }
break;
case STATE_PAUSED:
- g_object_set (G_OBJECT (cell), "stock-id", GTK_STOCK_MEDIA_PAUSE, NULL);
+ g_object_set (G_OBJECT (cell), "icon-name", "media-playback-pause", NULL);
break;
case STATE_EXTRACTING:
- g_object_set (G_OBJECT (cell), "stock-id", GTK_STOCK_MEDIA_RECORD, NULL);
+ g_object_set (G_OBJECT (cell), "icon-name", "media-record", NULL);
break;
default:
g_warning("Unhandled track state %d\n", state);