Fix #7401 - property column widths
authorAlan <alan@roojs.com>
Wed, 14 Sep 2022 09:22:20 +0000 (17:22 +0800)
committerAlan <alan@roojs.com>
Wed, 14 Sep 2022 09:22:20 +0000 (17:22 +0800)
src/Builder4/GladeView.bjs
src/Builder4/GladeView.vala
src/Builder4/MainWindow.bjs
src/Builder4/MainWindow.vala
src/Builder4/WindowLeftProps.bjs
src/Builder4/WindowLeftProps.vala

index 2843f78..49312a6 100644 (file)
          "string label" : "xxxcc",
          "xtype" : "Button"
         },
+        {
+         "$ xns" : "Gtk",
+         "xtype" : "MenuButton"
+        },
         {
          "$ xns" : "Gtk",
          "string label" : "xxxcc",
index f4ad1c3..187ed91 100644 (file)
@@ -105,13 +105,13 @@ public class GladeView : Object
             var child_0 = new Xcls_ButtonBox5( _this );
             child_0.ref();
             this.el.add(  child_0.el );
-            var child_1 = new Xcls_Menu9( _this );
+            var child_1 = new Xcls_Menu10( _this );
             child_1.ref();
             this.el._menu = child_1.el;
-            var child_2 = new Xcls_ComboBox10( _this );
+            var child_2 = new Xcls_ComboBox11( _this );
             child_2.ref();
             this.el.add(  child_2.el );
-            var child_3 = new Xcls_GLArea11( _this );
+            var child_3 = new Xcls_GLArea12( _this );
             child_3.ref();
             this.el.add(  child_3.el );
         }
@@ -138,12 +138,15 @@ public class GladeView : Object
             var child_0 = new Xcls_Button6( _this );
             child_0.ref();
             this.el.add(  child_0.el );
-            var child_1 = new Xcls_Button7( _this );
+            var child_1 = new Xcls_MenuButton7( _this );
             child_1.ref();
             this.el.add(  child_1.el );
             var child_2 = new Xcls_Button8( _this );
             child_2.ref();
             this.el.add(  child_2.el );
+            var child_3 = new Xcls_Button9( _this );
+            child_3.ref();
+            this.el.add(  child_3.el );
         }
 
         // user defined functions
@@ -171,7 +174,29 @@ public class GladeView : Object
         // user defined functions
     }
 
-    public class Xcls_Button7 : Object
+    public class Xcls_MenuButton7 : Object
+    {
+        public Gtk.MenuButton el;
+        private GladeView  _this;
+
+
+            // my vars (def)
+
+        // ctor
+        public Xcls_MenuButton7(GladeView _owner )
+        {
+            _this = _owner;
+            this.el = new Gtk.MenuButton();
+
+            // my vars (dec)
+
+            // set gobject values
+        }
+
+        // user defined functions
+    }
+
+    public class Xcls_Button8 : Object
     {
         public Gtk.Button el;
         private GladeView  _this;
@@ -180,7 +205,7 @@ public class GladeView : Object
             // my vars (def)
 
         // ctor
-        public Xcls_Button7(GladeView _owner )
+        public Xcls_Button8(GladeView _owner )
         {
             _this = _owner;
             this.el = new Gtk.Button();
@@ -194,7 +219,7 @@ public class GladeView : Object
         // user defined functions
     }
 
-    public class Xcls_Button8 : Object
+    public class Xcls_Button9 : Object
     {
         public Gtk.Button el;
         private GladeView  _this;
@@ -203,7 +228,7 @@ public class GladeView : Object
             // my vars (def)
 
         // ctor
-        public Xcls_Button8(GladeView _owner )
+        public Xcls_Button9(GladeView _owner )
         {
             _this = _owner;
             this.el = new Gtk.Button();
@@ -218,7 +243,7 @@ public class GladeView : Object
     }
 
 
-    public class Xcls_Menu9 : Object
+    public class Xcls_Menu10 : Object
     {
         public Gtk.Menu el;
         private GladeView  _this;
@@ -227,7 +252,7 @@ public class GladeView : Object
             // my vars (def)
 
         // ctor
-        public Xcls_Menu9(GladeView _owner )
+        public Xcls_Menu10(GladeView _owner )
         {
             _this = _owner;
             this.el = new Gtk.Menu();
@@ -240,7 +265,7 @@ public class GladeView : Object
         // user defined functions
     }
 
-    public class Xcls_ComboBox10 : Object
+    public class Xcls_ComboBox11 : Object
     {
         public Gtk.ComboBox el;
         private GladeView  _this;
@@ -249,7 +274,7 @@ public class GladeView : Object
             // my vars (def)
 
         // ctor
-        public Xcls_ComboBox10(GladeView _owner )
+        public Xcls_ComboBox11(GladeView _owner )
         {
             _this = _owner;
             this.el = new Gtk.ComboBox();
@@ -263,7 +288,7 @@ public class GladeView : Object
         // user defined functions
     }
 
-    public class Xcls_GLArea11 : Object
+    public class Xcls_GLArea12 : Object
     {
         public Gtk.GLArea el;
         private GladeView  _this;
@@ -272,7 +297,7 @@ public class GladeView : Object
             // my vars (def)
 
         // ctor
-        public Xcls_GLArea11(GladeView _owner )
+        public Xcls_GLArea12(GladeView _owner )
         {
             _this = _owner;
             this.el = new Gtk.GLArea();
index ffcb38f..faa1457 100644 (file)
           {
            "$ xns" : "Gtk",
            "* init" : [
-            "{",
+            " ",
             "  this.el.show_all();",
-            "}",
-            ""
+            " "
            ],
            "* prop" : "popup",
            "items" : [
index 1a9a8c7..817f5a6 100644 (file)
@@ -315,9 +315,7 @@ public class Xcls_MainWindow : Object
 
             // init method
 
-            {
-              this.el.show_all();
-            }
+            this.el.show_all();
         }
 
         // user defined functions
@@ -340,7 +338,7 @@ public class Xcls_MainWindow : Object
 
             // set gobject values
             this.el.label = "New Window";
-            this.el.show_all();
+            this.el.show();
 
             //listeners
             this.el.activate.connect( ( ) => {
@@ -369,7 +367,7 @@ public class Xcls_MainWindow : Object
             // my vars (dec)
 
             // set gobject values
-            this.el.show_all();
+            this.el.show();
         }
 
         // user defined functions
@@ -934,7 +932,7 @@ public class Xcls_MainWindow : Object
 
             // set gobject values
             this.el.label = "Download updated Resources";
-            this.el.show_all();
+            this.el.show();
 
             //listeners
             this.el.activate.connect( ( ) => {
@@ -963,7 +961,7 @@ public class Xcls_MainWindow : Object
 
             // set gobject values
             this.el.label = "About the Builder";
-            this.el.show_all();
+            this.el.show();
 
             //listeners
             this.el.activate.connect( () => {
@@ -1120,7 +1118,7 @@ public class Xcls_MainWindow : Object
 
             // set gobject values
             this.el.label = "Compile Status:";
-            this.el.show_all();
+            this.el.show();
         }
 
         // user defined functions
@@ -1152,7 +1150,7 @@ public class Xcls_MainWindow : Object
             var child_0 = new Xcls_Image35( _this );
             child_0.ref();
             this.el.set_image (  child_0.el  );
-            this.el.show_all();
+            this.el.show();
 
             //listeners
             this.el.button_press_event.connect( () => {
@@ -1225,7 +1223,7 @@ public class Xcls_MainWindow : Object
             var child_0 = new Xcls_Image37( _this );
             child_0.ref();
             this.el.set_image (  child_0.el  );
-            this.el.show_all();
+            this.el.show();
 
             //listeners
             this.el.button_press_event.connect( () => {
@@ -1297,7 +1295,7 @@ public class Xcls_MainWindow : Object
             var child_0 = new Xcls_Image39( _this );
             child_0.ref();
             this.el.set_image (  child_0.el  );
-            this.el.show_all();
+            this.el.show();
 
             //listeners
             this.el.button_press_event.connect( () => {
@@ -1368,7 +1366,7 @@ public class Xcls_MainWindow : Object
             var child_0 = new Xcls_Image41( _this );
             child_0.ref();
             this.el.set_image (  child_0.el  );
-            this.el.show_all();
+            this.el.show();
 
             //listeners
             this.el.button_press_event.connect( () => {
index 5556949..bcbffc2 100644 (file)
          "xtype" : "TreeStore"
         },
         {
+         "$ Gtk.TreeViewColumnSizing sizing" : "Gtk.TreeViewColumnSizing.FIXED",
          "$ resizable" : true,
          "$ xns" : "Gtk",
          "* init" : [
           "  "
          ],
          "* pack" : "append_column",
+         "bool expand" : true,
          "id" : "keycol",
          "items" : [
           {
          "xtype" : "TreeViewColumn"
         },
         {
+         "$ Gtk.TreeViewColumnSizing sizing" : "Gtk.TreeViewColumnSizing.FIXED",
          "$ resizable" : true,
          "$ xns" : "Gtk",
          "* init" : [
           ""
          ],
          "* pack" : "append_column",
+         "bool expand" : true,
          "id" : "valcol",
          "items" : [
           {
     "   ",
     "   this.view.el.get_selection().unselect_all();",
     "   ",
-    "   ",
-    "   ",
+    "   _this.keycol.el.set_max_width(_this.EditProps.el.get_allocated_width()/ 2);",
+    "   _this.valcol.el.set_max_width(_this.EditProps.el.get_allocated_width()/ 2);",
     "   ",
     "}",
     ""
index 02b7502..7410ec0 100644 (file)
@@ -456,8 +456,8 @@ public class Xcls_LeftProps : Object
        
        this.view.el.get_selection().unselect_all();
        
-       
-       
+       _this.keycol.el.set_max_width(_this.EditProps.el.get_allocated_width()/ 2);
+       _this.valcol.el.set_max_width(_this.EditProps.el.get_allocated_width()/ 2);
        
     }
     public void addProp (JsRender.NodeProp prop) {
@@ -840,6 +840,7 @@ public class Xcls_LeftProps : Object
             // set gobject values
             this.el.tooltip_markup = "Using _this.{ID} will map to this element";
             this.el.label = "id: _this.{ID} (Vala)";
+            this.el.show();
 
             //listeners
             this.el.activate.connect( ()  => {
@@ -870,6 +871,7 @@ public class Xcls_LeftProps : Object
             // set gobject values
             this.el.tooltip_markup = "how to pack this element onto parent, (method, 2nd arg, 3rd arg) .. the 1st argument is filled by the element";
             this.el.label = "pack: Pack method (Vala)";
+            this.el.show();
 
             //listeners
             this.el.activate.connect( ( ) => {
@@ -900,6 +902,7 @@ public class Xcls_LeftProps : Object
             // set gobject values
             this.el.tooltip_markup = "eg. \n\nnew Clutter.Image.from_file(.....)";
             this.el.label = "ctor: Alterative to default contructor (Vala)";
+            this.el.show();
 
             //listeners
             this.el.activate.connect( ( ) => {
@@ -930,6 +933,7 @@ public class Xcls_LeftProps : Object
             // set gobject values
             this.el.tooltip_markup = "This code is called after the ctor";
             this.el.label = "init: initialziation code (vala)";
+            this.el.show();
 
             //listeners
             this.el.activate.connect( ( ) => {
@@ -960,6 +964,7 @@ public class Xcls_LeftProps : Object
             // set gobject values
             this.el.tooltip_markup = "set the cms-id for this element, when converted to javascript, the html value will be wrapped with Pman.Cms.content({cms-id},{original-html})\n";
             this.el.label = "cms-id: (Roo JS/Pman library)";
+            this.el.show();
 
             //listeners
             this.el.activate.connect( ()  => {
@@ -991,6 +996,7 @@ public class Xcls_LeftProps : Object
             // my vars (dec)
 
             // set gobject values
+            this.el.show();
         }
 
         // user defined functions
@@ -1015,6 +1021,7 @@ public class Xcls_LeftProps : Object
             // set gobject values
             this.el.tooltip_markup = "Add a user defined string property";
             this.el.label = "String";
+            this.el.show();
 
             //listeners
             this.el.activate.connect( (self) => {
@@ -1052,6 +1059,7 @@ public class Xcls_LeftProps : Object
             // set gobject values
             this.el.tooltip_markup = "Add a user defined number property";
             this.el.label = "Number";
+            this.el.show();
 
             //listeners
             this.el.activate.connect( ( ) =>{
@@ -1088,6 +1096,7 @@ public class Xcls_LeftProps : Object
             // set gobject values
             this.el.tooltip_markup = "Add a user defined boolean property";
             this.el.label = "Boolean";
+            this.el.show();
 
             //listeners
             this.el.activate.connect( ( ) =>{
@@ -1124,6 +1133,7 @@ public class Xcls_LeftProps : Object
             // my vars (dec)
 
             // set gobject values
+            this.el.show();
         }
 
         // user defined functions
@@ -1148,6 +1158,7 @@ public class Xcls_LeftProps : Object
             // set gobject values
             this.el.tooltip_markup = "Add a user function boolean property";
             this.el.label = "Javascript Function";
+            this.el.show();
 
             //listeners
             this.el.activate.connect( ( ) =>{
@@ -1186,6 +1197,7 @@ public class Xcls_LeftProps : Object
             // set gobject values
             this.el.tooltip_markup = "Add a user function boolean property";
             this.el.label = "Vala Method";
+            this.el.show();
 
             //listeners
             this.el.activate.connect( ( ) =>{
@@ -1222,6 +1234,7 @@ public class Xcls_LeftProps : Object
             // set gobject values
             this.el.tooltip_markup = "Add a vala signal";
             this.el.label = "Vala Signal";
+            this.el.show();
 
             //listeners
             this.el.activate.connect( ( ) =>{
@@ -1255,6 +1268,7 @@ public class Xcls_LeftProps : Object
             // my vars (dec)
 
             // set gobject values
+            this.el.show();
         }
 
         // user defined functions
@@ -1279,6 +1293,7 @@ public class Xcls_LeftProps : Object
             // set gobject values
             this.el.tooltip_markup = "Add a flexy if (for HTML templates)";
             this.el.label = "Flexy - If";
+            this.el.show();
 
             //listeners
             this.el.activate.connect( ( ) =>{
@@ -1316,6 +1331,7 @@ public class Xcls_LeftProps : Object
             // set gobject values
             this.el.tooltip_markup = "Add a flexy include (for HTML templates)";
             this.el.label = "Flexy - Include";
+            this.el.show();
 
             //listeners
             this.el.activate.connect( ( ) =>{
@@ -1353,6 +1369,7 @@ public class Xcls_LeftProps : Object
             // set gobject values
             this.el.tooltip_markup = "Add a flexy foreach (for HTML templates)";
             this.el.label = "Flexy - Foreach";
+            this.el.show();
 
             //listeners
             this.el.activate.connect( ( ) =>{
@@ -1660,6 +1677,8 @@ public class Xcls_LeftProps : Object
 
             // set gobject values
             this.el.title = "Property";
+            this.el.sizing = Gtk.TreeViewColumnSizing.FIXED;
+            this.el.expand = true;
             this.el.resizable = true;
             var child_0 = new Xcls_keyrender( _this );
             child_0.ref();
@@ -1716,6 +1735,8 @@ public class Xcls_LeftProps : Object
 
             // set gobject values
             this.el.title = "Value";
+            this.el.sizing = Gtk.TreeViewColumnSizing.FIXED;
+            this.el.expand = true;
             this.el.resizable = true;
             var child_0 = new Xcls_valrender( _this );
             child_0.ref();
@@ -1894,6 +1915,7 @@ public class Xcls_LeftProps : Object
 
             // set gobject values
             this.el.label = "Delete";
+            this.el.show();
 
             //listeners
             this.el.activate.connect( ( )  =>{