[gnome-settings-daemon] media-keys: Use symbolic icons for OSD



commit 5f4304d120f78527ffdbb4da500c0f14c4c3f675
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jan 18 16:20:04 2011 +0000

    media-keys: Use symbolic icons for OSD
    
    Prefer symbolic icons in the OSD. Use the new "use-fallback" property
    of GtkImage to make sure that the fallback icons will be loaded if
    necessary.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=639772

 plugins/media-keys/gsd-media-keys-window.c |   21 +++++++++++----------
 plugins/media-keys/test-media-window.c     |    2 +-
 2 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-window.c b/plugins/media-keys/gsd-media-keys-window.c
index 580cd1d..71a6d54 100644
--- a/plugins/media-keys/gsd-media-keys-window.c
+++ b/plugins/media-keys/gsd-media-keys-window.c
@@ -83,9 +83,9 @@ action_changed (GsdMediaKeysWindow *window)
                         volume_controls_set_visible (window, TRUE);
 
                         if (window->priv->volume_muted) {
-                                window_set_icon_name (window, "audio-volume-muted");
+                                window_set_icon_name (window, "audio-volume-muted-symbolic");
                         } else {
-                                window_set_icon_name (window, "audio-volume-high");
+                                window_set_icon_name (window, "audio-volume-high-symbolic");
                         }
 
                         break;
@@ -124,9 +124,9 @@ volume_muted_changed (GsdMediaKeysWindow *window)
 
         if (!gsd_osd_window_is_composited (GSD_OSD_WINDOW (window))) {
                 if (window->priv->volume_muted) {
-                        window_set_icon_name (window, "audio-volume-muted");
+                        window_set_icon_name (window, "audio-volume-muted-symbolic");
                 } else {
-                        window_set_icon_name (window, "audio-volume-high");
+                        window_set_icon_name (window, "audio-volume-high-symbolic");
                 }
         }
 }
@@ -208,7 +208,7 @@ load_pixbuf (GsdMediaKeysWindow *window,
         pixbuf = gtk_icon_theme_load_icon (theme,
                                            name,
                                            icon_size,
-                                           GTK_ICON_LOOKUP_FORCE_SIZE,
+                                           GTK_ICON_LOOKUP_FORCE_SIZE | GTK_ICON_LOOKUP_GENERIC_FALLBACK,
                                            NULL);
 
         return pixbuf;
@@ -357,10 +357,10 @@ render_speaker (GsdMediaKeysWindow *window,
         int                icon_size;
         int                n;
         static const char *icon_names[] = {
-                "audio-volume-muted",
-                "audio-volume-low",
-                "audio-volume-medium",
-                "audio-volume-high",
+                "audio-volume-muted-symbolic",
+                "audio-volume-low-symbolic",
+                "audio-volume-medium-symbolic",
+                "audio-volume-high-symbolic",
                 NULL
         };
 
@@ -625,7 +625,7 @@ draw_action_custom (GsdMediaKeysWindow *window,
                              cr,
                              icon_box_x0, icon_box_y0,
                              icon_box_width, icon_box_height);
-        if (! res && g_strcmp0 (window->priv->icon_name, "media-eject") == 0) {
+        if (! res && g_str_has_prefix (window->priv->icon_name, "media-eject")) {
                 /* draw eject symbol */
                 draw_eject (cr,
                             icon_box_x0, icon_box_y0,
@@ -693,6 +693,7 @@ gsd_media_keys_window_init (GsdMediaKeysWindow *window)
                                                    NULL);
 
                 window->priv->image = GTK_IMAGE (gtk_builder_get_object (builder, "acme_image"));
+                g_object_set (G_OBJECT (window->priv->image), "use-fallback", TRUE, NULL);
                 window->priv->progress = GTK_WIDGET (gtk_builder_get_object (builder, "acme_volume_progressbar"));
                 box = GTK_WIDGET (gtk_builder_get_object (builder, "acme_box"));
 
diff --git a/plugins/media-keys/test-media-window.c b/plugins/media-keys/test-media-window.c
index c6e9ec3..2ea34de 100644
--- a/plugins/media-keys/test-media-window.c
+++ b/plugins/media-keys/test-media-window.c
@@ -63,7 +63,7 @@ update_state (GtkWidget *window)
                 break;
         case 4:
                 gsd_media_keys_window_set_action_custom (GSD_MEDIA_KEYS_WINDOW (window),
-                                                         "media-eject",
+                                                         "media-eject-symbolic",
                                                          FALSE);
 
                 gtk_widget_show (window);



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