src/Builder4/ValaCompileErrors.bjs
authorAlan Knowles <alan@roojs.com>
Mon, 17 Oct 2022 07:59:06 +0000 (15:59 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 17 Oct 2022 07:59:06 +0000 (15:59 +0800)
src/Builder4/ValaCompileErrors.vala

src/Builder4/ValaCompileErrors.bjs
src/Builder4/ValaCompileErrors.vala

index e2961f6..794e6ab 100644 (file)
          "$ xns" : "Gtk",
          "* init" : [
           "{",
-          " var description = new Pango.FontDescription();",
-          "    description.set_size(10000);",
-          "    this.el.override_font(description);",
-          "",
+          "  this.css = new Gtk.CssProvider();",
+          "\ttry {",
+          "\t\tthis.css.load_from_data(\"#compile-erros-view { font-size: 10px;}\");",
+          "\t} catch (Error e) {}",
+          "\tthis.el.get_style_context().add_provider(this.css,",
+          "\t\tGtk.STYLE_PROVIDER_PRIORITY_APPLICATION);",
+          "\t ",
+          "\t ",
           "}",
           ""
          ],
            "    "
           ]
          },
+         "string name" : "compile-erros-view",
          "xtype" : "TreeView"
         }
        ],
index 508aa87..3a188f6 100644 (file)
@@ -264,6 +264,7 @@ public class Xcls_ValaCompileErrors : Object
             // my vars (dec)
 
             // set gobject values
+            this.el.name = "compile-erros-view";
             var child_0 = new Xcls_compile_result_store( _this );
             child_0.ref();
             this.el.set_model (  child_0.el  );
@@ -274,10 +275,14 @@ public class Xcls_ValaCompileErrors : Object
             // init method
 
             {
-             var description = new Pango.FontDescription();
-                description.set_size(10000);
-                this.el.override_font(description);
-            
+              this.css = new Gtk.CssProvider();
+               try {
+                       this.css.load_from_data("#compile-erros-view { font-size: 10px;}");
+               } catch (Error e) {}
+               this.el.get_style_context().add_provider(this.css,
+                       Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
+                
+                
             }
 
             //listeners