]> Pileus Git - ~andy/gtk/commitdiff
gtk-demo: Remove custom CSS demo
authorBenjamin Otte <otte@redhat.com>
Fri, 1 Feb 2013 17:58:40 +0000 (18:58 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 1 Feb 2013 20:57:40 +0000 (21:57 +0100)
Custom CSS is something that we don't want to advertise as there are too
many pitfalls for using it correctly. So remove the demo for it.

demos/gtk-demo/Makefile.am
demos/gtk-demo/demo.gresource.xml
demos/gtk-demo/fancy.css [deleted file]
demos/gtk-demo/theming_custom_css.c [deleted file]

index 6bf02d98ae83285894090af89a1bd253a63d22da..01a438759f6641d7f173003322f6b355a885b987 100644 (file)
@@ -47,7 +47,6 @@ demos =                                               \
        textview.c                              \
        textscroll.c                            \
        theming_style_classes.c                 \
-       theming_custom_css.c                    \
        toolpalette.c                           \
        transparent.c                           \
        tree_store.c                            \
@@ -134,7 +133,6 @@ RESOURCES=  $(demos)                        \
                css_pixbufs.css                 \
                css_shadows.css                 \
                cssview.css                     \
-               fancy.css                       \
                reset.css
 
 DISTCLEANFILES = demos.h
index 752bf0498b29a1fcc7bc6519ef7e7a44f7a038a0..f1c19b84ab95d62ce971f5dc753f298244fca547 100644 (file)
@@ -27,9 +27,6 @@
     <file>css_multiplebgs.css</file>
     <file>brick.png</file>
   </gresource>
-  <gresource prefix="/theming_custom_css">
-    <file>fancy.css</file>
-  </gresource>
   <gresource prefix="/theming_style_classes">
     <file preprocess="xml-stripblanks">theming.ui</file>
   </gresource>
     <file>textview.c</file>
     <file>textscroll.c</file>
     <file>theming_style_classes.c</file>
-    <file>theming_custom_css.c</file>
     <file>toolpalette.c</file>
     <file>transparent.c</file>
     <file>tree_store.c</file>
diff --git a/demos/gtk-demo/fancy.css b/demos/gtk-demo/fancy.css
deleted file mode 100644 (file)
index 97bd5dc..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-GtkButton#fancy {
-    transition: none;
-    background-image: linear-gradient(to bottom,
-                                      alpha(white, 0.7),
-                                      alpha(white, 0) 30%),
-                      linear-gradient(to top,
-                                      alpha(#babdb6, 0.4),
-                                      alpha(#babdb6, 0) 50%),
-                      linear-gradient(135deg,
-                                      #eeeeec,
-                                      white 20%,
-                                      #d3d7cf,
-                                      white 80%,
-                                      #babdb6);
-    color: #3465a4;
-    font-weight: bold;
-    text-shadow: 0 1px white;
-}
-
-GtkButton#fancy:hover {
-    transition: all 250ms linear;
-    background-image: linear-gradient(to bottom,
-                                      alpha(white, 1),
-                                      alpha(white, 0)),
-                      linear-gradient(135deg,
-                                      #eeeeec 10%,
-                                      white 40%,
-                                      #d3d7cf,
-                                      white 70%,
-                                      #babdb6);
-    color: #204a87;
-}
-
-GtkButton#fancy:active,
-GtkButton#fancy:active:hover {
-    transition: none;
-    background-image: linear-gradient(to bottom,
-                                      alpha(#555753, 0.5),
-                                      alpha(#babdb6, 0.3)),
-                      linear-gradient(135deg,
-                                      #eeeeec,
-                                      white 20%,
-                                      #d3d7cf,
-                                      white 80%,
-                                      #babdb6);
-    color: white;
-    text-shadow: 0 1px black;
-}
-
-GtkButton#fancy:backdrop,
-GtkButton#fancy:backdrop:hover {
-    transition: none;
-    background-image: linear-gradient(135deg,
-                                      alpha(#eeeeec, 0.5) 10%,
-                                      alpha(white, 0.5) 40%,
-                                      alpha(#d3d7cf, 0.5),
-                                      alpha(white, 0.5) 70%,
-                                      alpha(#babdb6, 0.5));
-    color: #babdb6;
-}
-
-GtkButton#fancy * {
-    /* Yeah this should be inherited by default */
-    color: inherit;
-}
diff --git a/demos/gtk-demo/theming_custom_css.c b/demos/gtk-demo/theming_custom_css.c
deleted file mode 100644 (file)
index 8a8e25e..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/* CSS Theming/Custom CSS
- *
- * GTK+ uses CSS for theming. If required, applications can
- * install their own custom CSS style provider to achieve
- * special effects.
- *
- * Doing this has the downside that your application will no
- * longer react to the users theme preferences, so this should
- * be used sparingly.
- */
-
-#include <gtk/gtk.h>
-
-static GtkWidget *window = NULL;
-
-GtkWidget *
-do_theming_custom_css (GtkWidget *do_widget)
-{
-  GtkWidget *box;
-  GtkWidget *button;
-  GtkCssProvider *provider;
-  GBytes *bytes;
-
-  if (!window)
-    {
-      window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-      gtk_window_set_screen (GTK_WINDOW (window),
-                             gtk_widget_get_screen (do_widget));
-      gtk_window_set_title (GTK_WINDOW (window), "Custom CSS");
-      gtk_container_set_border_width (GTK_CONTAINER (window), 18);
-      g_signal_connect (window, "destroy",
-                        G_CALLBACK (gtk_widget_destroyed), &window);
-      box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-      gtk_container_add (GTK_CONTAINER (window), box);
-      button = gtk_button_new_with_label ("Plain");
-      gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, 0);
-      button = gtk_button_new_with_label ("Fancy");
-      gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, 0);
-      gtk_widget_set_name (button, "fancy");
-
-      provider = gtk_css_provider_new ();
-      bytes = g_resources_lookup_data ("/theming_custom_css/fancy.css", 0, NULL);
-      gtk_css_provider_load_from_data (provider, g_bytes_get_data (bytes, NULL),
-                                       g_bytes_get_size (bytes), NULL);
-      gtk_style_context_add_provider_for_screen (gtk_widget_get_screen (do_widget),
-                                                 GTK_STYLE_PROVIDER (provider),
-                                                 GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-      g_object_unref (provider);
-      g_bytes_unref (bytes);
-
-      gtk_widget_show_all (box);
-    }
-
-  if (!gtk_widget_get_visible (window))
-    {
-      gtk_widget_show (window);
-    }
-  else
-    {
-      gtk_widget_destroy (window);
-      window = NULL;
-    }
-
-  return window;
-}