Fix #8033 - text size zoom
[roobuilder] / src / Builder4 / WindowRooView.vala
index 1ea8faa..1d028a5 100644 (file)
@@ -23,6 +23,7 @@ public class Xcls_WindowRooView : Object
        public Xcls_sourceviewscroll sourceviewscroll;
        public Xcls_sourceview sourceview;
        public Xcls_buffer buffer;
+       public Xcls_keystate keystate;
        public Xcls_search_entry search_entry;
        public Xcls_search_results search_results;
        public Xcls_nextBtn nextBtn;
@@ -35,6 +36,7 @@ public class Xcls_WindowRooView : Object
                // my vars (def)
        public Gtk.Widget lastObj;
        public Xcls_MainWindow main_window;
+       public int last_error_counter;
        public int last_search_end;
        public GtkSource.SearchContext searchcontext;
        public JsRender.JsRender file;
@@ -47,6 +49,7 @@ public class Xcls_WindowRooView : Object
 
                // my vars (dec)
                this.lastObj = null;
+               this.last_error_counter = 0;
                this.last_search_end = 0;
                this.file = null;
 
@@ -64,6 +67,8 @@ public class Xcls_WindowRooView : Object
            this.view.renderJS(true);
            this.notebook.el.page = 0;// gtk preview 
            this.sourceview.loadFile();   
+           this.last_error_counter = -1;
+           this.updateErrorMarks();
        }
        public void highlightNodeAtLine (int ln) {
        
@@ -242,7 +247,7 @@ public class Xcls_WindowRooView : Object
            
             
        }
-       public void updateErrorMarks (string category) {
+       public void updateErrorMarks () {
                
         
        
@@ -251,7 +256,7 @@ public class Xcls_WindowRooView : Object
                Gtk.TextIter end;     
                buf.get_bounds (out start, out end);
        
-               buf.remove_source_marks (start, end, category);
+       
         
                GLib.debug("highlight errors");          
        
@@ -265,32 +270,39 @@ public class Xcls_WindowRooView : Object
                        return;
        
                }
-               var ar = this.file.getErrors(category);
-               if (ar == null || ar.get_n_items() < 1) {
-                       GLib.debug("higjlight %s has no errors", category);
+               var ar = this.file.getErrors();
+               if (ar.size < 1) {
+                       buf.remove_tag_by_name ("ERR", start, end);
+                       buf.remove_tag_by_name ("WARN", start, end);
+                       buf.remove_tag_by_name ("DEPR", start, end);
+                       buf.remove_source_marks (start, end, "ERR");
+                       buf.remove_source_marks (start, end, "WARN");
+                       buf.remove_source_marks (start, end, "DEPR");
+                       this.last_error_counter = file.error_counter ;
+                       GLib.debug("higjlight has no errors");
+                       return;
+               }
+               if (this.last_error_counter == file.error_counter) {
                        return;
                }
-        
-       
-        
-               
-               var offset = 0;
-                
        
                var tlines = buf.get_line_count () +1;
                
         
                 
-               for (var i = 0; i < ar.get_n_items();i++) {
-                       var err = (Palete.CompileError) ar.get_item(i);
+               buf.remove_source_marks (start, end, "ERR");
+               buf.remove_source_marks (start, end, "WARN");
+               buf.remove_source_marks (start, end, "DEPR");
+               buf.remove_tag_by_name ("ERR", start, end);
+               buf.remove_tag_by_name ("WARN", start, end);
+               buf.remove_tag_by_name ("DEPR", start, end);
+               foreach(var diag in ar) { 
+               
                        
                     Gtk.TextIter iter;
        //        print("get inter\n");
-                   var eline = err.line - offset;
-                   GLib.debug("GOT ERROR on line %d -- converted to %d  (offset = %d)",
-                       err.line ,eline, offset);
-                   
-                   
+                   var eline = (int)diag.range.start.line ;
+                   var eline_to = (int)diag.range.end.line;
                    if (eline > tlines || eline < 0) {
                        return;
                    }
@@ -298,13 +310,20 @@ public class Xcls_WindowRooView : Object
                    
                    buf.get_iter_at_line( out iter, eline);
                   
+                        buf.get_iter_at_line_offset( out start, 
+                       eline, (int)diag.range.start.character); 
+                   buf.get_iter_at_line_offset( out end, 
+                       eline_to, (int)diag.range.end.character); 
+                       
+                   buf.apply_tag_by_name(diag.category, start, end);
+                  
                   
-                       var msg = "Line: %d %s : %s".printf(eline+1, err.category, err.msg);
-                   buf.create_source_mark( msg, err.category, iter);
+                       var msg = "Line: %d %s : %s".printf(eline+1, diag.category, diag.message);
+                   buf.create_source_mark( msg, diag.category, iter);
                    GLib.debug("set line %d to %s", eline, msg);
                    //this.marks.set(eline, msg);
                }
-               return ;
+               this.last_error_counter = file.error_counter ;
        
        
        
@@ -355,7 +374,7 @@ public class Xcls_WindowRooView : Object
                        new Xcls_label_code( _this );
                        new Xcls_paned( _this );
                        this.el.append_page ( _this.paned.el , _this.label_preview.el );
-                       var child_4 = new Xcls_Box13( _this );
+                       var child_4 = new Xcls_Box12( _this );
                        child_4.ref();
                        this.el.append_page ( child_4.el , _this.label_code.el );
                }
@@ -455,7 +474,7 @@ public class Xcls_WindowRooView : Object
                        // set gobject values
                        this.el.homogeneous = false;
                        this.el.vexpand = true;
-                       var child_1 = new Xcls_Box7( _this );
+                       var child_1 = new Xcls_Box6( _this );
                        child_1.ref();
                        this.el.append( child_1.el );
                        new Xcls_view( _this );
@@ -464,7 +483,7 @@ public class Xcls_WindowRooView : Object
 
                // user defined functions
        }
-       public class Xcls_Box7 : Object
+       public class Xcls_Box6 : Object
        {
                public Gtk.Box el;
                private Xcls_WindowRooView  _this;
@@ -473,7 +492,7 @@ public class Xcls_WindowRooView : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_Box7(Xcls_WindowRooView _owner )
+               public Xcls_Box6(Xcls_WindowRooView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
@@ -484,19 +503,19 @@ public class Xcls_WindowRooView : Object
                        this.el.homogeneous = true;
                        this.el.height_request = 20;
                        this.el.vexpand = false;
-                       var child_1 = new Xcls_Button8( _this );
+                       var child_1 = new Xcls_Button7( _this );
                        child_1.ref();
                        this.el.append( child_1.el );
                        new Xcls_AutoRedraw( _this );
                        this.el.append( _this.AutoRedraw.el );
-                       var child_3 = new Xcls_Button10( _this );
+                       var child_3 = new Xcls_Button9( _this );
                        child_3.ref();
                        this.el.append( child_3.el );
                }
 
                // user defined functions
        }
-       public class Xcls_Button8 : Object
+       public class Xcls_Button7 : Object
        {
                public Gtk.Button el;
                private Xcls_WindowRooView  _this;
@@ -505,7 +524,7 @@ public class Xcls_WindowRooView : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_Button8(Xcls_WindowRooView _owner )
+               public Xcls_Button7(Xcls_WindowRooView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.Button();
@@ -554,7 +573,7 @@ public class Xcls_WindowRooView : Object
                // user defined functions
        }
 
-       public class Xcls_Button10 : Object
+       public class Xcls_Button9 : Object
        {
                public Gtk.Button el;
                private Xcls_WindowRooView  _this;
@@ -563,7 +582,7 @@ public class Xcls_WindowRooView : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_Button10(Xcls_WindowRooView _owner )
+               public Xcls_Button9(Xcls_WindowRooView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.Button();
@@ -679,36 +698,37 @@ public class Xcls_WindowRooView : Object
 
                        //listeners
                        this.el.script_dialog.connect( (dialog) => {
-                           
-                           
-                           if (this.el == null) {
-                               return true;
-                           }
-                           
-                            var msg = dialog.get_message();
-                            if (msg.length < 4) {
-                               return false;
-                            }
-                            
-                            GLib.debug("script dialog got %s", msg);
-                            
-                            if (msg.substring(0,4) != "IPC:") {
-                                return false;
-                            }
-                            var ar = msg.split(":", 3);
-                           if (ar.length < 3) {
-                               return false;
-                           }
                        
-                           switch(ar[1]) {
-                               case "SAVEHTML":
-                                       GLib.debug("GOT saveHTML %d", ar[2].length);
-                                   _this.file.saveHTML(ar[2]);
-                                   _this.createThumb();
-                                   return true;
-                               default:
-                                   return false;
-                           }
+                               if (this.el == null) {
+                                       return true;
+                               }
+                       
+                               var msg = dialog.get_message();
+                               if (msg.length < 4) {
+                                       return false;
+                               }
+                                
+                                //GLib.debug("script dialog got %s", msg);
+                                
+                               if (msg.substring(0,4) != "IPC:") {
+                                       return false;
+                               }
+                               var ar = msg.split(":", 3);
+                               if (ar.length < 3) {
+                                       return false;
+                               }
+                       
+                               switch(ar[1]) {
+                               
+                                       case "SAVEHTML":
+                                        //   GLib.debug("GOT saveHTML %d", ar[2].length);
+                                           _this.file.saveHTML(ar[2]);
+                                           _this.createThumb();
+                                           return true;
+                                           
+                                       default:
+                                           return false;
+                               }
                            
                        });
                        this.el.ready_to_show.connect( ( ) => {
@@ -776,6 +796,7 @@ public class Xcls_WindowRooView : Object
                    }
                     
                    this.refreshRequired  = true;
+                   
                }
                public void reInit () {
                   print("reInit?");
@@ -818,8 +839,7 @@ public class Xcls_WindowRooView : Object
                {
                    // this is run every 2 seconds from the init..
                
-                 
-                   
+                  
                    if (!this.refreshRequired) {
                       // print("no refresh required");
                        return;
@@ -872,39 +892,37 @@ public class Xcls_WindowRooView : Object
                    this.pendingRedraw = true;
                
                    var runhtml = "<script type=\"text/javascript\">\n" ;
-                   string builderhtml;
+                   uint8[] builderhtml;
                    
                    try {
-                       GLib.FileUtils.get_contents(BuilderApplication.configDirectory() + "/resources/roo.builder.js", out builderhtml);
+                       GLib. File.new_for_uri("resource:///html/roo.builder.js").load_contents(null,  out   builderhtml, null);
                    } catch (Error e) {
-                       builderhtml = "";
+                       builderhtml = {};
                    }
                
-                   runhtml += builderhtml + "\n";
+                   runhtml += (string) builderhtml + "\n";
                    runhtml += "</script>\n" ;
                
                    // fix to make sure they are the same..
                    this.runhtml = project.runhtml;
                    // need to modify paths
                
-                   string inhtml;
+                   uint8[] inhtml;
                    var base_template = project.base_template;
+                   var f = GLib. File.new_for_uri("resource:///html/" + base_template);
                    
-                   if (base_template.length > 0 && !FileUtils.test(
-                       BuilderApplication.configDirectory() + "/resources/" +  base_template, FileTest.EXISTS)  
-                       ) {
-                          print("invalid base_template name - using default:  %s\n", base_template);
-                          base_template = "";
+                   if (base_template.length > 0 && !f.query_exists(null)) {
+                      
+                          GLib.debug("invalid base_template name - using default:  %s", base_template);
+                          f = GLib. File.new_for_uri("resource:///html/roo.builder.html");
                    
                    }
                    try {
-                       GLib.FileUtils.get_contents(
-                           BuilderApplication.configDirectory() + "/resources/" + 
-                               (base_template.length > 0 ? base_template :  "roo.builder.html")
-                               , out inhtml);
+                           f.load_contents(null,  out inhtml, null);
+                        
                    
                    } catch (Error e) {
-                       inhtml = "";
+                       inhtml = {};
                    }    
                    this.renderedData = js;
                
@@ -930,25 +948,25 @@ public class Xcls_WindowRooView : Object
                    //this.runjs = js_src;
                    var fc =    FakeServerCache.factory_with_data(js_src);
                    this.runjs = fc.fname;
+                   var html  = (string) inhtml;
+                       html = html.replace("</head>", runhtml + this.runhtml + 
+                       "<script type=\"text/javascript\" src=\"xhttp://localhost" + fc.fname + "\"></script>" +   
+                         //  "<script type=\"text/javascript\">\n" +
+                         //  js_src + "\n" + 
+                         //  "</script>" + 
+                                   
+                   "</head>");
+                   //print("LOAD HTML " + html);
+                   
+                    var rootURL = project.rootURL;
+               
                    
-                       var html = inhtml.replace("</head>", runhtml + this.runhtml + 
-                           "<script type=\"text/javascript\" src=\"xhttp://localhost" + fc.fname + "\"></script>" +   
-                             //  "<script type=\"text/javascript\">\n" +
-                             //  js_src + "\n" + 
-                             //  "</script>" + 
-                                       
-                       "</head>");
-                       //print("LOAD HTML " + html);
-                       
-                        var rootURL = project.rootURL;
-                  
-                       
-                       
-                       this.el.load_html( html , 
-                           //fixme - should be a config option!
-                           (rootURL.length > 0 ? rootURL : "xhttp://localhost/roobuilder/")
-                       );
-                         this.initInspector();   
+                   
+                   this.el.load_html( html , 
+                       //fixme - should be a config option!
+                       (rootURL.length > 0 ? rootURL : "xhttp://localhost/roobuilder/")
+                   );
+                     this.initInspector();   
                    // force the inspector...        
                       //   this.initInspector();
                        
@@ -989,7 +1007,7 @@ public class Xcls_WindowRooView : Object
        }
 
 
-       public class Xcls_Box13 : Object
+       public class Xcls_Box12 : Object
        {
                public Gtk.Box el;
                private Xcls_WindowRooView  _this;
@@ -998,7 +1016,7 @@ public class Xcls_WindowRooView : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_Box13(Xcls_WindowRooView _owner )
+               public Xcls_Box12(Xcls_WindowRooView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
@@ -1009,7 +1027,7 @@ public class Xcls_WindowRooView : Object
                        this.el.vexpand = true;
                        new Xcls_sourceviewscroll( _this );
                        this.el.append( _this.sourceviewscroll.el );
-                       var child_2 = new Xcls_Box18( _this );
+                       var child_2 = new Xcls_Box17( _this );
                        child_2.ref();
                        this.el.append( child_2.el );
                }
@@ -1052,8 +1070,8 @@ public class Xcls_WindowRooView : Object
                public bool loading;
                public bool button_is_pressed;
                public string prop_selected;
+               public Gtk.CssProvider? css;
                public bool key_is_pressed;
-               public Gtk.CssProvider css;
                public JsRender.Node? node_selected;
 
                // ctor
@@ -1068,6 +1086,7 @@ public class Xcls_WindowRooView : Object
                        this.loading = true;
                        this.button_is_pressed = false;
                        this.prop_selected = "";
+                       this.css = null;
                        this.key_is_pressed = false;
                        this.node_selected = null;
 
@@ -1076,88 +1095,69 @@ public class Xcls_WindowRooView : Object
                        this.el.editable = false;
                        this.el.show_line_marks = true;
                        this.el.show_line_numbers = true;
+                       this.el.css_classes = { "code-editor" };
                        new Xcls_buffer( _this );
                        this.el.set_buffer ( _this.buffer.el  );
-                       var child_2 = new Xcls_EventControllerKey17( _this );
-                       child_2.ref();
-                       this.el.add_controller ( child_2.el  );
+                       new Xcls_keystate( _this );
+                       this.el.add_controller ( _this.keystate.el  );
+                       var child_3 = new Xcls_EventControllerScroll32( _this );
+                       child_3.ref();
+                       this.el.add_controller(  child_3.el );
 
                        // init method
 
                        {
-                          
-                          this.css = new Gtk.CssProvider();
-                                
-                               this.css.load_from_string(
-                                       "#roo-view { font:  10px monospace; }"
-                               );
-                        
-                               Gtk.StyleContext.add_provider_for_display(
-                                       this.el.get_display(),
-                                       this.css,
-                                       Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
-                               );
-                                       
+                       
                                 
-                           
-                           this.loading = true;
-                           //var buf = this.el.get_buffer();
-                           //buf.notify.connect(this.onCursorChanged);
-                         
-                         
-                           var attrs = new GtkSource.MarkAttributes();
-                           var  pink =   Gdk.RGBA();
-                           pink.parse ( "pink");
-                           attrs.set_background ( pink);
-                           attrs.set_icon_name ( "process-stop");    
-                           attrs.query_tooltip_text.connect(( mark) => {
-                               //print("tooltip query? %s\n", mark.name);
-                               return mark.name;
-                           });
-                           
-                           this.el.set_mark_attributes ("ERR", attrs, 1);
-                           
-                            var wattrs = new GtkSource.MarkAttributes();
-                           var  blue =   Gdk.RGBA();
-                           blue.parse ( "#ABF4EB");
-                           wattrs.set_background ( blue);
-                           wattrs.set_icon_name ( "process-stop");    
-                           wattrs.query_tooltip_text.connect(( mark) => {
-                               //print("tooltip query? %s\n", mark.name);
-                               return mark.name;
-                           });
-                           
-                           this.el.set_mark_attributes ("WARN", wattrs, 1);
-                           
-                        
-                           
-                            var dattrs = new GtkSource.MarkAttributes();
-                           var  purple =   Gdk.RGBA();
-                           purple.parse ( "#EEA9FF");
-                           dattrs.set_background ( purple);
-                           dattrs.set_icon_name ( "process-stop");    
-                           dattrs.query_tooltip_text.connect(( mark) => {
-                               //print("tooltip query? %s\n", mark.name);
-                               return mark.name;
-                           });
-                           
-                           this.el.set_mark_attributes ("DEPR", dattrs, 1);
-                           
-                           
-                           var gattrs = new GtkSource.MarkAttributes();
-                           var  grey =   Gdk.RGBA();
-                           grey.parse ( "#ccc");
-                           gattrs.set_background ( grey);
+                       
+                               this.loading = true;
+                               //var buf = this.el.get_buffer();
+                               //buf.notify.connect(this.onCursorChanged);
+                       
+                       
+                               var attrs = new GtkSource.MarkAttributes();
+                               attrs.set_icon_name ( "process-stop");    
+                               attrs.query_tooltip_text.connect(( mark) => {
+                                       //print("tooltip query? %s\n", mark.name);
+                                       return mark.name;
+                               });
+                       
+                               this.el.set_mark_attributes ("ERR", attrs, 1);
+                       
+                                var wattrs = new GtkSource.MarkAttributes();
+                               wattrs.set_icon_name ( "process-stop");    
+                               wattrs.query_tooltip_text.connect(( mark) => {
+                                       //print("tooltip query? %s\n", mark.name);
+                                       return mark.name;
+                               });
+                       
+                               this.el.set_mark_attributes ("WARN", wattrs, 1);
+                       
+                       
+                       
+                                var dattrs = new GtkSource.MarkAttributes();
+                               dattrs.set_icon_name ( "process-stop");    
+                               dattrs.query_tooltip_text.connect(( mark) => {
+                                       //print("tooltip query? %s\n", mark.name);
+                                       return mark.name;
+                               });
+                       
+                               this.el.set_mark_attributes ("DEPR", dattrs, 1);
+                       
+                       
+                               var gattrs = new GtkSource.MarkAttributes();
+                               var  grey =   Gdk.RGBA();
+                               grey.parse ( "#ccc");
+                               gattrs.set_background ( grey);
+                       
+                       
+                               this.el.set_mark_attributes ("grey", gattrs, 1);
+                       
+                       
                         
-                           
-                           this.el.set_mark_attributes ("grey", gattrs, 1);
-                           
-                           
-                           
-                           
-                           
-                           
-                       }
+                       
+                       
+                               }
 
                        //listeners
                        this.el.query_tooltip.connect( (x, y, keyboard_tooltip, tooltip) => {
@@ -1204,7 +1204,7 @@ public class Xcls_WindowRooView : Object
                    
                 
                    buf.set_text("",0);
-                   var sbuf = (GtkSource.Buffer) buf;
+                
                
                    
                
@@ -1456,15 +1456,6 @@ public class Xcls_WindowRooView : Object
                        }
                
                
-               }
-               public void highlightErrorsJson (string type, Json.Object obj) {
-                      // this is a hook for the vala code - it has no value in javascript 
-                      // as we only have one error ususally....
-                       return  ;
-                   
-                
-               
-               
                }
                public void clearGreySelection () {
                 // clear all the marks..
@@ -1515,6 +1506,25 @@ public class Xcls_WindowRooView : Object
 
                        // set gobject values
 
+                       // init method
+
+                       {
+                               var buf = this.el;
+                               buf.create_tag ("bold", "weight", Pango.Weight.BOLD);
+                               buf.create_tag ("type", "weight", Pango.Weight.BOLD, "foreground", "#204a87");
+                               buf.create_tag ("keyword", "weight", Pango.Weight.BOLD, "foreground", "#a40000");
+                               buf.create_tag ("text", "weight", Pango.Weight.NORMAL, "foreground", "#729fcf");
+                               buf.create_tag ("number", "weight", Pango.Weight.BOLD, "foreground", "#ad7fa8");
+                               buf.create_tag ("method", "weight", Pango.Weight.BOLD, "foreground", "#729fcf");
+                               buf.create_tag ("property", "weight", Pango.Weight.BOLD, "foreground", "#BC1F51");
+                               buf.create_tag ("variable", "weight", Pango.Weight.BOLD, "foreground", "#A518B5");
+                       
+                       
+                               buf.create_tag ("ERR", "weight", Pango.Weight.BOLD, "background", "pink");
+                               buf.create_tag ("WARN", "weight", Pango.Weight.BOLD, "background", "#ABF4EB");
+                               buf.create_tag ("DEPR", "weight", Pango.Weight.BOLD, "background", "#EEA9FF");
+                       }
+
                        //listeners
                        this.el.cursor_moved.connect( ( ) => {
                        GLib.debug("cursor moved called");
@@ -1620,29 +1630,6 @@ public class Xcls_WindowRooView : Object
                }
 
                // user defined functions
-               public bool highlightErrors ( Gee.HashMap<int,string> validate_res) {
-                        
-                   this.error_line = validate_res.size;
-                       
-                   if (this.error_line < 1) {
-                         return true;
-                   }
-                   var tlines = this.el.get_line_count ();
-                   Gtk.TextIter iter;
-                   var valiter = validate_res.map_iterator();
-                   while (valiter.next()) {
-                   
-               //        print("get inter\n");
-                       var eline = valiter.get_key();
-                       if (eline > tlines) {
-                           continue;
-                       }
-                       this.el.get_iter_at_line( out iter, eline);
-                       //print("mark line\n");
-                       this.el.create_source_mark(valiter.get_value(), "ERR", iter);
-                   }   
-                   return false;
-               }
                public string toString () {
                    
                    Gtk.TextIter s;
@@ -1655,28 +1642,40 @@ public class Xcls_WindowRooView : Object
                }
        }
 
-       public class Xcls_EventControllerKey17 : Object
+       public class Xcls_keystate : Object
        {
                public Gtk.EventControllerKey el;
                private Xcls_WindowRooView  _this;
 
 
                        // my vars (def)
+               public bool is_control;
 
                // ctor
-               public Xcls_EventControllerKey17(Xcls_WindowRooView _owner )
+               public Xcls_keystate(Xcls_WindowRooView _owner )
                {
                        _this = _owner;
+                       _this.keystate = this;
                        this.el = new Gtk.EventControllerKey();
 
                        // my vars (dec)
+                       this.is_control = false;
 
                        // set gobject values
 
                        //listeners
+                       this.el.key_released.connect( (keyval, keycode, state) => {
+                       
+                       
+                                if (keyval == Gdk.Key.Control_L || keyval == Gdk.Key.Control_R) {
+                                       this.is_control = false;
+                               }
+                       });
                        this.el.key_pressed.connect( (keyval, keycode, state) => {
                        
-                        
+                               if (keyval == Gdk.Key.Control_L || keyval == Gdk.Key.Control_R) {
+                                       this.is_control = true;
+                               }
                            
                                if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
                                    GLib.debug("SAVE: ctrl-g  pressed");
@@ -1702,9 +1701,53 @@ public class Xcls_WindowRooView : Object
                // user defined functions
        }
 
+       public class Xcls_EventControllerScroll32 : Object
+       {
+               public Gtk.EventControllerScroll el;
+               private Xcls_WindowRooView  _this;
 
 
-       public class Xcls_Box18 : Object
+                       // my vars (def)
+               public double distance;
+
+               // ctor
+               public Xcls_EventControllerScroll32(Xcls_WindowRooView _owner )
+               {
+                       _this = _owner;
+                       this.el = new Gtk.EventControllerScroll( Gtk.EventControllerScrollFlags.VERTICAL );
+
+                       // my vars (dec)
+                       this.distance = 0.0f;
+
+                       // set gobject values
+
+                       //listeners
+                       this.el.scroll.connect( (dx, dy) => {
+                               if (!_this.keystate.is_control) {
+                                       return false;
+                               }
+                               //GLib.debug("scroll %f",  dy);
+                               
+                               this.distance += dy;
+                               if (this.distance < 1) {
+                                       BuilderApplication.settings.editor_font_size ++;
+                                       this.distance = 0;
+                               }
+                               if (this.distance > -1) {
+                                       BuilderApplication.settings.editor_font_size --;
+                                       this.distance = 0;
+                               }
+                       
+                               return true;
+                       });
+               }
+
+               // user defined functions
+       }
+
+
+
+       public class Xcls_Box17 : Object
        {
                public Gtk.Box el;
                private Xcls_WindowRooView  _this;
@@ -1713,7 +1756,7 @@ public class Xcls_WindowRooView : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_Box18(Xcls_WindowRooView _owner )
+               public Xcls_Box17(Xcls_WindowRooView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
@@ -1731,7 +1774,7 @@ public class Xcls_WindowRooView : Object
                        this.el.append( _this.nextBtn.el );
                        new Xcls_backBtn( _this );
                        this.el.append( _this.backBtn.el );
-                       var child_5 = new Xcls_MenuButton24( _this );
+                       var child_5 = new Xcls_MenuButton23( _this );
                        child_5.ref();
                        this.el.append( child_5.el );
                }
@@ -1745,7 +1788,6 @@ public class Xcls_WindowRooView : Object
 
 
                        // my vars (def)
-               public Gtk.CssProvider css;
 
                // ctor
                public Xcls_search_entry(Xcls_WindowRooView _owner )
@@ -1760,24 +1802,10 @@ public class Xcls_WindowRooView : Object
                        this.el.name = "roo-search-entry";
                        this.el.hexpand = true;
                        this.el.placeholder_text = "Press enter to search";
-                       var child_1 = new Xcls_EventControllerKey20( _this );
+                       var child_1 = new Xcls_EventControllerKey19( _this );
                        child_1.ref();
                        this.el.add_controller(  child_1.el );
 
-                       // init method
-
-                       this.css = new Gtk.CssProvider();
-                        
-                       this.css.load_from_string(
-                               "#roo-search-entry { background-color: #ccc; }"
-                       );
-                        
-                       Gtk.StyleContext.add_provider_for_display(
-                               this.el.get_display(),
-                               this.css,
-                               Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
-                       );
-
                        //listeners
                        this.el.search_changed.connect( ( ) => {
                        
@@ -1819,7 +1847,7 @@ public class Xcls_WindowRooView : Object
                        
                }
        }
-       public class Xcls_EventControllerKey20 : Object
+       public class Xcls_EventControllerKey19 : Object
        {
                public Gtk.EventControllerKey el;
                private Xcls_WindowRooView  _this;
@@ -1828,7 +1856,7 @@ public class Xcls_WindowRooView : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_EventControllerKey20(Xcls_WindowRooView _owner )
+               public Xcls_EventControllerKey19(Xcls_WindowRooView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.EventControllerKey();
@@ -1979,7 +2007,7 @@ public class Xcls_WindowRooView : Object
                // user defined functions
        }
 
-       public class Xcls_MenuButton24 : Object
+       public class Xcls_MenuButton23 : Object
        {
                public Gtk.MenuButton el;
                private Xcls_WindowRooView  _this;
@@ -1989,7 +2017,7 @@ public class Xcls_WindowRooView : Object
                public bool always_show_image;
 
                // ctor
-               public Xcls_MenuButton24(Xcls_WindowRooView _owner )
+               public Xcls_MenuButton23(Xcls_WindowRooView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.MenuButton();
@@ -2023,13 +2051,14 @@ public class Xcls_WindowRooView : Object
                        // my vars (dec)
 
                        // set gobject values
-                       var child_1 = new Xcls_Box26( _this );
+                       var child_1 = new Xcls_Box25( _this );
+                       child_1.ref();
                        this.el.child = child_1.el;
                }
 
                // user defined functions
        }
-       public class Xcls_Box26 : Object
+       public class Xcls_Box25 : Object
        {
                public Gtk.Box el;
                private Xcls_WindowRooView  _this;
@@ -2038,7 +2067,7 @@ public class Xcls_WindowRooView : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_Box26(Xcls_WindowRooView _owner )
+               public Xcls_Box25(Xcls_WindowRooView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );