From c2fe6243f41b0b37f506607242a2d74c80e5127f Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 14 Mar 2024 20:57:53 +0800 Subject: [PATCH] Fix #8087 - notebookpage - glade view should ignore if not tab and child --- src/Builder4/CodeInfo.bjs | 54 +++++++++++ src/Builder4/CodeInfo.vala | 178 ++++++++++++++++++++++++++++++++++ src/JsRender/Node.vala | 3 +- src/JsRender/NodeToGlade.vala | 12 ++- 4 files changed, 243 insertions(+), 4 deletions(-) create mode 100644 src/Builder4/CodeInfo.bjs create mode 100644 src/Builder4/CodeInfo.vala diff --git a/src/Builder4/CodeInfo.bjs b/src/Builder4/CodeInfo.bjs new file mode 100644 index 000000000..b72ad1430 --- /dev/null +++ b/src/Builder4/CodeInfo.bjs @@ -0,0 +1,54 @@ +{ + "build_module" : "roobuilder", + "gen_extended" : false, + "items" : [ + { + "$ xns" : "Gtk", + "items" : [ + { + "$ xns" : "Gtk", + "* prop" : "child", + "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL", + "items" : [ + { + "$ xns" : "Gtk", + "* prop" : "start_child", + "items" : [ + { + "$ xns" : "Gtk", + "* prop" : "child", + "xtype" : "ListView" + } + ], + "xtype" : "ScrolledWindow" + }, + { + "$ xns" : "Gtk", + "* prop" : "end_child", + "items" : [ + { + "$ xns" : "Gtk", + "items" : [ + { + "$ xns" : "Gtk", + "* prop" : "child", + "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL", + "int spacing" : 0, + "xtype" : "Box" + } + ], + "string tab_label" : "details", + "xtype" : "NotebookPage" + } + ], + "xtype" : "Notebook" + } + ], + "xtype" : "Paned" + } + ], + "xtype" : "Popover" + } + ], + "name" : "CodeInfo" +} \ No newline at end of file diff --git a/src/Builder4/CodeInfo.vala b/src/Builder4/CodeInfo.vala new file mode 100644 index 000000000..d026b0f5d --- /dev/null +++ b/src/Builder4/CodeInfo.vala @@ -0,0 +1,178 @@ +static CodeInfo _CodeInfo; + +public class CodeInfo : Object +{ + public Gtk.Popover el; + private CodeInfo _this; + + public static CodeInfo singleton() + { + if (_CodeInfo == null) { + _CodeInfo= new CodeInfo(); + } + return _CodeInfo; + } + + // my vars (def) + + // ctor + public CodeInfo() + { + _this = this; + this.el = new Gtk.Popover(); + + // my vars (dec) + + // set gobject values + var child_1 = new Xcls_Paned1( _this ); + child_1.ref(); + this.el.child = child_1.el; + } + + // user defined functions + public class Xcls_Paned1 : Object + { + public Gtk.Paned el; + private CodeInfo _this; + + + // my vars (def) + + // ctor + public Xcls_Paned1(CodeInfo _owner ) + { + _this = _owner; + this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL ); + + // my vars (dec) + + // set gobject values + var child_1 = new Xcls_ScrolledWindow2( _this ); + child_1.ref(); + this.el.start_child = child_1.el; + var child_2 = new Xcls_Notebook4( _this ); + child_2.ref(); + this.el.end_child = child_2.el; + } + + // user defined functions + } + public class Xcls_ScrolledWindow2 : Object + { + public Gtk.ScrolledWindow el; + private CodeInfo _this; + + + // my vars (def) + + // ctor + public Xcls_ScrolledWindow2(CodeInfo _owner ) + { + _this = _owner; + this.el = new Gtk.ScrolledWindow(); + + // my vars (dec) + + // set gobject values + var child_1 = new Xcls_ListView3( _this ); + child_1.ref(); + this.el.child = child_1.el; + } + + // user defined functions + } + public class Xcls_ListView3 : Object + { + public Gtk.ListView el; + private CodeInfo _this; + + + // my vars (def) + + // ctor + public Xcls_ListView3(CodeInfo _owner ) + { + _this = _owner; + this.el = new Gtk.ListView( null, null ); + + // my vars (dec) + + // set gobject values + } + + // user defined functions + } + + + public class Xcls_Notebook4 : Object + { + public Gtk.Notebook el; + private CodeInfo _this; + + + // my vars (def) + + // ctor + public Xcls_Notebook4(CodeInfo _owner ) + { + _this = _owner; + this.el = new Gtk.Notebook(); + + // my vars (dec) + + // set gobject values + var child_1 = new Xcls_NotebookPage5( _this , this); + child_1.ref(); + } + + // user defined functions + } + public class Xcls_NotebookPage5 : Object + { + public Gtk.NotebookPage el; + private CodeInfo _this; + + + // my vars (def) + public string tab_label; + + // ctor + public Xcls_NotebookPage5(CodeInfo _owner , Xcls_Notebook4 notebook) + { + _this = _owner; + + // my vars (dec) + this.tab_label = "details"; + var child_1 = new Xcls_Box483( _this ); + child_1.ref(); + notebook.el.append_page( child_1 , new Gtk.Label(this.tab_label) ); + } + + // user defined functions + } + public class Xcls_Box483 : Object + { + public Gtk.Box el; + private CodeInfo _this; + + + // my vars (def) + + // ctor + public Xcls_Box483(CodeInfo _owner ) + { + _this = _owner; + this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 ); + + // my vars (dec) + + // set gobject values + } + + // user defined functions + } + + + + +} diff --git a/src/JsRender/Node.vala b/src/JsRender/Node.vala index c14b659c6..def307423 100644 --- a/src/JsRender/Node.vala +++ b/src/JsRender/Node.vala @@ -89,7 +89,8 @@ -public class JsRender.Node : GLib.Object { +public class JsRender.Node : GLib.Object +{ public static int uid_count = 0; diff --git a/src/JsRender/NodeToGlade.vala b/src/JsRender/NodeToGlade.vala index e3b833dc4..08672b9a4 100644 --- a/src/JsRender/NodeToGlade.vala +++ b/src/JsRender/NodeToGlade.vala @@ -75,7 +75,6 @@ public class JsRender.NodeToGlade : Object { public Xml.Node* mungeNode() { - var is_top = false; if (this.parent == null) { is_top = true; @@ -96,9 +95,16 @@ public class JsRender.NodeToGlade : Object { if (gdata == null || !gdata.inherits.contains("Gtk.Buildable")) { switch(cls) { //exception to the rule.. (must be buildable to work with glade? - case "GtkColumnViewColumn": + case "GtkNotebookPage": - break; + if (this.node.childstore.get_n_items() < 1) { + return null; + } + break; + + case "GtkColumnViewColumn": + break; + default: return null; } -- 2.39.2