File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 27
27
import processing .app .helpers .OSUtils ;
28
28
import processing .app .helpers .SimpleAction ;
29
29
import processing .app .tools .MenuScroller ;
30
+ import java .awt .event .MouseWheelListener ;
31
+ import java .awt .event .MouseWheelEvent ;
32
+
30
33
import static processing .app .I18n .tr ;
31
34
32
35
import java .awt .*;
@@ -189,6 +192,25 @@ public void mousePressed(MouseEvent e) {
189
192
}
190
193
}
191
194
});
195
+
196
+ this .addMouseWheelListener (new MouseAdapter () {
197
+ public void mouseWheelMoved (MouseWheelEvent e ) {
198
+ if (e .getWheelRotation () > 0 ) {
199
+ int index = editor .getCurrentTabIndex () + 1 ;
200
+ if (index >= (editor .getTabs ().size ())) {
201
+ index = 0 ;
202
+ }
203
+ editor .selectTab (index );
204
+ } else {
205
+ int index = editor .getCurrentTabIndex () - 1 ;
206
+ if (index < 0 ) {
207
+ index = editor .getTabs ().size () -1 ;
208
+ }
209
+ editor .selectTab (index );
210
+ }
211
+ repaint ();
212
+ }
213
+ });
192
214
}
193
215
194
216
You can’t perform that action at this time.
0 commit comments