File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 2727import processing .app .helpers .OSUtils ;
2828import processing .app .helpers .SimpleAction ;
2929import processing .app .tools .MenuScroller ;
30+ import java .awt .event .MouseWheelListener ;
31+ import java .awt .event .MouseWheelEvent ;
32+
3033import static processing .app .I18n .tr ;
3134
3235import java .awt .*;
@@ -189,6 +192,25 @@ public void mousePressed(MouseEvent e) {
189192 }
190193 }
191194 });
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+ });
192214 }
193215
194216
You can’t perform that action at this time.
0 commit comments