Drop unnecessary uses of gtk_style_context_add_class

We can use gtk_widget_add_css_class instead, most places.
This commit is contained in:
Matthias Clasen 2020-06-30 17:39:37 -04:00
parent e25c25fcb5
commit c0e2d7c62f
5 changed files with 10 additions and 10 deletions

View File

@ -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);

View File

@ -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)))

View File

@ -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);
}

View File

@ -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

View File

@ -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);