[vcs-log] do not try to resize last table column by dagging table edge (does not...
authorJulia Beliaeva <Julia.Beliaeva@jetbrains.com>
Thu, 26 May 2016 20:39:22 +0000 (23:39 +0300)
committerJulia Beliaeva <Julia.Beliaeva@jetbrains.com>
Thu, 26 May 2016 21:17:13 +0000 (00:17 +0300)
platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/VcsLogGraphTable.java

index d1c5afc54d7bc6d681c396dd2f2aad8a7a3020ba..7f209aded50c880a166f1ea8003725e7a6763b57 100644 (file)
@@ -937,11 +937,13 @@ public class VcsLogGraphTable extends TableWithProgress implements DataProvider,
 
     @Override
     public void mousePressed(@NotNull MouseEvent e) {
+      if (isOnBorder(e)) return;
       mouseInputListener.mousePressed(convertMouseEvent(e));
     }
 
     @Override
     public void mouseReleased(@NotNull MouseEvent e) {
+      if (isOnBorder(e)) return;
       mouseInputListener.mouseReleased(convertMouseEvent(e));
     }
 
@@ -955,13 +957,19 @@ public class VcsLogGraphTable extends TableWithProgress implements DataProvider,
 
     @Override
     public void mouseDragged(@NotNull MouseEvent e) {
+      if (isOnBorder(e)) return;
       mouseInputListener.mouseDragged(convertMouseEvent(e));
     }
 
     @Override
     public void mouseMoved(@NotNull MouseEvent e) {
+      if (isOnBorder(e)) return;
       mouseInputListener.mouseMoved(convertMouseEvent(e));
     }
+
+    public boolean isOnBorder(@NotNull MouseEvent e) {
+      return Math.abs(header.getTable().getWidth() - e.getPoint().x) <= JBUI.scale(3);
+    }
   }
 
   private class MyListSelectionListener implements ListSelectionListener {