Fix #8087 - notebookpage - glade view should ignore if not tab and child
authorAlan Knowles <alan@roojs.com>
Thu, 14 Mar 2024 12:57:53 +0000 (20:57 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 14 Mar 2024 12:57:53 +0000 (20:57 +0800)
src/Builder4/CodeInfo.bjs [new file with mode: 0644]
src/Builder4/CodeInfo.vala [new file with mode: 0644]
src/JsRender/Node.vala
src/JsRender/NodeToGlade.vala

diff --git a/src/Builder4/CodeInfo.bjs b/src/Builder4/CodeInfo.bjs
new file mode 100644 (file)
index 0000000..b72ad14
--- /dev/null
@@ -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 (file)
index 0000000..d026b0f
--- /dev/null
@@ -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
+       }
+
+
+
+
+}
index c14b659..def3074 100644 (file)
@@ -89,7 +89,8 @@
 
 
 
-public class JsRender.Node : GLib.Object {
+public class JsRender.Node : GLib.Object 
+{
        
 
        public static int uid_count = 0;
index e3b833d..08672b9 100644 (file)
@@ -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;
                        }