IDEA-132765 Floating progress indicator doesn't disappear after exiting Distraction Free mode or Presentation mode

This commit is contained in:
Sergey Ignatov
2015-09-14 13:10:35 +03:00
parent 41b3657a89
commit cbdd540b58
2 changed files with 42 additions and 38 deletions
@@ -15,7 +15,6 @@
*/
package com.intellij.openapi.wm.impl.status;
import com.intellij.ide.ui.UISettings;
import com.intellij.idea.ActionsBundle;
import com.intellij.notification.EventLog;
import com.intellij.openapi.actionSystem.ActionGroup;
@@ -376,45 +375,42 @@ public class InfoAndProgressPanel extends JPanel implements CustomStatusBarWidge
myRefreshAndInfoPanel.revalidate();
myRefreshAndInfoPanel.repaint();
UISettings uiSettings = UISettings.getInstance();
if (uiSettings.PRESENTATION_MODE || !uiSettings.SHOW_STATUS_BAR && Registry.is("ide.show.progress.without.status.bar")) {
final JRootPane pane = myInfoPanel.getRootPane();
assert pane != null;
final PresentationModeProgressPanel panel = new PresentationModeProgressPanel(inline);
final MyInlineProgressIndicator delegate = new MyInlineProgressIndicator(true, inline.getInfo(), inline) {
@Override
protected void updateProgress() {
super.updateProgress();
panel.update();
}
};
final JRootPane pane = myInfoPanel.getRootPane();
assert pane != null;
final PresentationModeProgressPanel panel = new PresentationModeProgressPanel(inline);
MyInlineProgressIndicator delegate = new MyInlineProgressIndicator(true, inline.getInfo(), inline) {
@Override
protected void updateProgress() {
super.updateProgress();
panel.update();
}
};
Disposer.register(inline, delegate);
Disposer.register(inline, delegate);
final Component anchor = getAnchor(pane);
Component anchor = getAnchor(pane);
JBPopupFactory.getInstance().createBalloonBuilder(panel.getProgressPanel())
.setFadeoutTime(0)
.setFillColor(Gray.TRANSPARENT)
.setShowCallout(false)
.setBorderColor(Gray.TRANSPARENT)
.setBorderInsets(JBUI.emptyInsets())
.setAnimationCycle(0)
.setCloseButtonEnabled(false)
.setHideOnClickOutside(false)
.setDisposable(inline)
.setHideOnFrameResize(false)
.setHideOnKeyOutside(false)
.setBlockClicksThroughBalloon(true)
.setHideOnAction(false)
.createBalloon().show(new PositionTracker<Balloon>(anchor) {
@Override
public RelativePoint recalculateLocation(Balloon object) {
Component c = getAnchor(pane);
return new RelativePoint(c, new Point(c.getWidth() - 150, c.getHeight() - 45));
}
}, Balloon.Position.above);
}
JBPopupFactory.getInstance().createBalloonBuilder(panel.getProgressPanel())
.setFadeoutTime(0)
.setFillColor(Gray.TRANSPARENT)
.setShowCallout(false)
.setBorderColor(Gray.TRANSPARENT)
.setBorderInsets(JBUI.emptyInsets())
.setAnimationCycle(0)
.setCloseButtonEnabled(false)
.setHideOnClickOutside(false)
.setDisposable(inline)
.setHideOnFrameResize(false)
.setHideOnKeyOutside(false)
.setBlockClicksThroughBalloon(true)
.setHideOnAction(false)
.createBalloon().show(new PositionTracker<Balloon>(anchor) {
@Override
public RelativePoint recalculateLocation(Balloon object) {
Component c = getAnchor(pane);
return new RelativePoint(c, new Point(c.getWidth() - 150, c.getHeight() - 45));
}
}, Balloon.Position.above);
}
@NotNull
@@ -16,8 +16,10 @@
package com.intellij.openapi.wm.impl.status;
import com.intellij.icons.AllIcons;
import com.intellij.ide.ui.UISettings;
import com.intellij.openapi.editor.colors.EditorColorsManager;
import com.intellij.openapi.ui.popup.IconButton;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.InplaceButton;
import com.intellij.ui.TransparentPanel;
@@ -98,7 +100,13 @@ public class PresentationModeProgressPanel {
}
private void createUIComponents() {
myRootPanel = new TransparentPanel(0.5f);
myRootPanel = new TransparentPanel(0.5f) {
@Override
public boolean isVisible() {
UISettings ui = UISettings.getInstance();
return ui.PRESENTATION_MODE || !ui.SHOW_STATUS_BAR && Registry.is("ide.show.progress.without.status.bar");
}
};
final IconButton iconButton = new IconButton(myProgress.getInfo().getCancelTooltipText(),
AllIcons.Process.Stop,
AllIcons.Process.StopHovered);