[gtk/matthiasc/for-master: 13/13] Drop unnecessary uses of gtk_style_context_add_class
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 13/13] Drop unnecessary uses of gtk_style_context_add_class
- Date: Tue, 30 Jun 2020 21:43:22 +0000 (UTC)
commit c0e2d7c62f4b213dd7bb08546e2c3593c8129db9
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jun 30 17:39:37 2020 -0400
Drop unnecessary uses of gtk_style_context_add_class
We can use gtk_widget_add_css_class instead, most places.
demos/gtk-demo/dropdown.c | 2 +-
gtk/gtkcolumnview.c | 4 ++--
gtk/inspector/actions.c | 6 +++---
gtk/inspector/prop-list.c | 6 +++---
tests/testdropdown.c | 2 +-
5 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/demos/gtk-demo/dropdown.c b/demos/gtk-demo/dropdown.c
index d90643e433..bf82b9bd95 100644
--- a/demos/gtk-demo/dropdown.c
+++ b/demos/gtk-demo/dropdown.c
@@ -92,7 +92,7 @@ strings_setup_item_full (GtkSignalListItemFactory *factory,
gtk_label_set_xalign (GTK_LABEL (title), 0.0);
description = gtk_label_new ("");
gtk_label_set_xalign (GTK_LABEL (description), 0.0);
- gtk_style_context_add_class (gtk_widget_get_style_context (description), "dim-label");
+ gtk_widget_add_css_class (description, "dim-label");
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
diff --git a/gtk/gtkcolumnview.c b/gtk/gtkcolumnview.c
index 48f785d34a..acaa2b9b07 100644
--- a/gtk/gtkcolumnview.c
+++ b/gtk/gtkcolumnview.c
@@ -940,7 +940,7 @@ header_drag_end (GtkGestureDrag *gesture,
column = g_list_model_get_item (G_LIST_MODEL (self->columns), self->drag_pos);
header = gtk_column_view_column_get_header (column);
- gtk_style_context_remove_class (gtk_widget_get_style_context (header), "dnd");
+ gtk_widget_remove_css_class (header, "dnd");
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
if (!gtk_gesture_handles_sequence (GTK_GESTURE (gesture), sequence))
@@ -1027,7 +1027,7 @@ header_drag_update (GtkGestureDrag *gesture,
header = gtk_column_view_column_get_header (column);
gtk_widget_insert_after (header, self->header, gtk_widget_get_last_child (self->header));
- gtk_style_context_add_class (gtk_widget_get_style_context (header), "dnd");
+ gtk_widget_add_css_class (header, "dnd");
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
if (!gtk_widget_has_focus (GTK_WIDGET (self)))
diff --git a/gtk/inspector/actions.c b/gtk/inspector/actions.c
index db432e20ad..f8ddc2d79c 100644
--- a/gtk/inspector/actions.c
+++ b/gtk/inspector/actions.c
@@ -134,7 +134,7 @@ setup_parameter_cb (GtkSignalListItemFactory *factory,
label = gtk_label_new (NULL);
gtk_label_set_xalign (GTK_LABEL (label), 0.5);
gtk_list_item_set_child (list_item, label);
- gtk_style_context_add_class (gtk_widget_get_style_context (label), "cell");
+ gtk_widget_add_css_class (label, "cell");
}
static void
@@ -168,7 +168,7 @@ setup_state_cb (GtkSignalListItemFactory *factory,
gtk_widget_set_margin_end (label, 5);
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_list_item_set_child (list_item, label);
- gtk_style_context_add_class (gtk_widget_get_style_context (label), "cell");
+ gtk_widget_add_css_class (label, "cell");
}
static void
@@ -215,7 +215,7 @@ bind_changes_cb (GtkSignalListItemFactory *factory,
name = action_holder_get_name (ACTION_HOLDER (item));
editor = gtk_inspector_action_editor_new (group, name, NULL);
- gtk_style_context_add_class (gtk_widget_get_style_context (editor), "cell");
+ gtk_widget_add_css_class (editor, "cell");
gtk_list_item_set_child (list_item, editor);
}
diff --git a/gtk/inspector/prop-list.c b/gtk/inspector/prop-list.c
index 9ba203258f..0ca7343a84 100644
--- a/gtk/inspector/prop-list.c
+++ b/gtk/inspector/prop-list.c
@@ -314,7 +314,7 @@ setup_name_cb (GtkSignalListItemFactory *factory,
label = gtk_label_new (NULL);
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_list_item_set_child (list_item, label);
- gtk_style_context_add_class (gtk_widget_get_style_context (label), "cell");
+ gtk_widget_add_css_class (label, "cell");
}
static void
@@ -339,7 +339,7 @@ setup_type_cb (GtkSignalListItemFactory *factory,
label = gtk_label_new (NULL);
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_list_item_set_child (list_item, label);
- gtk_style_context_add_class (gtk_widget_get_style_context (label), "cell");
+ gtk_widget_add_css_class (label, "cell");
}
static void
@@ -369,7 +369,7 @@ setup_origin_cb (GtkSignalListItemFactory *factory,
label = gtk_label_new (NULL);
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_list_item_set_child (list_item, label);
- gtk_style_context_add_class (gtk_widget_get_style_context (label), "cell");
+ gtk_widget_add_css_class (label, "cell");
}
static void
diff --git a/tests/testdropdown.c b/tests/testdropdown.c
index 525e67f7c6..d207256271 100644
--- a/tests/testdropdown.c
+++ b/tests/testdropdown.c
@@ -97,7 +97,7 @@ strings_setup_item_full (GtkSignalListItemFactory *factory,
gtk_label_set_xalign (GTK_LABEL (title), 0.0);
description = gtk_label_new ("");
gtk_label_set_xalign (GTK_LABEL (description), 0.0);
- gtk_style_context_add_class (gtk_widget_get_style_context (description), "dim-label");
+ gtk_widget_add_css_class (description, "dim-label");
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]