From 6dd4274124ba48cc460e086ba392bd45fcdfbdac Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Fri, 19 Jan 2018 21:02:57 +0300 Subject: [PATCH] fix progress bar for presentation and distraction free mode for HiDPI Linux --- .../wm/impl/status/InfoAndProgressPanel.java | 6 +++--- .../status/PresentationModeProgressPanel.form | 21 +++---------------- .../status/PresentationModeProgressPanel.java | 2 ++ 3 files changed, 8 insertions(+), 21 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.java index 908735128074..635f8ebd8f30 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/InfoAndProgressPanel.java @@ -431,15 +431,15 @@ public class InfoAndProgressPanel extends JPanel implements CustomStatusBarWidge @Override public RelativePoint recalculateLocation(Balloon object) { Component c = getAnchor(pane); - int y = c.getHeight() - 45; + int y = c.getHeight() - JBUI.scale(45); if (balloonLayout != null && !isBottomSideToolWindowsVisible(pane)) { Component component = balloonLayout.getTopBalloonComponent(); if (component != null) { - y = SwingUtilities.convertPoint(component, 0, -45, c).y; + y = SwingUtilities.convertPoint(component, 0, -JBUI.scale(45), c).y; } } - return new RelativePoint(c, new Point(c.getWidth() - 150, y)); + return new RelativePoint(c, new Point(c.getWidth() - JBUI.scale(150), y)); } }, Balloon.Position.above); } diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PresentationModeProgressPanel.form b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PresentationModeProgressPanel.form index 82826388a8c6..16af39faa85d 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PresentationModeProgressPanel.form +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PresentationModeProgressPanel.form @@ -6,20 +6,13 @@ - - - - - - - - + @@ -28,11 +21,7 @@ - - - - - + @@ -41,11 +30,7 @@ - - - - - + diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PresentationModeProgressPanel.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PresentationModeProgressPanel.java index 5bea24155e4b..ab95aeb07b30 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PresentationModeProgressPanel.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/PresentationModeProgressPanel.java @@ -22,6 +22,7 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.ui.TransparentPanel; import com.intellij.util.containers.JBIterable; import com.intellij.util.ui.EmptyIcon; +import com.intellij.util.ui.JBDimension; import com.intellij.util.ui.JBUI; import org.jetbrains.annotations.NotNull; @@ -49,6 +50,7 @@ public class PresentationModeProgressPanel { myText2.setIcon(JBUI.scale(EmptyIcon.create(1, 16))); myEastButtons = myProgress.createEastButtons(); myButtonPanel.add(InlineProgressIndicator.createButtonPanel(myEastButtons.map(b -> b.button))); + myRootPanel.setPreferredSize(new JBDimension(250, 60)); } @NotNull