Fix #8037 - bug on zoom release-5.0.3
authorAlan <alan@roojs.com>
Thu, 15 Feb 2024 07:01:25 +0000 (15:01 +0800)
committerAlan <alan@roojs.com>
Thu, 15 Feb 2024 07:01:25 +0000 (15:01 +0800)
org.roojs.roobuilder.json
src/Builder4/Editor.bjs
src/Builder4/Editor.vala
src/Builder4/GtkView.bjs
src/Builder4/GtkView.vala
src/Builder4/WindowRooView.bjs
src/Builder4/WindowRooView.vala
src/Settings.vala

index 34c9e06..b243e20 100644 (file)
@@ -68,7 +68,6 @@
             "sources": [
                 {
                     "type": "git",
-                    "tag": "master",
                     "url": "https://github.com/roojs/roobuilder.git",
                     "commit" : "c9e3306f3a430ed15155ac45ef097f9d7dbafe03"
                        }
index 9d335fd..f52fdfb 100644 (file)
@@ -57,7 +57,7 @@
         " \tBuilderApplication.settings.editor_font_size_updated.connect(",
         " \t\t() => {",
         " \t\t\tBuilderApplication.settings.editor_font_size_inchange = true;",
-        " \t\t\tGLib.debug(\"update range\");",
+        " \t\t//\tGLib.debug(\"update range\");",
         " \t\t \tthis.el.set_value (BuilderApplication.settings.editor_font_size);",
         " \t\t \tBuilderApplication.settings.editor_font_size_inchange = false;",
         " \t\t}",
            "\tif (!_this.keystate.is_control) {",
            "\t\treturn false;",
            "\t}",
-           "\t//GLib.debug(\"scroll %f\",  dy);",
+           "\t //GLib.debug(\"scroll %f\",  dy);",
            "\t",
            "\tthis.distance += dy;",
-           "\tif (this.distance < 1) {",
+           "\t",
+           "\t//GLib.debug(\"scroll %f / %f\",  dy, this.distance);",
+           " ",
+           "\t if (this.distance < -1) {",
+           " ",
            "\t\tBuilderApplication.settings.editor_font_size ++;",
            "\t\tthis.distance = 0;",
            "\t}",
-           "\tif (this.distance > -1) {",
+           "\tif (this.distance > 1) {",
            "\t\tBuilderApplication.settings.editor_font_size --;",
            "\t\tthis.distance = 0;",
            "\t}",
-           "",
+           "\t ",
            "\treturn true;",
            "}",
            ""
index 0a52e87..27baccb 100644 (file)
@@ -69,7 +69,7 @@ public class Editor : Object
                this.el.append( child_1.el );
                new Xcls_RightEditor( _this );
                this.el.append( _this.RightEditor.el );
-               var child_3 = new Xcls_Box11( _this );
+               var child_3 = new Xcls_Box12( _this );
                child_3.ref();
                this.el.append ( child_3.el  );
        }
@@ -501,7 +501,7 @@ public class Editor : Object
                                BuilderApplication.settings.editor_font_size_updated.connect(
                                        () => {
                                                BuilderApplication.settings.editor_font_size_inchange = true;
-                                               GLib.debug("update range");
+                                       //      GLib.debug("update range");
                                                this.el.set_value (BuilderApplication.settings.editor_font_size);
                                                BuilderApplication.settings.editor_font_size_inchange = false;
                                        }
@@ -645,7 +645,7 @@ public class Editor : Object
                        this.el.buffer = _this.buffer.el;
                        new Xcls_keystate( _this );
                        this.el.add_controller(  _this.keystate.el );
-                       var child_3 = new Xcls_EventControllerScroll63( _this );
+                       var child_3 = new Xcls_EventControllerScroll11( _this );
                        child_3.ref();
                        this.el.add_controller(  child_3.el );
 
@@ -1158,7 +1158,7 @@ public class Editor : Object
                // user defined functions
        }
 
-       public class Xcls_EventControllerScroll63 : Object
+       public class Xcls_EventControllerScroll11 : Object
        {
                public Gtk.EventControllerScroll el;
                private Editor  _this;
@@ -1168,7 +1168,7 @@ public class Editor : Object
                public double distance;
 
                // ctor
-               public Xcls_EventControllerScroll63(Editor _owner )
+               public Xcls_EventControllerScroll11(Editor _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.EventControllerScroll( Gtk.EventControllerScrollFlags.VERTICAL );
@@ -1183,18 +1183,22 @@ public class Editor : Object
                                if (!_this.keystate.is_control) {
                                        return false;
                                }
-                               //GLib.debug("scroll %f",  dy);
+                                //GLib.debug("scroll %f",  dy);
                                
                                this.distance += dy;
-                               if (this.distance < 1) {
+                               
+                               //GLib.debug("scroll %f / %f",  dy, this.distance);
+                        
+                                if (this.distance < -1) {
+                        
                                        BuilderApplication.settings.editor_font_size ++;
                                        this.distance = 0;
                                }
-                               if (this.distance > -1) {
+                               if (this.distance > 1) {
                                        BuilderApplication.settings.editor_font_size --;
                                        this.distance = 0;
                                }
-                       
+                                
                                return true;
                        });
                }
@@ -1204,7 +1208,7 @@ public class Editor : Object
 
 
 
-       public class Xcls_Box11 : Object
+       public class Xcls_Box12 : Object
        {
                public Gtk.Box el;
                private Editor  _this;
@@ -1213,7 +1217,7 @@ public class Editor : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_Box11(Editor _owner )
+               public Xcls_Box12(Editor _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
@@ -1231,7 +1235,7 @@ public class Editor : Object
                        this.el.append( _this.nextBtn.el );
                        new Xcls_backBtn( _this );
                        this.el.append( _this.backBtn.el );
-                       var child_5 = new Xcls_MenuButton17( _this );
+                       var child_5 = new Xcls_MenuButton18( _this );
                        child_5.ref();
                        this.el.append( child_5.el );
                }
@@ -1261,7 +1265,7 @@ public class Editor : Object
                        this.el.hexpand = true;
                        this.el.placeholder_text = "Press enter to search";
                        this.el.search_delay = 3;
-                       var child_1 = new Xcls_EventControllerKey13( _this );
+                       var child_1 = new Xcls_EventControllerKey14( _this );
                        child_1.ref();
                        this.el.add_controller(  child_1.el );
 
@@ -1306,7 +1310,7 @@ public class Editor : Object
                        
                }
        }
-       public class Xcls_EventControllerKey13 : Object
+       public class Xcls_EventControllerKey14 : Object
        {
                public Gtk.EventControllerKey el;
                private Editor  _this;
@@ -1315,7 +1319,7 @@ public class Editor : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_EventControllerKey13(Editor _owner )
+               public Xcls_EventControllerKey14(Editor _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.EventControllerKey();
@@ -1466,7 +1470,7 @@ public class Editor : Object
                // user defined functions
        }
 
-       public class Xcls_MenuButton17 : Object
+       public class Xcls_MenuButton18 : Object
        {
                public Gtk.MenuButton el;
                private Editor  _this;
@@ -1476,7 +1480,7 @@ public class Editor : Object
                public bool always_show_image;
 
                // ctor
-               public Xcls_MenuButton17(Editor _owner )
+               public Xcls_MenuButton18(Editor _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.MenuButton();
@@ -1511,14 +1515,14 @@ public class Editor : Object
                        // my vars (dec)
 
                        // set gobject values
-                       var child_1 = new Xcls_Box19( _this );
+                       var child_1 = new Xcls_Box20( _this );
                        child_1.ref();
                        this.el.child = child_1.el;
                }
 
                // user defined functions
        }
-       public class Xcls_Box19 : Object
+       public class Xcls_Box20 : Object
        {
                public Gtk.Box el;
                private Editor  _this;
@@ -1527,7 +1531,7 @@ public class Editor : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_Box19(Editor _owner )
+               public Xcls_Box20(Editor _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
index 7a88731..cb86d02 100644 (file)
                "\t//GLib.debug(\"scroll %f\",  dy);",
                "\t",
                "\tthis.distance += dy;",
-               "\tif (this.distance < 1) {",
+               "\t if (this.distance < -1) {",
                "\t\tBuilderApplication.settings.editor_font_size ++;",
                "\t\tthis.distance = 0;",
                "\t}",
-               "\tif (this.distance > -1) {",
+               "\tif (this.distance > 1) {",
                "\t\tBuilderApplication.settings.editor_font_size --;",
                "\t\tthis.distance = 0;",
                "\t}",
index dfed016..6cc6fa6 100644 (file)
@@ -578,7 +578,7 @@ public class Xcls_GtkView : Object
                        // set gobject values
                        new Xcls_sourceviewscroll( _this );
                        this.el.append( _this.sourceviewscroll.el );
-                       var child_2 = new Xcls_Box12( _this );
+                       var child_2 = new Xcls_Box13( _this );
                        child_2.ref();
                        this.el.append( child_2.el );
                }
@@ -643,7 +643,7 @@ public class Xcls_GtkView : Object
                        this.el.set_buffer ( _this.buffer.el  );
                        new Xcls_keystate( _this );
                        this.el.add_controller(  _this.keystate.el );
-                       var child_3 = new Xcls_EventControllerScroll37( _this );
+                       var child_3 = new Xcls_EventControllerScroll12( _this );
                        child_3.ref();
                        this.el.add_controller(  child_3.el );
 
@@ -1008,7 +1008,7 @@ public class Xcls_GtkView : Object
                // user defined functions
        }
 
-       public class Xcls_EventControllerScroll37 : Object
+       public class Xcls_EventControllerScroll12 : Object
        {
                public Gtk.EventControllerScroll el;
                private Xcls_GtkView  _this;
@@ -1018,7 +1018,7 @@ public class Xcls_GtkView : Object
                public double distance;
 
                // ctor
-               public Xcls_EventControllerScroll37(Xcls_GtkView _owner )
+               public Xcls_EventControllerScroll12(Xcls_GtkView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.EventControllerScroll( Gtk.EventControllerScrollFlags.VERTICAL );
@@ -1036,11 +1036,11 @@ public class Xcls_GtkView : Object
                                //GLib.debug("scroll %f",  dy);
                                
                                this.distance += dy;
-                               if (this.distance < 1) {
+                                if (this.distance < -1) {
                                        BuilderApplication.settings.editor_font_size ++;
                                        this.distance = 0;
                                }
-                               if (this.distance > -1) {
+                               if (this.distance > 1) {
                                        BuilderApplication.settings.editor_font_size --;
                                        this.distance = 0;
                                }
@@ -1054,7 +1054,7 @@ public class Xcls_GtkView : Object
 
 
 
-       public class Xcls_Box12 : Object
+       public class Xcls_Box13 : Object
        {
                public Gtk.Box el;
                private Xcls_GtkView  _this;
@@ -1063,7 +1063,7 @@ public class Xcls_GtkView : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_Box12(Xcls_GtkView _owner )
+               public Xcls_Box13(Xcls_GtkView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
@@ -1081,7 +1081,7 @@ public class Xcls_GtkView : Object
                        this.el.append( _this.nextBtn.el );
                        new Xcls_backBtn( _this );
                        this.el.append( _this.backBtn.el );
-                       var child_5 = new Xcls_MenuButton18( _this );
+                       var child_5 = new Xcls_MenuButton19( _this );
                        child_5.ref();
                        this.el.append( child_5.el );
                }
@@ -1111,7 +1111,7 @@ public class Xcls_GtkView : Object
                        this.el.hexpand = true;
                        this.el.placeholder_text = "Press enter to search";
                        this.el.search_delay = 3;
-                       var child_1 = new Xcls_EventControllerKey14( _this );
+                       var child_1 = new Xcls_EventControllerKey15( _this );
                        child_1.ref();
                        this.el.add_controller(  child_1.el );
 
@@ -1159,7 +1159,7 @@ public class Xcls_GtkView : Object
                        
                }
        }
-       public class Xcls_EventControllerKey14 : Object
+       public class Xcls_EventControllerKey15 : Object
        {
                public Gtk.EventControllerKey el;
                private Xcls_GtkView  _this;
@@ -1168,7 +1168,7 @@ public class Xcls_GtkView : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_EventControllerKey14(Xcls_GtkView _owner )
+               public Xcls_EventControllerKey15(Xcls_GtkView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.EventControllerKey();
@@ -1318,7 +1318,7 @@ public class Xcls_GtkView : Object
                // user defined functions
        }
 
-       public class Xcls_MenuButton18 : Object
+       public class Xcls_MenuButton19 : Object
        {
                public Gtk.MenuButton el;
                private Xcls_GtkView  _this;
@@ -1328,7 +1328,7 @@ public class Xcls_GtkView : Object
                public bool always_show_image;
 
                // ctor
-               public Xcls_MenuButton18(Xcls_GtkView _owner )
+               public Xcls_MenuButton19(Xcls_GtkView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.MenuButton();
@@ -1363,14 +1363,14 @@ public class Xcls_GtkView : Object
                        // my vars (dec)
 
                        // set gobject values
-                       var child_1 = new Xcls_Box20( _this );
+                       var child_1 = new Xcls_Box21( _this );
                        child_1.ref();
                        this.el.set_child ( child_1.el  );
                }
 
                // user defined functions
        }
-       public class Xcls_Box20 : Object
+       public class Xcls_Box21 : Object
        {
                public Gtk.Box el;
                private Xcls_GtkView  _this;
@@ -1379,7 +1379,7 @@ public class Xcls_GtkView : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_Box20(Xcls_GtkView _owner )
+               public Xcls_Box21(Xcls_GtkView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
index 71df426..98fa40c 100644 (file)
                "\t//GLib.debug(\"scroll %f\",  dy);",
                "\t",
                "\tthis.distance += dy;",
-               "\tif (this.distance < 1) {",
+               "\t if (this.distance < -1) {",
+               " ",
                "\t\tBuilderApplication.settings.editor_font_size ++;",
                "\t\tthis.distance = 0;",
                "\t}",
-               "\tif (this.distance > -1) {",
+               "\tif (this.distance > 1) {",
                "\t\tBuilderApplication.settings.editor_font_size --;",
                "\t\tthis.distance = 0;",
                "\t}",
index 1d028a5..6f40526 100644 (file)
@@ -1027,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_Box17( _this );
+                       var child_2 = new Xcls_Box18( _this );
                        child_2.ref();
                        this.el.append( child_2.el );
                }
@@ -1100,7 +1100,7 @@ public class Xcls_WindowRooView : Object
                        this.el.set_buffer ( _this.buffer.el  );
                        new Xcls_keystate( _this );
                        this.el.add_controller ( _this.keystate.el  );
-                       var child_3 = new Xcls_EventControllerScroll32( _this );
+                       var child_3 = new Xcls_EventControllerScroll17( _this );
                        child_3.ref();
                        this.el.add_controller(  child_3.el );
 
@@ -1701,7 +1701,7 @@ public class Xcls_WindowRooView : Object
                // user defined functions
        }
 
-       public class Xcls_EventControllerScroll32 : Object
+       public class Xcls_EventControllerScroll17 : Object
        {
                public Gtk.EventControllerScroll el;
                private Xcls_WindowRooView  _this;
@@ -1711,7 +1711,7 @@ public class Xcls_WindowRooView : Object
                public double distance;
 
                // ctor
-               public Xcls_EventControllerScroll32(Xcls_WindowRooView _owner )
+               public Xcls_EventControllerScroll17(Xcls_WindowRooView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.EventControllerScroll( Gtk.EventControllerScrollFlags.VERTICAL );
@@ -1729,11 +1729,12 @@ public class Xcls_WindowRooView : Object
                                //GLib.debug("scroll %f",  dy);
                                
                                this.distance += dy;
-                               if (this.distance < 1) {
+                                if (this.distance < -1) {
+                        
                                        BuilderApplication.settings.editor_font_size ++;
                                        this.distance = 0;
                                }
-                               if (this.distance > -1) {
+                               if (this.distance > 1) {
                                        BuilderApplication.settings.editor_font_size --;
                                        this.distance = 0;
                                }
@@ -1747,7 +1748,7 @@ public class Xcls_WindowRooView : Object
 
 
 
-       public class Xcls_Box17 : Object
+       public class Xcls_Box18 : Object
        {
                public Gtk.Box el;
                private Xcls_WindowRooView  _this;
@@ -1756,7 +1757,7 @@ public class Xcls_WindowRooView : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_Box17(Xcls_WindowRooView _owner )
+               public Xcls_Box18(Xcls_WindowRooView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
@@ -1774,7 +1775,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_MenuButton23( _this );
+                       var child_5 = new Xcls_MenuButton24( _this );
                        child_5.ref();
                        this.el.append( child_5.el );
                }
@@ -1802,7 +1803,7 @@ 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_EventControllerKey19( _this );
+                       var child_1 = new Xcls_EventControllerKey20( _this );
                        child_1.ref();
                        this.el.add_controller(  child_1.el );
 
@@ -1847,7 +1848,7 @@ public class Xcls_WindowRooView : Object
                        
                }
        }
-       public class Xcls_EventControllerKey19 : Object
+       public class Xcls_EventControllerKey20 : Object
        {
                public Gtk.EventControllerKey el;
                private Xcls_WindowRooView  _this;
@@ -1856,7 +1857,7 @@ public class Xcls_WindowRooView : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_EventControllerKey19(Xcls_WindowRooView _owner )
+               public Xcls_EventControllerKey20(Xcls_WindowRooView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.EventControllerKey();
@@ -2007,7 +2008,7 @@ public class Xcls_WindowRooView : Object
                // user defined functions
        }
 
-       public class Xcls_MenuButton23 : Object
+       public class Xcls_MenuButton24 : Object
        {
                public Gtk.MenuButton el;
                private Xcls_WindowRooView  _this;
@@ -2017,7 +2018,7 @@ public class Xcls_WindowRooView : Object
                public bool always_show_image;
 
                // ctor
-               public Xcls_MenuButton23(Xcls_WindowRooView _owner )
+               public Xcls_MenuButton24(Xcls_WindowRooView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.MenuButton();
@@ -2051,14 +2052,14 @@ public class Xcls_WindowRooView : Object
                        // my vars (dec)
 
                        // set gobject values
-                       var child_1 = new Xcls_Box25( _this );
+                       var child_1 = new Xcls_Box26( _this );
                        child_1.ref();
                        this.el.child = child_1.el;
                }
 
                // user defined functions
        }
-       public class Xcls_Box25 : Object
+       public class Xcls_Box26 : Object
        {
                public Gtk.Box el;
                private Xcls_WindowRooView  _this;
@@ -2067,7 +2068,7 @@ public class Xcls_WindowRooView : Object
                        // my vars (def)
 
                // ctor
-               public Xcls_Box25(Xcls_WindowRooView _owner )
+               public Xcls_Box26(Xcls_WindowRooView _owner )
                {
                        _this = _owner;
                        this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
index 488284f..57c456e 100644 (file)
@@ -24,6 +24,9 @@ public class Settings : Object  {
                }
                set {
                        GLib.debug("updated to %d", (int) value );
+                       if (value < 6 || value > 50) {
+                               return;
+                       }
                        this._editor_font_size = (int) value;
                        if (this.css != null) {
                                this.css.load_from_string(