a better fix progress presentation mode for HiDPI Linux

scale progress bar prefered size properly, there's no need to fill the
whole row with it

avoid progress bar twitching
This commit is contained in:
Sergey Ignatov
2018-01-26 00:27:30 +03:00
parent 530954b9c4
commit cff075651e
2 changed files with 28 additions and 33 deletions
@@ -10,32 +10,15 @@
</properties>
<border type="none"/>
<children>
<component id="21ac6" class="javax.swing.JLabel" binding="myText">
<constraints>
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<autoscrolls value="true"/>
<text value=""/>
</properties>
</component>
<component id="94f42" class="javax.swing.JProgressBar" binding="myProgressBar" default-binding="true">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="7" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<indeterminate value="true"/>
<opaque value="false"/>
</properties>
</component>
<component id="34af0" class="javax.swing.JLabel" binding="myText2">
<constraints>
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
<vspacer id="8e674">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
@@ -51,6 +34,31 @@
<border type="none"/>
<children/>
</grid>
<component id="21ac6" class="javax.swing.JLabel" binding="myText">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
<minimum-size width="209" height="-1"/>
<preferred-size width="209" height="-1"/>
<maximum-size width="209" height="-1"/>
</grid>
</constraints>
<properties>
<autoscrolls value="true"/>
<text value=""/>
</properties>
</component>
<component id="34af0" class="javax.swing.JLabel" binding="myText2">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false">
<minimum-size width="209" height="-1"/>
<preferred-size width="209" height="-1"/>
<maximum-size width="209" height="-1"/>
</grid>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
</children>
</grid>
</form>
@@ -1,18 +1,4 @@
/*
* 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.wm.impl.status;
import com.intellij.ide.ui.UISettings;
@@ -51,6 +37,7 @@ public class PresentationModeProgressPanel {
myEastButtons = myProgress.createEastButtons();
myButtonPanel.add(InlineProgressIndicator.createButtonPanel(myEastButtons.map(b -> b.button)));
myRootPanel.setPreferredSize(new JBDimension(250, 60));
myProgressBar.setPreferredSize(new Dimension(JBUI.scale(250), myProgressBar.getPreferredSize().height));
}
@NotNull