Skip to content

Commit

Permalink
Ensure left search results panel is always visible.
Browse files Browse the repository at this point in the history
initialize divider position with a minimal value.
  • Loading branch information
mbien committed Dec 23, 2024
1 parent be051eb commit fc77252
Showing 1 changed file with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,17 @@ public BasicSearchResultsPanel(ResultModel resultModel,
}

private void init() {
JPanel leftPanel = new JPanel();
leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.PAGE_AXIS));
leftPanel.add(resultsOutlineSupport.getOutlineView());

this.splitPane = new JSplitPane();
splitPane.setLeftComponent(leftPanel);
splitPane.setRightComponent(new ContextView(resultModel,
getExplorerManager()));
splitPane = new JSplitPane();
splitPane.setLeftComponent(resultsOutlineSupport.getOutlineView());
splitPane.setRightComponent(new ContextView(resultModel, getExplorerManager()));
initSplitDividerLocationHandling();
getContentPanel().add(splitPane);
}

private void initSplitDividerLocationHandling() {
int location = FindDialogMemory.getDefault().getReplaceResultsDivider();
if (location > 0) {
splitPane.setDividerLocation(location);
}
splitPane.addPropertyChangeListener((PropertyChangeEvent evt) -> {
splitPane.setDividerLocation(Math.max(location, 250));
splitPane.addPropertyChangeListener(evt -> {
String pn = evt.getPropertyName();
if (pn.equals(JSplitPane.DIVIDER_LOCATION_PROPERTY)) {
SAVE_TASK.schedule(1000);
Expand Down

0 comments on commit fc77252

Please sign in to comment.