mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't cheat with statistics
This commit is contained in:
@@ -434,6 +434,9 @@ public class IdeEventQueue extends EventQueue {
|
||||
|
||||
if (e instanceof KeyEvent) {
|
||||
myKeyboardBusy = e.getID() != KeyEvent.KEY_RELEASED || ((KeyEvent)e).getModifiers() != 0;
|
||||
if (e.getID() == KeyEvent.KEY_RELEASED && ((KeyEvent)e).getKeyCode() == KeyEvent.VK_SHIFT) {
|
||||
myMouseEventDispatcher.resetHorScrollingTracker();
|
||||
}
|
||||
}
|
||||
|
||||
if (!typeaheadFlushing && typeAheadDispatchToFocusManager(e)) return;
|
||||
|
||||
+10
-2
@@ -47,6 +47,7 @@ public final class IdeMouseEventDispatcher {
|
||||
private final PresentationFactory myPresentationFactory = new PresentationFactory();
|
||||
private final ArrayList<AnAction> myActions = new ArrayList<AnAction>(1);
|
||||
private final Map<Container, Integer> myRootPane2BlockedId = new HashMap<Container, Integer>();
|
||||
private int myLastHorScrolledComponentHash = 0;
|
||||
|
||||
public IdeMouseEventDispatcher() {
|
||||
}
|
||||
@@ -187,16 +188,23 @@ public final class IdeMouseEventDispatcher {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean doHorizontalScrolling(Component c, MouseWheelEvent me) {
|
||||
FeatureUsageTracker.getInstance().triggerFeatureUsed("ui.horizontal.scrolling");
|
||||
private boolean doHorizontalScrolling(Component c, MouseWheelEvent me) {
|
||||
final JScrollBar scrollBar = findHorizontalScrollBar(c);
|
||||
if (scrollBar != null) {
|
||||
if (scrollBar.hashCode() != myLastHorScrolledComponentHash) {
|
||||
FeatureUsageTracker.getInstance().triggerFeatureUsed("ui.horizontal.scrolling");
|
||||
myLastHorScrolledComponentHash = scrollBar.hashCode();
|
||||
}
|
||||
scrollBar.setValue(scrollBar.getValue() + getScrollAmount(c, me, scrollBar));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void resetHorScrollingTracker() {
|
||||
myLastHorScrolledComponentHash = 0;
|
||||
}
|
||||
|
||||
private static int getScrollAmount(Component c, MouseWheelEvent me, JScrollBar scrollBar) {
|
||||
final int ratio = Registry.is("ide.smart.horizontal.scrolling")
|
||||
? Math.max((int)Math.pow(c.getWidth() / scrollBar.getWidth() , 2), 10) : 10; // do annoying scrolling faster if smart scrolling is on
|
||||
|
||||
Reference in New Issue
Block a user