From: Alan Knowles Date: Mon, 27 Apr 2015 08:39:46 +0000 (+0800) Subject: src/Builder4/GtkView.bjs X-Git-Url: http://git.roojs.org/?p=app.Builder.js;a=commitdiff_plain;h=e321d3e22493ea9d669acf8073e3a90aa0f86d65 src/Builder4/GtkView.bjs src/Builder4/GtkView.vala --- diff --git a/src/Builder4/GtkView.bjs b/src/Builder4/GtkView.bjs index 36c8a9064..45bac86f2 100644 --- a/src/Builder4/GtkView.bjs +++ b/src/Builder4/GtkView.bjs @@ -10,7 +10,7 @@ "id" : "GtkView", "| void createThumb" : "() {\n \n \n if (this.file == null) {\n return;\n }\n var filename = this.file.getIconFileName(false);\n \n var win = this.el.get_parent_window();\n var width = win.get_width();\n var height = win.get_height();\n\n Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?\n\n screenshot.save(filename,\"png\");\n return;\n \n \n \n \n \n \n \n // should we hold until it's printed...\n \n \n\n \n \n\n\n \n \n}\n", "# Gtk.Widget lastObj" : "null", - "| void loadFile" : "(JsRender.JsRender file) \n{\n \n // this.el.set_position((int)(this.el.max_position * 0.7));\n this.el.set_position(this.el.max_position );\n this.file = null;\n \n if (file.tree == null) {\n return;\n }\n this.file = file;\n if (this.lastObj != null) {\n this.container.el.remove(this.lastObj);\n }\n \n // hide the compile view at present..\n \n \n var w = _this.el.get_allocated_width();\n var h = _this.el.get_allocated_height();\n \n\n \n // set the container size min to 500/500 or 20 px less than max..\n w = int.max (w-20, 500);\n h = int.max (h-20, 500); \n _this.container.el.set_size_request(w,h);\n \n _this.view_layout.el.set_size(w,h); // should be baded on calc.. -- see update_scrolled.\n var rgba = Gdk.RGBA ();\n rgba.parse (\"#ccc\");\n _this.view_layout.el.override_background_color(Gtk.StateFlags.NORMAL, rgba);\n \n \n\tvar x = new JsRender.NodeToGtk(file.tree);\n var obj = x.munge() as Gtk.Widget;\n this.lastObj = null;\n\tif (obj == null) {\n \treturn;\n\t}\n\tthis.lastObj = obj;\n \n this.container.el.add(obj);\n obj.show_all();\n \n \n \n}\n ", + "| void loadFile" : "(JsRender.JsRender file) \n{\n \n // this.el.set_position((int)(this.el.max_position * 0.7));\n this.el.set_position(this.el.max_position );\n this.file = null;\n \n if (file.tree == null) {\n return;\n }\n this.file = file;\n if (this.lastObj != null) {\n this.container.el.remove(this.lastObj);\n }\n \n // hide the compile view at present..\n \n \n var w = _this.el.get_allocated_width();\n var h = _this.el.get_allocated_height();\n \n\n \n // set the container size min to 500/500 or 20 px less than max..\n w = int.max (w-20, 500);\n h = int.max (h-20, 500); \n \n print(\"SET SIZES %d, %d\", w,h); \n _this.container.el.set_size_request(w,h);\n \n _this.view_layout.el.set_size(w,h); // should be baded on calc.. -- see update_scrolled.\n var rgba = Gdk.RGBA ();\n rgba.parse (\"#ccc\");\n _this.view_layout.el.override_background_color(Gtk.StateFlags.NORMAL, rgba);\n \n \n\tvar x = new JsRender.NodeToGtk(file.tree);\n var obj = x.munge() as Gtk.Widget;\n this.lastObj = null;\n\tif (obj == null) {\n \treturn;\n\t}\n\tthis.lastObj = obj;\n \n this.container.el.add(obj);\n obj.show_all();\n \n \n \n}\n ", "xtype" : "VPaned", "# JsRender.JsRender file" : "null", "$ xns" : "Gtk", diff --git a/src/Builder4/GtkView.vala b/src/Builder4/GtkView.vala index dcd04d56f..94718fc40 100644 --- a/src/Builder4/GtkView.vala +++ b/src/Builder4/GtkView.vala @@ -99,7 +99,9 @@ public class Xcls_GtkView : Object // set the container size min to 500/500 or 20 px less than max.. w = int.max (w-20, 500); - h = int.max (h-20, 500); + h = int.max (h-20, 500); + + print("SET SIZES %d, %d", w,h); _this.container.el.set_size_request(w,h); _this.view_layout.el.set_size(w,h); // should be baded on calc.. -- see update_scrolled.