diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2011-01-19 04:12:08 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2011-01-19 04:28:49 +0100 |
commit | 0b7496558d0d4a3f5e2d31b4cbbc9ce20e1d06fc (patch) | |
tree | 01b177c3be58945aa7c2fbdc1aa2785721cef654 /gtk/gtkwidgetpath.c | |
parent | 0c5ceaf757be64372d7a92bb5aa49ae97d25bc1f (diff) | |
download | gtk+-0b7496558d0d4a3f5e2d31b4cbbc9ce20e1d06fc.tar.gz |
Make GtkCssProvider deal with widget types not being in plain CamelCase
Fixes bug #BugĀ 639754, reported by Kjell Ahlstedt. gtkmm doesn't
use plain CamelCase for its widget type names, so in order to
distinguish widget type names from regions in the CSS parser,
the following checks are now done:
* if it contains an uppercase letter -> widget class (that should
also work for gtkmm)
* if it's a string compound by lowercase letters and '-' -> it's
a region, checks have been added in gtk_style_context_add_region()
and gtk_widget_path_iter_add_region() to ensure this.
Diffstat (limited to 'gtk/gtkwidgetpath.c')
-rw-r--r-- | gtk/gtkwidgetpath.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk/gtkwidgetpath.c b/gtk/gtkwidgetpath.c index 6636abdd14..f0ae30ea14 100644 --- a/gtk/gtkwidgetpath.c +++ b/gtk/gtkwidgetpath.c @@ -730,6 +730,9 @@ gtk_widget_path_iter_has_class (const GtkWidgetPath *path, * the hierarchy defined in @path. See * gtk_style_context_add_region(). * + * <note><para>Region names must only contain lowercase letters + * and '-', starting always with a lowercase letter.</para></note> + * * Since: 3.0 **/ void @@ -744,6 +747,7 @@ gtk_widget_path_iter_add_region (GtkWidgetPath *path, g_return_if_fail (path != NULL); g_return_if_fail (path->elems->len != 0); g_return_if_fail (name != NULL); + g_return_if_fail (_gtk_style_context_check_region_name (name)); if (pos < 0 || pos > path->elems->len) pos = path->elems->len - 1; |