IDEA-174108 Add space between cancel button and progressbar, change Darcula colors

This commit is contained in:
Kirill Kirichenko
2017-11-03 16:57:07 +03:00
parent 6483ecdf64
commit 4e4dc272ec
2 changed files with 11 additions and 15 deletions
@@ -24,7 +24,7 @@ public class DarculaProgressBarUI extends BasicProgressBarUI {
private static final Color REMAINDER_COLOR = new JBColor(() -> UIUtil.isUnderWin10LookAndFeel() ?
Gray.xCC :
new JBColor(Gray.xC4, Gray.x69));
new JBColor(Gray.xC4, Gray.x55));
@SuppressWarnings("UseJBColor")
private static final Color FINISHED_COLOR = new JBColor(() -> UIUtil.isUnderWin10LookAndFeel() ?
@@ -23,6 +23,7 @@ import com.intellij.openapi.progress.TaskInfo;
import com.intellij.openapi.progress.util.ProgressIndicatorBase;
import com.intellij.openapi.ui.GraphicsConfig;
import com.intellij.openapi.ui.popup.IconButton;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.ColorUtil;
import com.intellij.ui.InplaceButton;
import com.intellij.ui.components.panels.NonOpaquePanel;
@@ -30,11 +31,11 @@ import com.intellij.ui.components.panels.Wrapper;
import com.intellij.util.containers.JBIterable;
import com.intellij.util.ui.GraphicsUtil;
import com.intellij.util.ui.GridBag;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@@ -73,14 +74,9 @@ public class InlineProgressIndicator extends ProgressIndicatorBase implements Di
JPanel textAndProgress = new NonOpaquePanel(new BorderLayout());
textAndProgress.add(myText, BorderLayout.CENTER);
final NonOpaquePanel progressWrapper = new NonOpaquePanel(new GridBagLayout());
progressWrapper.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));
final GridBagConstraints c = new GridBagConstraints();
c.weightx = 1;
c.weighty = 1;
c.insets = new Insets(1, 0, 1, myInfo.isCancellable() ? 0 : 4);
c.fill = GridBagConstraints.HORIZONTAL;
progressWrapper.add(myProgress, c);
final NonOpaquePanel progressWrapper = new NonOpaquePanel(new BorderLayout());
progressWrapper.setBorder(JBUI.Borders.empty(0, 4));
progressWrapper.add(myProgress, BorderLayout.CENTER);
textAndProgress.add(progressWrapper, BorderLayout.EAST);
myComponent.add(textAndProgress, BorderLayout.CENTER);
@@ -91,10 +87,10 @@ public class InlineProgressIndicator extends ProgressIndicatorBase implements Di
myProcessName.setText(processInfo.getTitle());
myComponent.add(myProcessName, BorderLayout.NORTH);
myProcessName.setForeground(UIUtil.getPanelBackground().brighter().brighter());
myProcessName.setBorder(new EmptyBorder(2, 2, 2, 2));
myProcessName.setBorder(JBUI.Borders.empty(2));
final NonOpaquePanel content = new NonOpaquePanel(new BorderLayout());
content.setBorder(new EmptyBorder(2, 2, 2, myInfo.isCancellable() ? 2 : 4));
content.setBorder(JBUI.Borders.empty(2, 2, 2, myInfo.isCancellable() ? 2 : 4));
myComponent.add(content, BorderLayout.CENTER);
content.add(createButtonPanel(myEastButtons.map(b -> withBorder(b.button))), BorderLayout.EAST);
@@ -102,7 +98,7 @@ public class InlineProgressIndicator extends ProgressIndicatorBase implements Di
content.add(myProgress, BorderLayout.CENTER);
content.add(myText2, BorderLayout.SOUTH);
myComponent.setBorder(new EmptyBorder(2, 2, 2, 2));
myComponent.setBorder(JBUI.Borders.empty(2));
}
if (!myCompact) {
@@ -124,7 +120,7 @@ public class InlineProgressIndicator extends ProgressIndicatorBase implements Di
private static Wrapper withBorder(InplaceButton button) {
Wrapper wrapper = new Wrapper(button);
wrapper.setBorder(new EmptyBorder(0, 3, 0, 2));
wrapper.setBorder(JBUI.Borders.empty(0, 3, 0, 2));
return wrapper;
}
@@ -181,7 +177,7 @@ public class InlineProgressIndicator extends ProgressIndicatorBase implements Di
myText.setText(getText() != null ? getText() : "");
myText2.setText(getText2() != null ? getText2() : "");
if (myCompact && myText.getText().isEmpty()) {
if (myCompact && StringUtil.isEmpty(myText.getText())) {
myText.setText(myInfo.getTitle());
}