[gtk+] label: Use the element name label
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] label: Use the element name label
- Date: Fri, 23 Oct 2015 03:27:58 +0000 (UTC)
commit 7d98c7f1aebb96f920cfc2e6abe40e9fc72e5d5c
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Oct 22 23:18:30 2015 -0400
label: Use the element name label
Set the element name on the CSS node, and drop the .label style
class.
gtk/gtklabel.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 25dcb3c..e10558f 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -71,6 +71,10 @@
* implies, most labels are used to label another widget such as a
* #GtkButton, a #GtkMenuItem, or a #GtkComboBox.
*
+ * # CSS nodes
+ *
+ * GtkLabel has a single CSS node with the name label.
+ *
* # GtkLabel as GtkBuildable
*
* The GtkLabel implementation of the GtkBuildable interface supports a
@@ -1146,6 +1150,8 @@ gtk_label_class_init (GtkLabelClass *class)
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_LABEL_ACCESSIBLE);
+ gtk_widget_class_set_css_name (widget_class, "label");
+
quark_shortcuts_connected = g_quark_from_static_string ("gtk-label-shortcuts-connected");
quark_mnemonic_menu = g_quark_from_static_string ("gtk-mnemonic-menu");
quark_mnemonics_visible_connected = g_quark_from_static_string ("gtk-label-mnemonics-visible-connected");
@@ -1310,7 +1316,6 @@ static void
gtk_label_init (GtkLabel *label)
{
GtkLabelPrivate *priv;
- GtkStyleContext *context;
label->priv = gtk_label_get_instance_private (label);
priv = label->priv;
@@ -1347,9 +1352,6 @@ gtk_label_init (GtkLabel *label)
gtk_label_set_text (label, "");
- context = gtk_widget_get_style_context (GTK_WIDGET (label));
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_LABEL);
-
priv->drag_gesture = gtk_gesture_drag_new (GTK_WIDGET (label));
g_signal_connect (priv->drag_gesture, "drag-begin",
G_CALLBACK (gtk_label_drag_gesture_begin), label);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]