From 414bef0ce19c172fdfd5e72310bf7877acb480b3 Mon Sep 17 00:00:00 2001 From: Anciety Date: Thu, 18 Apr 2019 11:10:22 +0800 Subject: [PATCH] add Mac OS X horizontal scroll with mouse wheel (touch pad two fingers scrolling) --- .../java/docking/widgets/fieldpanel/FieldPanel.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/FieldPanel.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/FieldPanel.java index 5b8059da8d..4404134dbf 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/FieldPanel.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/FieldPanel.java @@ -1428,7 +1428,16 @@ public class FieldPanel extends JPanel } else { hoverHandler.stopHover(); - scrollView(scrollAmount); + + if (e.isShiftDown()) { + // horizontal scroll (only move viewport) + if (viewport != null) { + Point pos = viewport.getViewPosition(); + viewport.setViewPosition(new Point(Math.max(0, pos.x + scrollAmount), pos.y)); + } + } else { + scrollView(scrollAmount); + } } e.consume(); }