[gtk+] gtk-demo: Move Theming to Theming/Style Classes



commit 5e7f8e43334e27463e084e061ed3307526e7f2c2
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri May 25 20:39:59 2012 -0400

    gtk-demo: Move Theming to Theming/Style Classes
    
    And make the title :: parsing work for nested titles too,
    so this works.

 demos/gtk-demo/Makefile.am                         |    2 +-
 demos/gtk-demo/main.c                              |   18 ++++++++++++------
 .../{theming.c => theming_style_classes.c}         |    4 ++--
 3 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/demos/gtk-demo/Makefile.am b/demos/gtk-demo/Makefile.am
index 0c4da0f..7e90f2d 100644
--- a/demos/gtk-demo/Makefile.am
+++ b/demos/gtk-demo/Makefile.am
@@ -43,7 +43,7 @@ demos =						\
 	stock_browser.c				\
 	textview.c				\
 	textscroll.c				\
-	theming.c				\
+	theming_style_classes.c			\
 	toolpalette.c				\
 	transparent.c				\
 	tree_store.c				\
diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
index df2a6c6..ce362a2 100644
--- a/demos/gtk-demo/main.c
+++ b/demos/gtk-demo/main.c
@@ -623,12 +623,18 @@ load_file (const gchar *filename)
           while (*p == '/' || *p == '*' || g_ascii_isspace (*p))
             p++;
           r = p;
-          while (*r != '/' && *r != ':' && *r != '\0')
-            r++;
-          if (*r == '/')
-            p = r + 1;
-          if (r[0] == ':' && r[1] == ':')
-            *r = '\0';
+          while (*r != '\0')
+            {
+              while (*r != '/' && *r != ':' && *r != '\0')
+                r++;
+              if (*r == '/')
+                {
+                  r++;
+                  p = r;
+                }
+              if (r[0] == ':' && r[1] == ':')
+                *r = '\0';
+            }
           q = p + strlen (p);
           while (q > p && g_ascii_isspace (*(q - 1)))
             q--;
diff --git a/demos/gtk-demo/theming.c b/demos/gtk-demo/theming_style_classes.c
similarity index 94%
rename from demos/gtk-demo/theming.c
rename to demos/gtk-demo/theming_style_classes.c
index a74ec6c..b00e4dc 100644
--- a/demos/gtk-demo/theming.c
+++ b/demos/gtk-demo/theming_style_classes.c
@@ -1,4 +1,4 @@
-/* Theming :: theming.ui
+/* Theming/Style Classes :: theming.ui
  *
  * GTK+ uses CSS for theming. Style classes can be associated
  * with widgets to inform the theme about intended rendering.
@@ -14,7 +14,7 @@
 static GtkWidget *window = NULL;
 
 GtkWidget *
-do_theming (GtkWidget *do_widget)
+do_theming_style_classes (GtkWidget *do_widget)
 {
   GtkWidget *grid;
   GtkBuilder *builder;



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