src/Builder4/GtkView.bjs
authorAlan Knowles <alan@roojs.com>
Sun, 25 Sep 2022 03:31:01 +0000 (11:31 +0800)
committerAlan Knowles <alan@roojs.com>
Sun, 25 Sep 2022 03:31:01 +0000 (11:31 +0800)
src/Builder4/GtkView.vala

src/Builder4/GtkView.bjs
src/Builder4/GtkView.vala

index f054c4a..78f7d85 100644 (file)
            "* init" : [
             "{",
             "   ",
+            "   ",
+            "   \tthis.css = new Gtk.CssProvider();",
+            "\ttry {",
+            "\t\tthis.css.load_from_data(\"#gtkview-view { font: 10px Monospace;}\");",
+            "\t} catch (Error e) {}",
+            "\tthis.el.get_style_context().add_provider(this.css,",
+            "\t\tGtk.STYLE_PROVIDER_PRIORITY_APPLICATION);",
+            "\t ",
+            "\t\t",
             "    var description =   Pango.FontDescription.from_string(\"monospace\");",
             "    description.set_size(8000);",
             "    this.el.override_font(description);",
index 9ae054a..6a4d8b5 100644 (file)
@@ -596,6 +596,15 @@ public class Xcls_GtkView : Object
 
             {
                
+               
+                       this.css = new Gtk.CssProvider();
+               try {
+                       this.css.load_from_data("#gtkview-view { font: 10px Monospace;}");
+               } catch (Error e) {}
+               this.el.get_style_context().add_provider(this.css,
+                       Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
+                
+                       
                 var description =   Pango.FontDescription.from_string("monospace");
                 description.set_size(8000);
                 this.el.override_font(description);