mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-138180 Push Dialog: last target is invisible (if it has no commits to push)
* scroll bar sometimes doesn't appear when needed, and only a part of last commit is visible->collapse and re-expand or resize helps
This commit is contained in:
@@ -29,6 +29,7 @@ import com.intellij.openapi.vcs.changes.ui.EditSourceForDialogAction;
|
||||
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
|
||||
import com.intellij.ui.*;
|
||||
import com.intellij.ui.components.JBScrollPane;
|
||||
import com.intellij.ui.components.JBViewport;
|
||||
import com.intellij.ui.components.labels.LinkLabel;
|
||||
import com.intellij.ui.components.labels.LinkListener;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
@@ -233,6 +234,10 @@ public class PushLog extends JPanel implements DataProvider {
|
||||
}
|
||||
}
|
||||
};
|
||||
if (syncStrategyPanel != null) {
|
||||
myScrollPane.setViewport(new MyTreeViewPort(myTree, syncStrategyPanel.getPreferredSize().height));
|
||||
}
|
||||
myScrollPane.getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE);
|
||||
myScrollPane.setOpaque(false);
|
||||
if (syncStrategyPanel != null) {
|
||||
myScrollPane.add(syncStrategyPanel);
|
||||
@@ -653,6 +658,23 @@ public class PushLog extends JPanel implements DataProvider {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private static class MyTreeViewPort extends JBViewport {
|
||||
|
||||
final int myHeightToReduce;
|
||||
|
||||
public MyTreeViewPort(@Nullable Component view, int heightToReduce) {
|
||||
super();
|
||||
setView(view);
|
||||
myHeightToReduce = heightToReduce;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getExtentSize() {
|
||||
Dimension defaultSize = super.getExtentSize();
|
||||
return new Dimension(defaultSize.width, defaultSize.height - myHeightToReduce);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user