[Rhythmbox-devel] [PATCH] Use more icons from icon theme + default to gnome icons



Hi,

Attached patch does the following:

1. By default the gnome art is used instead of the bluecurve art. See [1]
2. rhythmbox-paused.png, rhythmbox-playback-error.png and rhythmbox-playing.png are now picked up from the icon theme
3. The playing indication column (i.e. the first column) now correctly changes to paused. This was broken


After applying this patch the following still needs to be done in CVS

1. mv data/art-clearlooks to data/art-bluecurve
2. remove rhythmbox-paused.png, rhythmbox-playback-error.png and rhythmbox-playing.png from data/art and data/art-bluecurve


Only doubt I have about the patch is the following call:
  gtk_widget_queue_draw (GTK_WIDGET(view->priv->treeview));

After pausing or playing the icon in the playing indication column needs to be updated. Only solution I found was to do a redraw of the whole treeview. This is probably not the most efficient solution.

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.

Regards,

Jaap

[1] http://mail.gnome.org/archives/rhythmbox-devel/2005-September/msg00200.html


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	2 Oct 2005 14:38:51 -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	2 Oct 2005 14:38:51 -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	2 Oct 2005 14:38:51 -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	2 Oct 2005 14:38:51 -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	2 Oct 2005 14:38:53 -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	2 Oct 2005 14:38:54 -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);
@@ -2109,7 +2111,9 @@
 {
 	g_return_if_fail (RB_IS_ENTRY_VIEW (view));
 
-	view->priv->playing = TRUE;
+	view->priv->playing = playing;
+	/* Redraw the treeview */
+	gtk_widget_queue_draw (GTK_WIDGET(view->priv->treeview));
 }
 
 gboolean


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