[gtk+] notebook: Use the element name notebook



commit f194b9608adaed0df820bc5c2988caafdcb80e4d
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Oct 24 10:10:33 2015 -0400

    notebook: Use the element name notebook
    
    Switch GtkNotebook from using the .notebook style class to
    using the element name notebook for its main css node.

 gtk/gtknotebook.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 3dd1621..7dd8bf6 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -1165,13 +1165,13 @@ gtk_notebook_class_init (GtkNotebookClass *class)
   add_tab_bindings (binding_set, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD);
 
   gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_NOTEBOOK_ACCESSIBLE);
+  gtk_widget_class_set_css_name (widget_class, "notebook");
 }
 
 static void
 gtk_notebook_init (GtkNotebook *notebook)
 {
   GtkNotebookPrivate *priv;
-  GtkStyleContext *context;
   GtkCssNode *widget_node;
 
   gtk_widget_set_can_focus (GTK_WIDGET (notebook), TRUE);
@@ -1220,9 +1220,6 @@ gtk_notebook_init (GtkNotebook *notebook)
 
   gtk_drag_dest_set_track_motion (GTK_WIDGET (notebook), TRUE);
 
-  context = gtk_widget_get_style_context (GTK_WIDGET (notebook));
-  gtk_style_context_add_class (context, GTK_STYLE_CLASS_NOTEBOOK);
-
   widget_node = gtk_widget_get_css_node (GTK_WIDGET (notebook));
   priv->tabs_node = gtk_css_node_new ();
   gtk_css_node_set_name (priv->tabs_node, I_("tabs"));
@@ -7411,14 +7408,11 @@ gtk_notebook_set_show_tabs (GtkNotebook *notebook,
           else
             gtk_widget_hide (page->tab_label);
         }
-
-      gtk_style_context_remove_class (context, GTK_STYLE_CLASS_NOTEBOOK);
     }
   else
     {
       gtk_widget_set_can_focus (GTK_WIDGET (notebook), TRUE);
       gtk_notebook_update_labels (notebook);
-      gtk_style_context_add_class (context, GTK_STYLE_CLASS_NOTEBOOK);
     }
 
   for (i = 0; i < N_ACTION_WIDGETS; i++)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]