[gtk+/gtk-style-context: 262/276] GtkCssProvider: Run through the widget path in the correct order.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-style-context: 262/276] GtkCssProvider: Run through the widget path in the correct order.
- Date: Sat, 23 Oct 2010 19:17:09 +0000 (UTC)
commit 88914c921767f9a34ebba656910ff5f947082b7a
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Oct 20 17:37:00 2010 +0200
GtkCssProvider: Run through the widget path in the correct order.
Comparing a selector with a widget path was being done backwards since
the change to use GtkContainer::get_path_for_child().
gtk/gtkcssprovider.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index e70ee14..001b062 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -848,12 +848,11 @@ compare_selector (GtkWidgetPath *path,
GSList *elements = selector->elements;
gboolean match = TRUE;
guint64 score = 0;
- guint len;
- guint i = 0;
+ gint i;
- len = gtk_widget_path_length (path);
+ i = gtk_widget_path_length (path) - 1;
- while (elements && match && i < len)
+ while (elements && match && i >= 0)
{
SelectorElement *elem;
guint8 elem_score;
@@ -874,7 +873,7 @@ compare_selector (GtkWidgetPath *path,
if (!match ||
(elem->elem_type == SELECTOR_GTYPE ||
elem->elem_type == SELECTOR_GLOB))
- i++;
+ i--;
if (!match &&
elem->elem_type != SELECTOR_TYPE_NAME &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]