[gjs] overrides: Allow specifying the CSS node name



commit c90238d969d6f4c96ea700921ad283cb92d1c53d
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Nov 16 17:23:06 2015 +0100

    overrides: Allow specifying the CSS node name
    
    GTK+ now uses CSS node names instead of style classes for most of its
    widgets. While style classes still work to customize the appearance,
    subclasses may want to override that node name to not inherit any style
    from the parent, so expose the functionality.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=758349

 modules/overrides/Gtk.js |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/modules/overrides/Gtk.js b/modules/overrides/Gtk.js
index 8a23977..7090a77 100644
--- a/modules/overrides/Gtk.js
+++ b/modules/overrides/Gtk.js
@@ -40,6 +40,9 @@ const GtkWidgetClass = new Lang.Class({
         let internalChildren = params.InternalChildren;
         delete params.InternalChildren;
 
+        let cssName = params.CssName;
+        delete params.CssName;
+
         if (template) {
             params._instance_init = function() {
                 this.init_template();
@@ -48,6 +51,9 @@ const GtkWidgetClass = new Lang.Class({
 
         this.parent(params);
 
+        if (cssName)
+            Gtk.Widget.set_css_name.call(this, cssName);
+
         if (template) {
             if (typeof template == 'string' &&
                 template.startsWith('resource:///'))


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