Commit 263bcf78 authored by Konstantin Kolosovsky's avatar Konstantin Kolosovsky
Browse files

vcs: Allow diff preview splitter in "Local Changes" to hide all inner...

vcs: Allow diff preview splitter in "Local Changes" to hide all inner components except toolwindow toolbar
parent 68ce1dbf
Branches unavailable Tags unavailable
No related merge requests found
Showing with 14 additions and 17 deletions
+14 -17
......@@ -180,7 +180,13 @@ public class ChangesViewManager implements ChangesViewI, ProjectComponent, Persi
addBorder(changesToolbar.getComponent(), createBorder(JBColor.border(), SideBorder.RIGHT));
BorderLayoutPanel changesPanel = simplePanel(createScrollPane(myView)).addToLeft(changesToolbar.getComponent());
BorderLayoutPanel contentPanel = simplePanel(changesPanel);
BorderLayoutPanel contentPanel = new BorderLayoutPanel() {
@Override
public Dimension getMinimumSize() {
return isMinimumSizeSet() ? super.getMinimumSize() : changesToolbar.getComponent().getPreferredSize();
}
};
contentPanel.addToCenter(changesPanel);
if (isNonModalCommit()) {
contentPanel.addToBottom(new ChangesViewCommitPanel(myProject));
}
......
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.vcs.changes;
import com.intellij.ui.IdeBorderFactory;
......@@ -22,6 +8,8 @@ import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import static com.intellij.util.ui.JBUI.emptySize;
public class PreviewDiffSplitterComponent extends JBSplitter {
@NotNull private final JComponent myFirstComponent;
@NotNull private final DiffPreviewUpdateProcessor myProcessor;
......@@ -33,7 +21,6 @@ public class PreviewDiffSplitterComponent extends JBSplitter {
super(splitterDimensionKey, 0.5f);
myFirstComponent = firstComponent;
myProcessor = processor;
setHonorComponentsMinimumSize(false);
setFirstComponent(firstComponent);
setDetailsOn(detailsOn);
}
......@@ -50,6 +37,10 @@ public class PreviewDiffSplitterComponent extends JBSplitter {
private void updateVisibility() {
setSecondComponent(myDetailsOn ? myProcessor.getComponent() : null);
myFirstComponent.setBorder(myDetailsOn ? IdeBorderFactory.createBorder(SideBorder.RIGHT) : null);
JComponent secondComponent = getSecondComponent();
if (secondComponent != null) {
secondComponent.setMinimumSize(emptySize());
}
revalidate();
repaint();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment