]> Pileus Git - ~andy/gtk/commitdiff
gtk-demo: Replace logo with a transparent one
authorBenjamin Otte <otte@redhat.com>
Fri, 1 Feb 2013 20:56:36 +0000 (21:56 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 1 Feb 2013 20:57:40 +0000 (21:57 +0100)
That way, we don't have to make it transparent in all the demos.

demos/gtk-demo/Makefile.am
demos/gtk-demo/appwindow.c
demos/gtk-demo/demo.gresource.xml
demos/gtk-demo/gtk-logo-old.png [new file with mode: 0644]
demos/gtk-demo/gtk-logo-rgb.gif [deleted file]
demos/gtk-demo/images.c
demos/gtk-demo/main.c
demos/gtk-demo/textview.c

index 01a438759f6641d7f173003322f6b355a885b987..ad38a3ed0fa0a0829a98246fa99a81f297b4c4c7 100644 (file)
@@ -126,7 +126,7 @@ RESOURCES=  $(demos)                        \
                gnu-keys.png                    \
                gtk-logo-24.png                 \
                gtk-logo-48.png                 \
-               gtk-logo-rgb.gif                \
+               gtk-logo-old.png                \
                css_accordion.css               \
                css_basics.css                  \
                css_multiplebgs.css             \
index e076075dd7a2a182325194fdaa4c495f8e39440a..849a3f1bc874900affb48cb20b8e9721a8ab13c0 100644 (file)
@@ -80,7 +80,7 @@ static void
 about_cb (GtkAction *action,
           GtkWidget *window)
 {
-  GdkPixbuf *pixbuf, *transparent;
+  GdkPixbuf *pixbuf;
 
   const gchar *authors[] = {
     "Peter Mattis",
@@ -98,11 +98,9 @@ about_cb (GtkAction *action,
     NULL
   };
 
-  pixbuf = gdk_pixbuf_new_from_resource ("/appwindow/gtk-logo-rgb.gif", NULL);
+  pixbuf = gdk_pixbuf_new_from_resource ("/appwindow/gtk-logo-old.png", NULL);
   /* We asser the existence of the pixbuf as we load it from a custom resource. */
   g_assert (pixbuf);
-  transparent = gdk_pixbuf_add_alpha (pixbuf, TRUE, 0xff, 0xff, 0xff);
-  g_object_unref (pixbuf);
 
   gtk_show_about_dialog (GTK_WINDOW (window),
                          "program-name", "GTK+ Code Demos",
@@ -117,11 +115,11 @@ about_cb (GtkAction *action,
                          "comments", "Program to demonstrate GTK+ functions.",
                          "authors", authors,
                          "documenters", documentors,
-                         "logo", transparent,
+                         "logo", pixbuf,
                          "title", "About GTK+ Code Demos",
                          NULL);
 
-  g_object_unref (transparent);
+  g_object_unref (pixbuf);
 }
 
 typedef struct
@@ -303,7 +301,6 @@ register_stock_icons (void)
       GdkPixbuf *pixbuf;
       GtkIconFactory *factory;
       GtkIconSet *icon_set;
-      GdkPixbuf *transparent;
 
       static GtkStockItem items[] = {
         { "demo-gtk-logo",
@@ -320,18 +317,14 @@ register_stock_icons (void)
       factory = gtk_icon_factory_new ();
       gtk_icon_factory_add_default (factory);
 
-      pixbuf = gdk_pixbuf_new_from_resource ("/appwindow/gtk-logo-rgb.gif", NULL);
+      pixbuf = gdk_pixbuf_new_from_resource ("/appwindow/gtk-logo-old.png", NULL);
       /* We assert the existence of the pixbuf as we load it from a custom resource. */
       g_assert (pixbuf);
 
-      /* The gtk-logo-rgb icon has a white background, make it transparent */
-      transparent = gdk_pixbuf_add_alpha (pixbuf, TRUE, 0xff, 0xff, 0xff);
-
-      icon_set = gtk_icon_set_new_from_pixbuf (transparent);
+      icon_set = gtk_icon_set_new_from_pixbuf (pixbuf);
       gtk_icon_factory_add (factory, "demo-gtk-logo", icon_set);
       gtk_icon_set_unref (icon_set);
       g_object_unref (pixbuf);
-      g_object_unref (transparent);
 
       /* Drop our reference to the factory, GTK will hold a reference. */
       g_object_unref (factory);
index 7e60c3553a1a001f35b265bea9cebaaf7f79fbab..18d6732c99c059e4ece1086984a245c1866c17da 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gresources>
   <gresource prefix="/">
-    <file>gtk-logo-rgb.gif</file>
+    <file>gtk-logo-old.png</file>
   </gresource>
   <gresource prefix="/application">
     <file preprocess="to-pixdata">gtk-logo-24.png</file>
@@ -10,7 +10,7 @@
     <file preprocess="xml-stripblanks">menus.ui</file>
   </gresource>
   <gresource prefix="/appwindow">
-    <file preprocess="to-pixdata">gtk-logo-rgb.gif</file>
+    <file preprocess="to-pixdata">gtk-logo-old.png</file>
   </gresource>
   <gresource prefix="/builder">
     <file>demo.ui</file>
@@ -58,7 +58,7 @@
   <gresource prefix="/images">
     <file>alphatest.png</file>
     <file>floppybuddy.gif</file>
-    <file>gtk-logo-rgb.gif</file>
+    <file>gtk-logo-old.png</file>
   </gresource>
   <gresource prefix="/pixbufs">
     <file>apple-red.png</file>
   </gresource>
   <gresource prefix="/textview">
     <file>floppybuddy.gif</file>
-    <file>gtk-logo-rgb.gif</file>
+    <file>gtk-logo-old.png</file>
   </gresource>
 </gresources>
diff --git a/demos/gtk-demo/gtk-logo-old.png b/demos/gtk-demo/gtk-logo-old.png
new file mode 100644 (file)
index 0000000..e6037ae
Binary files /dev/null and b/demos/gtk-demo/gtk-logo-old.png differ
diff --git a/demos/gtk-demo/gtk-logo-rgb.gif b/demos/gtk-demo/gtk-logo-rgb.gif
deleted file mode 100644 (file)
index 63c622b..0000000
Binary files a/demos/gtk-demo/gtk-logo-rgb.gif and /dev/null differ
index d29ea97adb7b5d2159b7757f3b6f5b38ca393691..4065ee54c786f1cc8854131a0e52bca2605ee127 100644 (file)
@@ -361,7 +361,7 @@ do_images (GtkWidget *do_widget)
       gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
       gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
 
-      pixbuf = gdk_pixbuf_new_from_resource ("/images/gtk-logo-rgb.gif", NULL);
+      pixbuf = gdk_pixbuf_new_from_resource ("/images/gtk-logo-old.png", NULL);
       /* The image loading must work, we ensure that the resources are valid. */
       g_assert (pixbuf);
 
index fe0260b6060460c106f66728265018886cd7a2fe..8bf10147878568d97e97101d7fbf94e09c653669 100644 (file)
@@ -850,19 +850,15 @@ create_tree (void)
 static void
 setup_default_icon (void)
 {
-  GdkPixbuf *pixbuf, *transparent;
+  GdkPixbuf *pixbuf;
 
-  pixbuf = gdk_pixbuf_new_from_resource ("/gtk-logo-rgb.gif", NULL);
+  pixbuf = gdk_pixbuf_new_from_resource ("/gtk-logo-old.png", NULL);
   /* We load a resource, so we can guarantee that loading it is successful */
   g_assert (pixbuf);
 
-  /* The gtk-logo-rgb icon has a white background, make it transparent */
-  transparent = gdk_pixbuf_add_alpha (pixbuf, TRUE, 0xff, 0xff, 0xff);
-
-  gtk_window_set_default_icon (transparent);
+  gtk_window_set_default_icon (pixbuf);
   
   g_object_unref (pixbuf);
-  g_object_unref (transparent);
 }
 
 int
index c4017908036df86714ca4b910c119dd35dfd1724..2bb6e2866d380923a82de6b9f92ce3a3b47b83bb 100644 (file)
@@ -131,7 +131,7 @@ insert_text (GtkTextBuffer *buffer)
   GdkPixbuf *pixbuf;
   GdkPixbuf *scaled;
 
-  pixbuf = gdk_pixbuf_new_from_resource ("/textview/gtk-logo-rgb.gif", NULL);
+  pixbuf = gdk_pixbuf_new_from_resource ("/textview/gtk-logo-old.png", NULL);
   g_assert (pixbuf);
 
   scaled = gdk_pixbuf_scale_simple (pixbuf, 32, 32, GDK_INTERP_BILINEAR);