[totem] Use dark theme and symbolic icons



commit 781e168a0b35783a650732cfba46670534dc7065
Author: Bastien Nocera <hadess hadess net>
Date:   Wed May 12 21:09:33 2010 +0100

    Use dark theme and symbolic icons
    
    Use GTK+ 3.0, a dark theme and symbolic icons.
    
    Missing justify icon for the sidebar. Some more icons missing.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=617921

 configure.in         |   18 +++++++++---------
 data/playlist.ui     |    4 ++--
 data/totem.ui        |   22 +++++++++++-----------
 src/totem-dnd-menu.c |    2 +-
 src/totem-object.c   |   48 ++++++++++++++++++++++++------------------------
 src/totem-playlist.c |   10 +++++-----
 src/totem.c          |    4 ++++
 7 files changed, 56 insertions(+), 52 deletions(-)
---
diff --git a/configure.in b/configure.in
index 770c83f..775d548 100644
--- a/configure.in
+++ b/configure.in
@@ -38,7 +38,7 @@ AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
 
 # Requirements
 GLIB_REQS=2.25.4
-GTK_REQS=2.19.5
+GTK_REQS=2.90.2
 TOTEM_PLPARSER_REQS=2.29.1
 GNOMEICON_REQS=2.15.90
 DBUS_REQS=0.61
@@ -148,7 +148,7 @@ do
 done
 
 dnl Check the smclient backend
-GDK_TARGET="$($PKG_CONFIG --variable target gdk-2.0)"
+GDK_TARGET="$($PKG_CONFIG --variable target gdk-3.0)"
 
 SMCLIENT_PKGS=
 AC_MSG_CHECKING([which smclient backend to use])
@@ -177,7 +177,7 @@ dnl Pkg-config checks
 PKG_CHECK_MODULES([DEPENDENCY],[
   glib-2.0 >= $GLIB_REQS
   gio-2.0
-  gtk+-2.0 >= $GTK_REQS
+  gtk+-3.0 >= $GTK_REQS
   gmodule-2.0
   gconf-2.0
   totem-plparser >= $TOTEM_PLPARSER_REQS
@@ -186,7 +186,7 @@ PKG_CHECK_MODULES([DEPENDENCY],[
 
 PKG_CHECK_MODULES(MM, $MM)
 
-PKG_CHECK_MODULES([GTK],[gtk+-2.0 gthread-2.0])
+PKG_CHECK_MODULES([GTK],[gtk+-3.0 gthread-2.0])
 GTK_LIBS="$GTK_LIBS $EXTRA_BACKEND_LIBS"
 AC_SUBST(GTK_LIBS)
 
@@ -196,13 +196,13 @@ PKG_CHECK_EXISTS([
   $ISO_CODES
   gnome-icon-theme >= $GNOMEICON_REQS])
 
-PKG_CHECK_MODULES([UNIQUE], unique-1.0)
+PKG_CHECK_MODULES([UNIQUE], unique-3.0)
 
 dnl *************************
 dnl X11 related functionality
 dnl *************************
 have_x11=no
-if test x$(pkg-config --variable=target gtk+-2.0) = xx11; then
+if test x$(pkg-config --variable=target gtk+-3.0) = xx11; then
 	AC_PATH_X
 
 	have_x11=yes
@@ -531,10 +531,10 @@ for plugin in ${used_plugins}; do
 		;;
 		brasero-disc-recorder)
 			dnl this is only needed to use brasero icons
-			PKG_CHECK_MODULES(DISC_RECORDER, libxml-2.0 >= 2.6.0 gtk+-x11-2.0,
+			PKG_CHECK_MODULES(DISC_RECORDER, libxml-2.0 >= 2.6.0 gtk+-x11-3.0,
 					[BUILD_RECORDER=yes], [BUILD_RECORDER=no])
 			if test "${BUILD_RECORDER}" != "yes" ; then
-				plugin_error_or_ignore "you need libxml-2.0 >= 2.6.0 and gtk+-x11-2.0 to use the brasero-disc-recorder plugin"
+				plugin_error_or_ignore "you need libxml-2.0 >= 2.6.0 and gtk+-x11-3.0 to use the brasero-disc-recorder plugin"
 				add_plugin="0"
 			fi
 		;;
@@ -694,7 +694,7 @@ AC_ARG_ENABLE(nautilus,
 	[ENABLE_NAUTILUS=yes]) dnl Default value
 
 if test x$ENABLE_NAUTILUS = "xyes" ; then
-	PKG_CHECK_MODULES(NAUTILUS, gtk+-2.0 gthread-2.0 libnautilus-extension,
+	PKG_CHECK_MODULES(NAUTILUS, gtk+-3.0 gthread-2.0 libnautilus-extension,
 			[HAVE_NAUTILUS=yes], [HAVE_NAUTILUS=no])
 fi
 
diff --git a/data/playlist.ui b/data/playlist.ui
index 244612b..4315a1e 100644
--- a/data/playlist.ui
+++ b/data/playlist.ui
@@ -251,7 +251,7 @@
 	  <child>
 	    <object class="GtkImage" id="image5">
 	      <property name="visible">True</property>
-	      <property name="stock">gtk-go-up</property>
+	      <property name="icon-name">go-up-symbolic</property>
 	      <property name="icon_size">4</property>
 	      <property name="xalign">0.5</property>
 	      <property name="yalign">0.5</property>
@@ -280,7 +280,7 @@
 	  <child>
 	    <object class="GtkImage" id="image6">
 	      <property name="visible">True</property>
-	      <property name="stock">gtk-go-down</property>
+	      <property name="icon-name">go-down-symbolic</property>
 	      <property name="icon_size">4</property>
 	      <property name="xalign">0.5</property>
 	      <property name="yalign">0.5</property>
diff --git a/data/totem.ui b/data/totem.ui
index c43be32..dfcbaa6 100644
--- a/data/totem.ui
+++ b/data/totem.ui
@@ -32,7 +32,7 @@
          <child>
             <object class="GtkAction" id="eject">
                <property name="label" translatable="yes">_Eject</property>
-               <property name="icon-name">media-eject</property>
+               <property name="icon-name">media-eject-symbolic</property>
                <property name="tooltip" translatable="yes">Eject the current disc</property>
                <signal name="activate" handler="eject_action_callback"/>
             </object>
@@ -50,7 +50,7 @@
          <child>
             <object class="GtkAction" id="play">
                <property name="label" translatable="yes">Play / P_ause</property>
-               <property name="stock-id">gtk-media-play</property>
+               <property name="icon-name">media-playback-start-symbolic</property>
                <property name="tooltip" translatable="yes">Play or pause the movie</property>
                <signal name="activate" handler="play_action_callback"/>
             </object>
@@ -103,7 +103,7 @@
          <child>
             <object class="GtkAction" id="fullscreen">
                <property name="label" translatable="yes">_Fullscreen</property>
-               <property name="stock-id">gtk-fullscreen</property>
+               <property name="icon-name">view-fullscreen-symbolic</property>
                <property name="tooltip" translatable="yes">Switch to fullscreen</property>
                <signal name="activate" handler="fullscreen_action_callback"/>
             </object>
@@ -196,7 +196,7 @@
          <child>
             <object class="GtkAction" id="next-chapter">
                <property name="label" translatable="yes">_Next Chapter/Movie</property>
-               <property name="stock-id">gtk-media-next</property>
+               <property name="icon-name">media-skip-forward-symbolic</property>
                <property name="tooltip" translatable="yes">Next chapter or movie</property>
                <signal name="activate" handler="next_chapter_action_callback"/>
             </object>
@@ -205,7 +205,7 @@
          <child>
             <object class="GtkAction" id="previous-chapter">
                <property name="label" translatable="yes">_Previous Chapter/Movie</property>
-               <property name="stock-id">gtk-media-previous</property>
+               <property name="icon-name">media-skip-backward-symbolic</property>
                <property name="tooltip" translatable="yes">Previous chapter or movie</property>
                <signal name="activate" handler="previous_chapter_action_callback"/>
             </object>
@@ -220,7 +220,7 @@
          <child>
             <object class="GtkAction" id="volume-up">
                <property name="label" translatable="yes">Volume _Up</property>
-               <property name="icon-name">audio-volume-high</property>
+               <property name="icon-name">audio-volume-high-symbolic</property>
                <property name="tooltip" translatable="yes">Increase volume</property>
                <signal name="activate" handler="volume_up_action_callback"/>
             </object>
@@ -229,7 +229,7 @@
          <child>
             <object class="GtkAction" id="volume-down">
                <property name="label" translatable="yes">Volume _Down</property>
-               <property name="icon-name">audio-volume-low</property>
+               <property name="icon-name">audio-volume-low-symbolic</property>
                <property name="tooltip" translatable="yes">Decrease volume</property>
                <signal name="activate" handler="volume_down_action_callback"/>
             </object>
@@ -286,9 +286,9 @@
          </child>
          <child>
             <object class="GtkToggleAction" id="sidebar">
-               <property name="label" translatable="yes">S_idebar</property>
                <property name="tooltip" translatable="yes">Show or hide the sidebar</property>
-               <property name="active">TRUE</property>
+	       <property name="active">TRUE</property>
+	       <property name="icon-name">format-justify-fill</property>
                <signal name="activate" handler="show_sidebar_action_callback"/>
             </object>
             <accelerator key="F9"/>
@@ -400,7 +400,7 @@
             <object class="GtkAction" id="skip-forward">
                <property name="label" translatable="yes">Skip _Forward</property>
                <property name="tooltip" translatable="yes">Skip forward</property>
-               <property name="stock-id">gtk-media-forward</property>
+               <property name="icon-name">media-seek-forward-symbolic</property>
                <signal name="activate" handler="skip_forward_action_callback"/>
             </object>
             <accelerator key="Right"/>
@@ -409,7 +409,7 @@
             <object class="GtkAction" id="skip-backwards">
                <property name="label" translatable="yes">Skip _Backwards</property>
                <property name="tooltip" translatable="yes">Skip backwards</property>
-               <property name="stock-id">gtk-media-rewind</property>
+               <property name="icon-name">media-seek-backward-symbolic</property>
                <signal name="activate" handler="skip_backwards_action_callback"/>
             </object>
             <accelerator key="Left"/>
diff --git a/src/totem-dnd-menu.c b/src/totem-dnd-menu.c
index fc08015..ffa6878 100644
--- a/src/totem-dnd-menu.c
+++ b/src/totem-dnd-menu.c
@@ -91,7 +91,7 @@ totem_drag_ask (gboolean show_add_to)
 
 	menu = gtk_menu_new ();
 
-	drag_append_drop_action_menu_item (menu, _("_Play Now"), "gtk-media-play", GDK_ACTION_MOVE, &dt);
+	drag_append_drop_action_menu_item (menu, _("_Play Now"), "media-playback-start-symbolic", GDK_ACTION_MOVE, &dt);
 
 	if (show_add_to != FALSE)
 		drag_append_drop_action_menu_item (menu, _("_Add to Playlist"), "gtk-add", GDK_ACTION_COPY, &dt);
diff --git a/src/totem-object.c b/src/totem-object.c
index 51ec6bb..4b19c46 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -1028,14 +1028,14 @@ play_pause_set_label (Totem *totem, TotemStates state)
 	case STATE_PLAYING:
 		totem_statusbar_set_text (TOTEM_STATUSBAR (totem->statusbar),
 				_("Playing"));
-		id = GTK_STOCK_MEDIA_PAUSE;
+		id = "media-playback-pause-symbolic";
 		tip = N_("Pause");
 		totem_playlist_set_playing (totem->playlist, TOTEM_PLAYLIST_STATUS_PLAYING);
 		break;
 	case STATE_PAUSED:
 		totem_statusbar_set_text (TOTEM_STATUSBAR (totem->statusbar),
 				_("Paused"));
-		id = GTK_STOCK_MEDIA_PLAY;
+		id = "media-playback-start-symbolic";
 		tip = N_("Play");
 		totem_playlist_set_playing (totem->playlist, TOTEM_PLAYLIST_STATUS_PAUSED);
 		break;
@@ -1044,7 +1044,7 @@ play_pause_set_label (Totem *totem, TotemStates state)
 				_("Stopped"));
 		totem_statusbar_set_time_and_length
 			(TOTEM_STATUSBAR (totem->statusbar), 0, 0);
-		id = GTK_STOCK_MEDIA_PLAY;
+		id = "media-playback-start-symbolic";
 		totem_playlist_set_playing (totem->playlist, TOTEM_PLAYLIST_STATUS_NONE);
 		tip = N_("Play");
 		break;
@@ -1056,7 +1056,7 @@ play_pause_set_label (Totem *totem, TotemStates state)
 	action = gtk_action_group_get_action (totem->main_action_group, "play");
 	g_object_set (G_OBJECT (action),
 			"tooltip", _(tip),
-			"stock-id", id, NULL);
+			"icon-name", id, NULL);
 
 	proxies = gtk_action_get_proxies (action);
 	for (l = proxies; l != NULL; l = l->next) {
@@ -2997,18 +2997,18 @@ totem_action_remote (Totem *totem, TotemRemoteCommand cmd, const char *url)
 	switch (cmd) {
 	case TOTEM_REMOTE_COMMAND_PLAY:
 		totem_action_play (totem);
-		icon_name = "gtk-media-play";
+		icon_name = "media-playback-start-symbolic";
 		break;
 	case TOTEM_REMOTE_COMMAND_PLAYPAUSE:
 		if (bacon_video_widget_is_playing (totem->bvw) == FALSE)
-			icon_name = "gtk-media-play";
+			icon_name = "media-playback-start-symbolic";
 		else
-			icon_name = "gtk-media-pause";
+			icon_name = "media-playback-pause-symbolic";
 		totem_action_play_pause (totem);
 		break;
 	case TOTEM_REMOTE_COMMAND_PAUSE:
 		totem_action_pause (totem);
-		icon_name = "gtk-media-pause";
+		icon_name = "media-playback-pause-symbolic";
 		break;
 	case TOTEM_REMOTE_COMMAND_STOP: {
 		char *mrl, *subtitle;
@@ -3023,7 +3023,7 @@ totem_action_remote (Totem *totem, TotemRemoteCommand cmd, const char *url)
 			g_free (mrl);
 			g_free (subtitle);
 		}
-		icon_name = "gtk-media-stop";
+		icon_name = "media-playback-stop-symbolic";
 		break;
 	};
 	case TOTEM_REMOTE_COMMAND_SEEK_FORWARD: {
@@ -3036,7 +3036,7 @@ totem_action_remote (Totem *totem, TotemRemoteCommand cmd, const char *url)
 		} else {
 			totem_action_seek_relative (totem, offset * 1000, FALSE);
 		}
-		icon_name = "gtk-media-forward";
+		icon_name = "media-seek-forward-symbolic";
 		break;
 	}
 	case TOTEM_REMOTE_COMMAND_SEEK_BACKWARD: {
@@ -3048,7 +3048,7 @@ totem_action_remote (Totem *totem, TotemRemoteCommand cmd, const char *url)
 			totem_action_seek_relative (totem, SEEK_BACKWARD_OFFSET * 1000, FALSE);
 		else
 			totem_action_seek_relative (totem,  - (offset * 1000), FALSE);
-		icon_name = "gtk-media-rewind";
+		icon_name = "media-seek-backward-symbolic";
 		break;
 	}
 	case TOTEM_REMOTE_COMMAND_VOLUME_UP:
@@ -3059,11 +3059,11 @@ totem_action_remote (Totem *totem, TotemRemoteCommand cmd, const char *url)
 		break;
 	case TOTEM_REMOTE_COMMAND_NEXT:
 		totem_action_next (totem);
-		icon_name = "gtk-media-next";
+		icon_name = "media-skip-forward-symbolic";
 		break;
 	case TOTEM_REMOTE_COMMAND_PREVIOUS:
 		totem_action_previous (totem);
-		icon_name = "gtk-media-previous";
+		icon_name = "media-skip-backward-symbolic";
 		break;
 	case TOTEM_REMOTE_COMMAND_FULLSCREEN:
 		totem_action_fullscreen_toggle (totem);
@@ -3409,9 +3409,9 @@ on_video_button_press_event (BaconVideoWidget *bvw, GdkEventButton *event,
 		if (totem_is_fullscreen (totem) != FALSE) {
 			const char *icon_name;
 			if (bacon_video_widget_is_playing (totem->bvw) == FALSE)
-				icon_name = "gtk-media-play";
+				icon_name = "media-playback-start-symbolic";
 			else
-				icon_name = "gtk-media-pause";
+				icon_name = "media-playback-pause-symbolic";
 			totem_fullscreen_show_popups_or_osd (totem->fs, icon_name, FALSE);
 		}
 		totem_action_play_pause (totem);
@@ -3522,7 +3522,7 @@ totem_action_handle_key_press (Totem *totem, GdkEventKey *event)
 	case GDK_B:
 	case GDK_b:
 		totem_action_previous (totem);
-		icon_name = "gtk-media-previous";
+		icon_name = "media-skip-backward-symbolic";
 		break;
 	case GDK_C:
 	case GDK_c:
@@ -3552,7 +3552,7 @@ totem_action_handle_key_press (Totem *totem, GdkEventKey *event)
 	case GDK_n:
 	case GDK_End:
 		totem_action_next (totem);
-		icon_name = "gtk-media-next";
+		icon_name = "media-skip-forward-symbolic";
 		break;
 	case GDK_OpenURL:
 		totem_action_fullscreen (totem, FALSE);
@@ -3571,9 +3571,9 @@ totem_action_handle_key_press (Totem *totem, GdkEventKey *event)
 			totem_action_show_properties (totem);
 		} else {
 			if (bacon_video_widget_is_playing (totem->bvw) == FALSE)
-				icon_name = "gtk-media-play";
+				icon_name = "media-playback-start-symbolic";
 			else
-				icon_name = "gtk-media-pause";
+				icon_name = "media-playback-pause-symbolic";
 			totem_action_play_pause (totem);
 		}
 		break;
@@ -3588,7 +3588,7 @@ totem_action_handle_key_press (Totem *totem, GdkEventKey *event)
 	case GDK_AudioPause:
 	case GDK_AudioStop:
 		totem_action_pause (totem);
-		icon_name = "gtk-media-pause";
+		icon_name = "media-playback-pause-symbolic";
 		break;
 	case GDK_q:
 	case GDK_Q:
@@ -3622,9 +3622,9 @@ totem_action_handle_key_press (Totem *totem, GdkEventKey *event)
 			    focus == GTK_WIDGET (totem->bvw) || focus == totem->seek) {
 				if (event->keyval == GDK_space) {
 					if (bacon_video_widget_is_playing (totem->bvw) == FALSE)
-						icon_name = "gtk-media-play";
+						icon_name = "media-playback-start-symbolic";
 					else
-						icon_name = "gtk-media-pause";
+						icon_name = "media-playback-pause-symbolic";
 					totem_action_play_pause (totem);
 				} else if (bacon_video_widget_has_menus (totem->bvw) != FALSE) {
 					bacon_video_widget_dvd_event (totem->bvw, BVW_DVD_ROOT_MENU_SELECT);
@@ -3642,7 +3642,7 @@ totem_action_handle_key_press (Totem *totem, GdkEventKey *event)
 			/* Switch direction in RTL environment */
 			if (gtk_widget_get_direction (totem->win) == GTK_TEXT_DIR_RTL)
 				is_forward = !is_forward;
-			icon_name = is_forward ? "gtk-media-forward" : "gtk-media-rewind";
+			icon_name = is_forward ? "media-seek-forward-symbolic" : "media-seek-backward-symbolic";
 
 			totem_action_handle_seek (totem, event, is_forward);
 		} else {
@@ -3654,7 +3654,7 @@ totem_action_handle_key_press (Totem *totem, GdkEventKey *event)
 		break;
 	case GDK_Home:
 		totem_action_seek (totem, 0);
-		icon_name = "gtk-media-rewind";
+		icon_name = "media-seek-backward-symbolic";
 		break;
 	case GDK_Up:
 		if (bacon_video_widget_has_menus (totem->bvw) != FALSE)
diff --git a/src/totem-playlist.c b/src/totem-playlist.c
index 06034b7..e026f3b 100644
--- a/src/totem-playlist.c
+++ b/src/totem-playlist.c
@@ -1243,22 +1243,22 @@ set_playing_icon (GtkTreeViewColumn *column, GtkCellRenderer *renderer,
 		  GtkTreeModel *model, GtkTreeIter *iter, TotemPlaylist *playlist)
 {
 	TotemPlaylistStatus playing;
-	const char *stock_id;
+	const char *icon_name;
 
 	gtk_tree_model_get (model, iter, PLAYING_COL, &playing, -1);
 
 	switch (playing) {
 		case TOTEM_PLAYLIST_STATUS_PLAYING:
-			stock_id = GTK_STOCK_MEDIA_PLAY;
+			icon_name = "media-playback-start-symbolic";
 			break;
 		case TOTEM_PLAYLIST_STATUS_PAUSED:
-			stock_id = GTK_STOCK_MEDIA_PAUSE;
+			icon_name = "media-playback-pause-symbolic";
 			break;
 		default:
-			stock_id = NULL;
+			icon_name = NULL;
 	}
 
-	g_object_set (renderer, "stock-id", stock_id, NULL);
+	g_object_set (renderer, "icon-name", icon_name, NULL);
 }
 
 static void
diff --git a/src/totem.c b/src/totem.c
index 1a9a6e4..77f56e2 100644
--- a/src/totem.c
+++ b/src/totem.c
@@ -138,6 +138,7 @@ main (int argc, char **argv)
 	GError *error = NULL;
 	GOptionContext *context;
 	GOptionGroup *baconoptiongroup;
+	GtkSettings *settings;
 	char *sidebar_pageid;
 
 	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
@@ -180,6 +181,9 @@ main (int argc, char **argv)
 	gtk_about_dialog_set_url_hook (about_url_hook, NULL, NULL);
 	gtk_about_dialog_set_email_hook (about_email_hook, NULL, NULL);
 
+	settings = gtk_settings_get_default ();
+	g_object_set (G_OBJECT (settings), "gtk-application-prefer-dark-theme", TRUE, NULL);
+
 	gc = gconf_client_get_default ();
 	if (gc == NULL)
 	{



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