jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1782521 - /jmeter/trunk/src/core/org/apache/jmeter/gui/MainFrame.java
Date Fri, 10 Feb 2017 20:40:08 GMT
Author: fschumacher
Date: Fri Feb 10 20:40:08 2017
New Revision: 1782521

URL: http://svn.apache.org/viewvc?rev=1782521&view=rev
Log:
Register a mousewheel listener to enable zooming with ctrl+mouswheel up/down.

Bugzilla Id: 59995

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/MainFrame.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/MainFrame.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/MainFrame.java?rev=1782521&r1=1782520&r2=1782521&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/MainFrame.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/MainFrame.java Fri Feb 10 20:40:08 2017
@@ -235,6 +235,19 @@ public class MainFrame extends JFrame im
         init();
         initTopLevelDndHandler();
         setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
+        
+        addMouseWheelListener(e -> {
+            if (e.isControlDown()) {
+                final float scale = 1.1f;
+                int rotation = e.getWheelRotation();
+                if (rotation > 0) { // DOWN
+                    JMeterUtils.applyScaleOnFonts(1.0f/scale);
+                } else if (rotation < 0) { // UP
+                    JMeterUtils.applyScaleOnFonts(scale);
+                }
+                e.consume();
+            }
+        });
     }
 
     protected void computeTestDuration(ActionEvent evt) {



Mime
View raw message