mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
CWM-3785 No TODO, Favorites tool windows on thin client
support layered pane be-controlization (for 'Loading' progress display) GitOrigin-RevId: 4662c429342cb553cd19966f2b3991cc6f101929
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0e5a1b726d
commit
0e9ab70838
@@ -255,6 +255,10 @@ class LoadingLayerAnimator(
|
||||
}
|
||||
|
||||
private class LoadingDecoratorLayeredPane(private val content: JComponent?) : JBLayeredPane(), LoadingDecorator.CursorAware {
|
||||
init {
|
||||
isFullOverlayLayout = true
|
||||
}
|
||||
|
||||
override fun getMinimumSize(): Dimension {
|
||||
return if (content != null && !isMinimumSizeSet) content.minimumSize else super.getMinimumSize()
|
||||
}
|
||||
@@ -262,17 +266,4 @@ private class LoadingDecoratorLayeredPane(private val content: JComponent?) : JB
|
||||
override fun getPreferredSize(): Dimension {
|
||||
return if (content != null && !isPreferredSizeSet) content.preferredSize else super.getPreferredSize()
|
||||
}
|
||||
|
||||
override fun doLayout() {
|
||||
super.doLayout()
|
||||
for (i in 0 until componentCount) {
|
||||
val each = getComponent(i)
|
||||
if (each is Icon) {
|
||||
each.setBounds(0, 0, each.width, each.height)
|
||||
}
|
||||
else {
|
||||
each.setBounds(0, 0, width, height)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class JBLayeredPane extends JLayeredPane {
|
||||
private boolean myFullOverlayLayout;
|
||||
|
||||
@Override
|
||||
public Component add(Component comp, int index) {
|
||||
Logger.getInstance(JBLayeredPane.class)
|
||||
@@ -21,4 +23,32 @@ public class JBLayeredPane extends JLayeredPane {
|
||||
return new Dimension(0, 0);
|
||||
return super.getMinimumSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see #setFullOverlayLayout(boolean)
|
||||
*/
|
||||
public boolean isFullOverlayLayout() {
|
||||
return myFullOverlayLayout;
|
||||
}
|
||||
|
||||
/**
|
||||
* When enabled, all pane's layers are resized to match pane's size at layout.
|
||||
* This will override the effect from setting any layout manager.
|
||||
*/
|
||||
public void setFullOverlayLayout(boolean enabled) {
|
||||
myFullOverlayLayout = enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doLayout() {
|
||||
if (isFullOverlayLayout()) {
|
||||
int width = getWidth();
|
||||
int height = getHeight();
|
||||
for (int i = getComponentCount() - 1; i >= 0; i--) {
|
||||
getComponent(i).setBounds(0, 0, width, height);
|
||||
}
|
||||
} else {
|
||||
super.doLayout();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ public class CaptionPanel extends JBLayeredPane implements DataProvider {
|
||||
setBorder(IdeBorderFactory.createBorder(horizontal ? SideBorder.BOTTOM : SideBorder.RIGHT));
|
||||
}
|
||||
|
||||
setFullOverlayLayout(true);
|
||||
setFocusable(true);
|
||||
|
||||
myHorizontal = horizontal;
|
||||
@@ -162,14 +163,6 @@ public class CaptionPanel extends JBLayeredPane implements DataProvider {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doLayout() {
|
||||
for (int i = getComponentCount() - 1; i >= 0; i--) {
|
||||
Component component = getComponent(i);
|
||||
component.setBounds(0, 0, getWidth(), getHeight());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
return new Dimension(SIZE, SIZE);
|
||||
|
||||
+3
-7
@@ -39,8 +39,8 @@ import com.intellij.ui.HyperlinkLabel;
|
||||
import com.intellij.ui.IdeBorderFactory;
|
||||
import com.intellij.ui.JBColor;
|
||||
import com.intellij.ui.ScrollPaneFactory;
|
||||
import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.ui.components.JBLayeredPane;
|
||||
import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.util.ArrayUtilRt;
|
||||
import com.intellij.util.ThrowableRunnable;
|
||||
import com.intellij.util.containers.FixedHashMap;
|
||||
@@ -1021,12 +1021,8 @@ public abstract class DesignerEditorPanel extends JPanel
|
||||
}
|
||||
|
||||
private final class MyLayeredPane extends JBLayeredPane implements Scrollable {
|
||||
@Override
|
||||
public void doLayout() {
|
||||
for (int i = getComponentCount() - 1; i >= 0; i--) {
|
||||
Component component = getComponent(i);
|
||||
component.setBounds(0, 0, getWidth(), getHeight());
|
||||
}
|
||||
private MyLayeredPane() {
|
||||
setFullOverlayLayout(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1020,15 +1020,8 @@ public final class GuiEditor extends JPanel implements DesignerEditorPanelFacade
|
||||
}
|
||||
|
||||
private final class MyLayeredPane extends JBLayeredPane implements Scrollable {
|
||||
/**
|
||||
* All components allocate whole pane's area.
|
||||
*/
|
||||
@Override
|
||||
public void doLayout() {
|
||||
for (int i = getComponentCount() - 1; i >= 0; i--) {
|
||||
final Component component = getComponent(i);
|
||||
component.setBounds(0, 0, getWidth(), getHeight());
|
||||
}
|
||||
private MyLayeredPane() {
|
||||
setFullOverlayLayout(true); // All components allocate whole pane's area.
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user