Browse Source

Fixed the issue where the rounded corners on animated taskPane would show up too early.

Added exception to unfinished IntelliJ theme.
pull/15/head
weisj 5 years ago
parent
commit
0002162b36
  1. 5
      src/main/java/com/weis/darklaf/theme/IntelliJTheme.java
  2. 18
      src/main/java/com/weis/darklaf/ui/taskpane/DarkTaskPaneUI.java
  3. 3
      src/test/java/UIManagerDefaults.java

5
src/main/java/com/weis/darklaf/theme/IntelliJTheme.java

@ -5,6 +5,11 @@ package com.weis.darklaf.theme;
*/ */
public class IntelliJTheme extends Theme { public class IntelliJTheme extends Theme {
@Override
public void beforeInstall() {
throw new UnsupportedOperationException("IntelliJ Theme currently not supported");
}
@Override @Override
public String getName() { public String getName() {
return "IntelliJ"; return "IntelliJ";

18
src/main/java/com/weis/darklaf/ui/taskpane/DarkTaskPaneUI.java

@ -26,6 +26,7 @@ package com.weis.darklaf.ui.taskpane;
import com.weis.darklaf.defaults.DarkColors; import com.weis.darklaf.defaults.DarkColors;
import com.weis.darklaf.defaults.DarkDefaults; import com.weis.darklaf.defaults.DarkDefaults;
import com.weis.darklaf.util.DarkUIUtil; import com.weis.darklaf.util.DarkUIUtil;
import org.jdesktop.swingx.JXCollapsiblePane;
import org.jdesktop.swingx.JXHyperlink; import org.jdesktop.swingx.JXHyperlink;
import org.jdesktop.swingx.JXTaskPane; import org.jdesktop.swingx.JXTaskPane;
import org.jdesktop.swingx.plaf.metal.MetalTaskPaneUI; import org.jdesktop.swingx.plaf.metal.MetalTaskPaneUI;
@ -47,9 +48,13 @@ public class DarkTaskPaneUI extends MetalTaskPaneUI {
return new DarkTaskPaneUI(); return new DarkTaskPaneUI();
} }
protected boolean isCollapsed;
@Override @Override
protected void installDefaults() { protected void installListeners() {
super.installDefaults(); super.installListeners();
group.addPropertyChangeListener(JXCollapsiblePane.ANIMATION_STATE_KEY, e -> {
isCollapsed = "collapsed".equals(e.getNewValue());
});
} }
@Override @Override
@ -116,6 +121,11 @@ public class DarkTaskPaneUI extends MetalTaskPaneUI {
} }
} }
protected boolean isCollapsed() {
if (!group.isAnimated()) return group.isCollapsed();
return isCollapsed;
}
protected class DarkPaneBorder extends PaneBorder { protected class DarkPaneBorder extends PaneBorder {
public DarkPaneBorder() { public DarkPaneBorder() {
@ -132,7 +142,7 @@ public class DarkTaskPaneUI extends MetalTaskPaneUI {
} else { } else {
g.setColor(titleBackgroundGradientStart); g.setColor(titleBackgroundGradientStart);
} }
if (group.isCollapsed()) { if (isCollapsed()) {
DarkUIUtil.paintRoundRect(g, 0.5f, 0.5f, w - 1, h - 1, getRoundHeight()); DarkUIUtil.paintRoundRect(g, 0.5f, 0.5f, w - 1, h - 1, getRoundHeight());
g.setColor(borderColor); g.setColor(borderColor);
DarkUIUtil.paintLineBorder(g, 0, 0, w, h, getRoundHeight(), false); DarkUIUtil.paintLineBorder(g, 0, 0, w, h, getRoundHeight(), false);
@ -171,7 +181,5 @@ public class DarkTaskPaneUI extends MetalTaskPaneUI {
protected boolean isMouseOverBorder() { protected boolean isMouseOverBorder() {
return true; return true;
} }
} }
} }

3
src/test/java/UIManagerDefaults.java

@ -5,7 +5,6 @@
import com.weis.darklaf.DarkLafInfo; import com.weis.darklaf.DarkLafInfo;
import com.weis.darklaf.LafManager; import com.weis.darklaf.LafManager;
import com.weis.darklaf.components.OverlayScrollPane;
import com.weis.darklaf.ui.cell.DarkCellRendererToggleButton; import com.weis.darklaf.ui.cell.DarkCellRendererToggleButton;
import com.weis.darklaf.ui.table.DarkColorTableCellRendererEditor; import com.weis.darklaf.ui.table.DarkColorTableCellRendererEditor;
import org.jdesktop.swingx.JXTaskPane; import org.jdesktop.swingx.JXTaskPane;
@ -216,7 +215,7 @@ public class UIManagerDefaults implements ItemListener {
d.height = 350; d.height = 350;
table.setPreferredScrollableViewportSize(d); table.setPreferredScrollableViewportSize(d);
return new OverlayScrollPane(table); return new JScrollPane(table);
} }
/* /*

Loading…
Cancel
Save