Re: [Rhythmbox-devel] [PATCH] Use more icons from icon theme + defaultto gnome icons



Hi James,


The following should work:

if (view->priv->playing_entry) {
  rhythmdb_query_model_entry_to_iter (view->priv->playing_model,
        view->priv->playing_entry, &iter);
  path = gtk_tree_model_get_path (
        GTK_TREE_MODEL (view->priv->playing_model), &iter);
  gtk_tree_model_row_changed (
        GTK_TREE_MODEL (view->priv->playing_model), path, &iter);
  gtk_tree_path_free (path);
}


Thanks!! I added that to the patch.



Jakub, now there are only 4 icons left in rhythmbox:
1. rhythmbox-tray-icon.png
2. rhythmbox-set-star.png
3. rhythmbox-unset-star.png
4. rhythmbox-no-star.png

If you push these in gnome-icon theme, Rhythmbox will be fully themeable :-) and no compile time options to set the art will be needed.


As I understand it, themes should already be able to override
Rhythmbox's icons, because they are handled with a GtkIconFactory. I'm
fairly sure I've seen themes that override the tray icon, at least.

If that is the case then a compile time option does not make sense. As a convenience I attached two patches:
1. rhythmbox-icons.patch: Same patch as before but with your suggestion to do updating of the playlist
2. rhythmbox-icons-one-art-dir.patch: same as 1. but with configurability of icons at compile time removed


If the patch is OK can you then apply the patch? I don't have CVS access

I think there was some discussion a while back, about how having
different sized stars for set and unset would be better for people with
bad vision. That would suggest using the newer art for the stars,
although I'm not personally a fan of bright yellow. Which of the two
tray icons would be better, I'm not sure.

For gnome icons the panel-icon in the art directory looks better. For bluecurve icons the one in the art-clearlooks (art-bluecurve) looks better. Best solution to me seems that rhythmbox uses the one in the art directory and that the author of bluecurve just adds the one in art-clearlooks to his theme.

For the stars I think an addition to the gnome-icon-theme is appropriate I can see other applications (movie players, book collection programs etc) use the stars as well.

Another option might be that rhythmbox installs it's icons in the gnome-icon-theme directory by itself. This way I think it will be easier for theme authors to see which icons they should make.

Jaap
Index: configure.ac
===================================================================
RCS file: /cvs/gnome/rhythmbox/configure.ac,v
retrieving revision 1.171
diff -u -r1.171 configure.ac
--- configure.ac	24 Sep 2005 15:39:24 -0000	1.171
+++ configure.ac	3 Oct 2005 19:15:53 -0000
@@ -117,18 +117,6 @@
 AC_SUBST(GDA_CFLAGS)
 AC_SUBST(GDA_LIBS)
 
-AC_ARG_WITH(old-art,
-            AC_HELP_STRING([--with-old-art],
-			   [Use old artwork]),,
-	      with_old_art=auto)
-if test x$with_old_art == xauto; then
-  with_old_art=xyes
-fi       
-if test x$with_old_art == xyes; then
-  AC_DEFINE(WITH_OLD_ART, 1, [Define if you want to use old artwork])
-fi      
-AM_CONDITIONAL(WITH_OLD_ART, test "x$with_old" == "xyes")
-
 dnl Database debugging
 AC_ARG_WITH(rhythmdb-debug,
               AC_HELP_STRING([--with-rhythmdb-debug=0|1|2],
Index: data/Makefile.am
===================================================================
RCS file: /cvs/gnome/rhythmbox/data/Makefile.am,v
retrieving revision 1.25
diff -u -r1.25 Makefile.am
--- data/Makefile.am	1 Sep 2005 17:19:40 -0000	1.25
+++ data/Makefile.am	3 Oct 2005 19:15:53 -0000
@@ -1,12 +1,6 @@
 ## arch-tag: Automake rules for various data files
 
-SUBDIRS = ui glade
-
-if WITH_OLD_ART
-SUBDIRS += art
-else
-SUBDIRS += art-clearlooks
-endif
+SUBDIRS = ui glade art
 
 @INTLTOOL_SERVER_RULE@
 @INTLTOOL_DESKTOP_RULE@
Index: lib/rb-stock-icons.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/lib/rb-stock-icons.c,v
retrieving revision 1.18
diff -u -r1.18 rb-stock-icons.c
--- lib/rb-stock-icons.c	27 Sep 2005 11:30:22 -0000	1.18
+++ lib/rb-stock-icons.c	3 Oct 2005 19:15:53 -0000
@@ -37,9 +37,6 @@
 
 	static const char *items[] =
 	{
-		RB_STOCK_PLAYBACK_ERROR,
-		RB_STOCK_PLAYING,
-		RB_STOCK_PAUSED,
 		RB_STOCK_TRAY_ICON,
 		RB_STOCK_SET_STAR,
 		RB_STOCK_UNSET_STAR,
Index: lib/rb-stock-icons.h
===================================================================
RCS file: /cvs/gnome/rhythmbox/lib/rb-stock-icons.h,v
retrieving revision 1.18
diff -u -r1.18 rb-stock-icons.h
--- lib/rb-stock-icons.h	27 Sep 2005 11:30:23 -0000	1.18
+++ lib/rb-stock-icons.h	3 Oct 2005 19:15:53 -0000
@@ -25,9 +25,6 @@
 
 G_BEGIN_DECLS
 
-#define RB_STOCK_PLAYBACK_ERROR "rhythmbox-playback-error"
-#define RB_STOCK_PLAYING       "rhythmbox-playing"
-#define RB_STOCK_PAUSED        "rhythmbox-paused"
 #define RB_STOCK_TRAY_ICON     "rhythmbox-tray-icon"
 #define RB_STOCK_SET_STAR      "rhythmbox-set-star"
 #define RB_STOCK_UNSET_STAR    "rhythmbox-unset-star"
Index: shell/rb-shell-player.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell-player.c,v
retrieving revision 1.172
diff -u -r1.172 rb-shell-player.c
--- shell/rb-shell-player.c	27 Sep 2005 11:30:24 -0000	1.172
+++ shell/rb-shell-player.c	3 Oct 2005 19:15:55 -0000
@@ -1863,6 +1863,8 @@
 		else
 			pstate = PLAY_BUTTON_STOP;
 
+		rb_entry_view_set_playing (view, TRUE);
+
 		action = gtk_action_group_get_action (player->priv->play_action_group,
 						      "ControlPlay");
 		g_object_set (G_OBJECT (action), "sensitive", TRUE, NULL);
@@ -1874,6 +1876,8 @@
 			pstate = PLAY_BUTTON_PLAY;
 		else
 			pstate = PLAY_BUTTON_STOP;
+
+		rb_entry_view_set_playing (view, FALSE);
 
 		action = gtk_action_group_get_action (player->priv->play_action_group,
 						      "ControlPlay");
Index: widgets/rb-entry-view.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/widgets/rb-entry-view.c,v
retrieving revision 1.99
diff -u -r1.99 rb-entry-view.c
--- widgets/rb-entry-view.c	28 Sep 2005 14:28:26 -0000	1.99
+++ widgets/rb-entry-view.c	3 Oct 2005 19:15:56 -0000
@@ -403,25 +403,27 @@
 static void
 rb_entry_view_init (RBEntryView *view)
 {
-	GtkWidget *dummy;
+	GtkIconTheme* icon_theme;
 	
 	view->priv = g_new0 (RBEntryViewPrivate, 1);
 
-	dummy = gtk_tree_view_new ();
-	view->priv->playing_pixbuf = gtk_widget_render_icon (dummy,
-							     RB_STOCK_PLAYING,
-							     GTK_ICON_SIZE_MENU,
-							     NULL);
-
-	view->priv->paused_pixbuf = gtk_widget_render_icon (dummy,
-							    RB_STOCK_PAUSED,
-							    GTK_ICON_SIZE_MENU,
-							    NULL);
-	view->priv->error_pixbuf = gtk_widget_render_icon (dummy,
-							   RB_STOCK_PLAYBACK_ERROR,
-							   GTK_ICON_SIZE_MENU,
-							   NULL);
-	gtk_widget_destroy (dummy);
+	icon_theme = gtk_icon_theme_get_default ();
+
+	view->priv->playing_pixbuf = gtk_icon_theme_load_icon (icon_theme,
+                                   			       "stock_volume-max", 
+                                   			       16,
+                                   			       0, 
+                                   			       NULL);
+	view->priv->paused_pixbuf = gtk_icon_theme_load_icon (icon_theme,
+                                   			      "stock_volume-0", 
+                                   			      16,
+                                   			      0, 
+                                   			      NULL);
+	view->priv->error_pixbuf = gtk_icon_theme_load_icon (icon_theme,
+                                   			     "stock_dialog-error", 
+                                   			     16,
+                                   			     0, 
+                                   			     NULL);
 
 	view->priv->propid_column_map = g_hash_table_new (NULL, NULL);
 	view->priv->column_sort_data_map = g_hash_table_new_full (NULL, NULL, NULL, g_free);
@@ -2107,9 +2109,19 @@
 rb_entry_view_set_playing (RBEntryView *view,
 			   gboolean playing)
 {
+	GtkTreePath *path;
+	GtkTreeIter iter;
+
 	g_return_if_fail (RB_IS_ENTRY_VIEW (view));
 
-	view->priv->playing = TRUE;
+	view->priv->playing = playing;
+	/* Redraw the treeview */
+	if (view->priv->playing_entry) {
+		rhythmdb_query_model_entry_to_iter (view->priv->playing_model, view->priv->playing_entry, &iter);
+		path = gtk_tree_model_get_path (GTK_TREE_MODEL (view->priv->playing_model), &iter);
+		gtk_tree_model_row_changed (GTK_TREE_MODEL (view->priv->playing_model), path, &iter);
+  		gtk_tree_path_free (path);
+	}
 }
 
 gboolean
Index: configure.ac
===================================================================
RCS file: /cvs/gnome/rhythmbox/configure.ac,v
retrieving revision 1.171
diff -u -r1.171 configure.ac
--- configure.ac	24 Sep 2005 15:39:24 -0000	1.171
+++ configure.ac	3 Oct 2005 19:01:18 -0000
@@ -117,17 +117,17 @@
 AC_SUBST(GDA_CFLAGS)
 AC_SUBST(GDA_LIBS)
 
-AC_ARG_WITH(old-art,
-            AC_HELP_STRING([--with-old-art],
-			   [Use old artwork]),,
-	      with_old_art=auto)
-if test x$with_old_art == xauto; then
-  with_old_art=xyes
+AC_ARG_WITH(bluecurve-art,
+            AC_HELP_STRING([--with-bluecurve-art],
+			   [Use bluecurve artwork]),,
+	      with_bluecurve_art=auto)
+if test x$with_bluecurve_art == xauto; then
+  with_bluecurve_art=xyes
 fi       
-if test x$with_old_art == xyes; then
-  AC_DEFINE(WITH_OLD_ART, 1, [Define if you want to use old artwork])
+if test x$with_bluecurve_art == xyes; then
+  AC_DEFINE(WITH_OLD_ART, 1, [Define if you want to use bluecurve artwork])
 fi      
-AM_CONDITIONAL(WITH_OLD_ART, test "x$with_old" == "xyes")
+AM_CONDITIONAL(WITH_BLUECURVE_ART, test "x$with_bluecurve" == "xyes")
 
 dnl Database debugging
 AC_ARG_WITH(rhythmdb-debug,
Index: data/Makefile.am
===================================================================
RCS file: /cvs/gnome/rhythmbox/data/Makefile.am,v
retrieving revision 1.25
diff -u -r1.25 Makefile.am
--- data/Makefile.am	1 Sep 2005 17:19:40 -0000	1.25
+++ data/Makefile.am	3 Oct 2005 19:01:18 -0000
@@ -2,10 +2,10 @@
 
 SUBDIRS = ui glade
 
-if WITH_OLD_ART
-SUBDIRS += art
+if WITH_BLUECURVE_ART
+SUBDIRS += art-bluecurve
 else
-SUBDIRS += art-clearlooks
+SUBDIRS += art
 endif
 
 @INTLTOOL_SERVER_RULE@
Index: lib/rb-stock-icons.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/lib/rb-stock-icons.c,v
retrieving revision 1.18
diff -u -r1.18 rb-stock-icons.c
--- lib/rb-stock-icons.c	27 Sep 2005 11:30:22 -0000	1.18
+++ lib/rb-stock-icons.c	3 Oct 2005 19:01:18 -0000
@@ -37,9 +37,6 @@
 
 	static const char *items[] =
 	{
-		RB_STOCK_PLAYBACK_ERROR,
-		RB_STOCK_PLAYING,
-		RB_STOCK_PAUSED,
 		RB_STOCK_TRAY_ICON,
 		RB_STOCK_SET_STAR,
 		RB_STOCK_UNSET_STAR,
Index: lib/rb-stock-icons.h
===================================================================
RCS file: /cvs/gnome/rhythmbox/lib/rb-stock-icons.h,v
retrieving revision 1.18
diff -u -r1.18 rb-stock-icons.h
--- lib/rb-stock-icons.h	27 Sep 2005 11:30:23 -0000	1.18
+++ lib/rb-stock-icons.h	3 Oct 2005 19:01:18 -0000
@@ -25,9 +25,6 @@
 
 G_BEGIN_DECLS
 
-#define RB_STOCK_PLAYBACK_ERROR "rhythmbox-playback-error"
-#define RB_STOCK_PLAYING       "rhythmbox-playing"
-#define RB_STOCK_PAUSED        "rhythmbox-paused"
 #define RB_STOCK_TRAY_ICON     "rhythmbox-tray-icon"
 #define RB_STOCK_SET_STAR      "rhythmbox-set-star"
 #define RB_STOCK_UNSET_STAR    "rhythmbox-unset-star"
Index: shell/rb-shell-player.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell-player.c,v
retrieving revision 1.172
diff -u -r1.172 rb-shell-player.c
--- shell/rb-shell-player.c	27 Sep 2005 11:30:24 -0000	1.172
+++ shell/rb-shell-player.c	3 Oct 2005 19:01:20 -0000
@@ -1863,6 +1863,8 @@
 		else
 			pstate = PLAY_BUTTON_STOP;
 
+		rb_entry_view_set_playing (view, TRUE);
+
 		action = gtk_action_group_get_action (player->priv->play_action_group,
 						      "ControlPlay");
 		g_object_set (G_OBJECT (action), "sensitive", TRUE, NULL);
@@ -1874,6 +1876,8 @@
 			pstate = PLAY_BUTTON_PLAY;
 		else
 			pstate = PLAY_BUTTON_STOP;
+
+		rb_entry_view_set_playing (view, FALSE);
 
 		action = gtk_action_group_get_action (player->priv->play_action_group,
 						      "ControlPlay");
Index: widgets/rb-entry-view.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/widgets/rb-entry-view.c,v
retrieving revision 1.99
diff -u -r1.99 rb-entry-view.c
--- widgets/rb-entry-view.c	28 Sep 2005 14:28:26 -0000	1.99
+++ widgets/rb-entry-view.c	3 Oct 2005 19:01:21 -0000
@@ -403,25 +403,27 @@
 static void
 rb_entry_view_init (RBEntryView *view)
 {
-	GtkWidget *dummy;
+	GtkIconTheme* icon_theme;
 	
 	view->priv = g_new0 (RBEntryViewPrivate, 1);
 
-	dummy = gtk_tree_view_new ();
-	view->priv->playing_pixbuf = gtk_widget_render_icon (dummy,
-							     RB_STOCK_PLAYING,
-							     GTK_ICON_SIZE_MENU,
-							     NULL);
-
-	view->priv->paused_pixbuf = gtk_widget_render_icon (dummy,
-							    RB_STOCK_PAUSED,
-							    GTK_ICON_SIZE_MENU,
-							    NULL);
-	view->priv->error_pixbuf = gtk_widget_render_icon (dummy,
-							   RB_STOCK_PLAYBACK_ERROR,
-							   GTK_ICON_SIZE_MENU,
-							   NULL);
-	gtk_widget_destroy (dummy);
+	icon_theme = gtk_icon_theme_get_default ();
+
+	view->priv->playing_pixbuf = gtk_icon_theme_load_icon (icon_theme,
+                                   			       "stock_volume-max", 
+                                   			       16,
+                                   			       0, 
+                                   			       NULL);
+	view->priv->paused_pixbuf = gtk_icon_theme_load_icon (icon_theme,
+                                   			      "stock_volume-0", 
+                                   			      16,
+                                   			      0, 
+                                   			      NULL);
+	view->priv->error_pixbuf = gtk_icon_theme_load_icon (icon_theme,
+                                   			     "stock_dialog-error", 
+                                   			     16,
+                                   			     0, 
+                                   			     NULL);
 
 	view->priv->propid_column_map = g_hash_table_new (NULL, NULL);
 	view->priv->column_sort_data_map = g_hash_table_new_full (NULL, NULL, NULL, g_free);
@@ -2107,9 +2109,19 @@
 rb_entry_view_set_playing (RBEntryView *view,
 			   gboolean playing)
 {
+	GtkTreePath *path;
+	GtkTreeIter iter;
+
 	g_return_if_fail (RB_IS_ENTRY_VIEW (view));
 
-	view->priv->playing = TRUE;
+	view->priv->playing = playing;
+	/* Redraw the treeview */
+	if (view->priv->playing_entry) {
+		rhythmdb_query_model_entry_to_iter (view->priv->playing_model, view->priv->playing_entry, &iter);
+		path = gtk_tree_model_get_path (GTK_TREE_MODEL (view->priv->playing_model), &iter);
+		gtk_tree_model_row_changed (GTK_TREE_MODEL (view->priv->playing_model), path, &iter);
+  		gtk_tree_path_free (path);
+	}
 }
 
 gboolean


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