Fix #8025 - move css to resources
[roobuilder] / src / Builder4 / ValaCompileResults.bjs
index 7f7532a..82a6865 100644 (file)
@@ -1,5 +1,6 @@
 {
  "build_module" : "builder",
+ "gen_extended" : false,
  "items" : [
   {
    "$ xns" : "Gtk",
    "items" : [
     {
      "$ xns" : "Gtk",
-     "* pack" : "add",
+     "* pack" : "set_child",
      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+     "bool hexpand" : true,
+     "bool vexpand" : true,
      "gboolean homogeneous" : false,
      "id" : "compile_view",
      "items" : [
         "}",
         ""
        ],
-       "* pack" : "pack_end,true,true,0",
        "bool hexpand" : true,
+       "bool vexpand" : true,
        "items" : [
         {
-         "$ xns" : "Gtk",
-         "* init" : [
-          "{",
-          "",
-          "   \tthis.css = new Gtk.CssProvider();",
-          "\ttry {",
-          "\t\tthis.css.load_from_data(\"#compile-results-view { font: 10px Monospace;}\");",
-          "\t} catch (Error e) {}",
-          "\tthis.el.get_style_context().add_provider(this.css,",
-          "\t\tGtk.STYLE_PROVIDER_PRIORITY_APPLICATION);",
-          "\t  ",
-          "",
-          "}",
-          ""
-         ],
-         "* pack" : "add",
-         "Gtk.CssProvider css" : "",
+         "$ xns" : "GtkSource",
+         "* prop" : "child",
          "bool editable" : false,
+         "bool hexpand" : true,
          "bool show_line_numbers" : false,
+         "bool vexpand" : true,
          "id" : "sourceview",
          "string name" : "compile-results-view",
-         "xtype" : "SourceView"
+         "xtype" : "View"
         }
        ],
        "xtype" : "ScrolledWindow"
    "xtype" : "Popover",
    "| void addLine" : [
     "(string str) {",
+    "\t ",
     "\t",
-    "\tif (this.window.windowstate.project.fn != BuilderApplication.valasource.file.project.fn) {",
-    "\t\t// not our project.",
-    "\t\treturn;",
-    "\t}",
     "\t",
-    "\tvar buf = (Gtk.SourceBuffer)this.sourceview.el.get_buffer();",
+    "\tvar buf = (GtkSource.Buffer)this.sourceview.el.get_buffer();",
     "\tGtk.TextIter iter;",
     "\tbuf.get_end_iter (out  iter);",
     "\tbuf.insert(ref iter, str, str.length);",
    ],
    "| void show" : [
     "( Gtk.Widget onbtn, bool reset) {",
-    "\tint w, h;",
-    " ",
-    "\tthis.window.el.get_size(out w, out h);",
-    "    ",
+    "\tvar win = this.window.el;",
+    "    var  w = win.get_width();",
+    "    var h = win.get_height();",
+    "",
     "    // left tree = 250, editor area = 500?",
     "    ",
     "    var new_w = int.min(750, w-100);",
     "        new_w = w-100;",
     "    }",
     "    this.el.set_size_request( int.max(100, new_w), int.max(100, h-120));",
-    " ",
+    " \tif (this.el.parent == null) {",
+    "\t\tthis.el.set_parent(win);",
+    "\t}",
+    "   // Gtk.Allocation rect;",
+    "\t//onbtn.get_allocation(out rect);",
+    "    //this.el.set_pointing_to(rect);",
     "",
-    "    if (this.el.relative_to == null) {",
-    "        this.el.set_relative_to(onbtn);",
-    "    }",
-    "    this.el.show_all();",
+    "    this.el.popup();",
     "   // not sure why..",
     "   ",
     "   if (reset) {",
-    "\t\tvar buf = (Gtk.SourceBuffer)this.sourceview.el.get_buffer();",
+    "\t\tvar buf = (GtkSource.Buffer)this.sourceview.el.get_buffer();",
     "\t\tbuf.set_text(\"\",0);",
     "\t}",
     "   ",
-    "    while(Gtk.events_pending()) { ",
-    "            Gtk.main_iteration();",
-    "    }",
     "    ",
     "    ",
     "    ",
    ]
   }
  ],
- "modOrder" : "",
- "name" : "ValaCompileResults",
- "parent" : "",
- "path" : "/home/alan/gitlive/roobuilder/src/Builder4/ValaCompileResults.bjs",
- "permname" : "",
- "title" : ""
+ "name" : "ValaCompileResults"
 }
\ No newline at end of file