src/Builder4/PopoverFileDetails.bjs
authorAlan Knowles <alan@roojs.com>
Fri, 13 Nov 2015 07:24:50 +0000 (15:24 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 13 Nov 2015 07:24:50 +0000 (15:24 +0800)
src/Builder4/PopoverFileDetails.vala

src/Builder4/PopoverFileDetails.bjs
src/Builder4/PopoverFileDetails.vala

index 3383996..5f27fa5 100644 (file)
@@ -62,7 +62,7 @@
         },
         {
          "listeners" : {
-          "changed" : "() => {\n\tGtk.TreeIter iter;\n\tbool is_bjs = true;\n\tif (this.el.get_active_iter(out iter)) {\n\t\tValue vfname;\n\t\t_this.ftdbmodel.el.get_value (iter, 0, out vfname);\n\t\t is_bjs = ((string)vfname) == \"bjs\";\n\t}\n    \n   for (var i = 2; i < 8;i++) {\n\t\tvar el = _this.grid.el.get_child_at(0,i);\n\t\tif (is_bjs) {\n\t\t   el.show();\n\t\t} else {\n\t\t\tel.hide();\n\t\t}\n\t\t el = _this.grid.el.get_child_at(1,i);\n\t\tif (is_bjs) {\n\t\t   el.show();\n\t\t} else {\n\t\t\tel.hide();\n\t\t}     \n    }\n     \n     \n\n\n}"
+          "changed" : "() => {\n\tGtk.TreeIter iter;\n\tbool is_bjs = true;\n\tif (this.el.get_active_iter(out iter)) {\n\t\tValue vfname;\n\t\t_this.ftdbmodel.el.get_value (iter, 0, out vfname);\n\t\t is_bjs = ((string)vfname) == \"bjs\";\n\t}\n    \n   for (var i = 2; i < 9;i++) {\n\t\tvar el = _this.grid.el.get_child_at(0,i);\n\t\t\n\t\tvar showhide= is_bjs;\n\t\tif (i> 7) {\n\t\t\tshowhide = !showhide;\n\t\t}\n\t\t\n\t\tif (showhide) {\n\t\t   el.show();\n\t\t} else {\n\t\t\tel.hide();\n\t\t}\n\t\t el = _this.grid.el.get_child_at(1,i);\n\t\tif (showhide) {\n\t\t   el.show();\n\t\t} else {\n\t\t\tel.hide();\n\t\t}     \n    }\n    // directory is only available for non-bjs \n     \n\n\n}"
          },
          "id" : "filetype",
          "* init" : "this.el.add_attribute(_this.ftdbcellrenderer.el , \"markup\", 1 );",
index 7ce2aa0..8726044 100644 (file)
@@ -373,21 +373,27 @@ public class Xcls_PopoverFileDetails : Object
                         is_bjs = ((string)vfname) == "bjs";
                }
                 
-               for (var i = 2; i < 8;i++) {
+               for (var i = 2; i < 9;i++) {
                        var el = _this.grid.el.get_child_at(0,i);
-                       if (is_bjs) {
+                       
+                       var showhide= is_bjs;
+                       if (i> 7) {
+                               showhide = !showhide;
+                       }
+                       
+                       if (showhide) {
                           el.show();
                        } else {
                                el.hide();
                        }
                         el = _this.grid.el.get_child_at(1,i);
-                       if (is_bjs) {
+                       if (showhide) {
                           el.show();
                        } else {
                                el.hide();
                        }     
                 }
-                 
+                // directory is only available for non-bjs