[gnome-shell] st-theme: Make the custom stylesheets have higher priority
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] st-theme: Make the custom stylesheets have higher priority
- Date: Tue, 24 Jul 2012 09:12:00 +0000 (UTC)
commit 75e49610cbed17ae312ddd896f07503842390d27
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sun Jul 22 22:15:36 2012 -0300
st-theme: Make the custom stylesheets have higher priority
https://bugzilla.gnome.org/show_bug.cgi?id=680426
src/st/st-theme.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/st/st-theme.c b/src/st/st-theme.c
index adb29db..42d75cb 100644
--- a/src/st/st-theme.c
+++ b/src/st/st-theme.c
@@ -176,6 +176,9 @@ parse_stylesheet (const char *filename,
return NULL;
}
+ /* Extension stylesheet */
+ stylesheet->app_data = GUINT_TO_POINTER (FALSE);
+
return stylesheet;
}
@@ -230,6 +233,8 @@ st_theme_load_stylesheet (StTheme *theme,
if (!stylesheet)
return FALSE;
+ stylesheet->app_data = GUINT_TO_POINTER (TRUE);
+
insert_stylesheet (theme, path, stylesheet);
cr_stylesheet_ref (stylesheet);
theme->custom_stylesheets = g_slist_prepend (theme->custom_stylesheets, stylesheet);
@@ -958,6 +963,7 @@ compare_declarations (gconstpointer a,
/* g_ptr_array_sort() is broooken */
CRDeclaration *decl_a = *(CRDeclaration **) a;
CRDeclaration *decl_b = *(CRDeclaration **) b;
+ gboolean a_is_extension_sheet, b_is_extension_sheet;
int origin_a = get_origin (decl_a);
int origin_b = get_origin (decl_b);
@@ -968,6 +974,12 @@ compare_declarations (gconstpointer a,
if (decl_a->parent_statement->specificity != decl_b->parent_statement->specificity)
return decl_a->parent_statement->specificity - decl_b->parent_statement->specificity;
+ a_is_extension_sheet = GPOINTER_TO_UINT (decl_a->parent_statement->parent_sheet->app_data);
+ b_is_extension_sheet = GPOINTER_TO_UINT (decl_b->parent_statement->parent_sheet->app_data);
+
+ if (a_is_extension_sheet != b_is_extension_sheet)
+ return a_is_extension_sheet ? 1 : -1;
+
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]