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

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

index 4795731..0cf18b8 100644 (file)
@@ -9,9 +9,19 @@
    "* init" : [
     "{",
     "",
+    "\tthis.css = new Gtk.CssProvider();",
+    "\ttry {",
+    "\t\tthis.css.load_from_data(\"#editor-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 ",
+    "",
     "}",
     ""
    ],
+   "Gtk.CssProvider css" : "",
    "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
    "Gtk.SourceSearchContext searchcontext" : "",
    "bool hexpand" : true,
index 80870ec..27ca77e 100644 (file)
@@ -30,6 +30,7 @@ public class Xcls_GtkView : Object
 
         // my vars (def)
     public Gtk.Widget lastObj;
+    public Gtk.CssProvider css;
     public Xcls_MainWindow main_window;
     public Gtk.SourceSearchContext searchcontext;
     public int last_search_end;
@@ -61,6 +62,15 @@ public class Xcls_GtkView : Object
 
         {
         
+               this.css = new Gtk.CssProvider();
+               try {
+                       this.css.load_from_data("#editor-view { font: 10px Monospace;}");
+               } catch (Error e) {}
+               this.el.get_style_context().add_provider(this.css,
+                       Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
+                
+                        
+        
         }
 
         //listeners