Browse Source

Added option to disable tabs in JTabFrame.

Fixed painting issues in NumberingPane.
Fixed tableheader foreground not being respected.
Added inactive focus glow color (for now this only applies to text fields as they are the only component with a focus border that have #setEditable).
Added light high contrast theme.
pull/127/head
weisj 5 years ago
parent
commit
e4a726f61d
  1. 18
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/JTabFrame.java
  2. 16
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTab.java
  3. 8
      core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTabLabel.java
  4. 6
      core/src/main/java/com/github/weisj/darklaf/components/text/LineHighlighter.java
  5. 77
      core/src/main/java/com/github/weisj/darklaf/theme/HighContrastLightTheme.java
  6. 21
      core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java
  7. 19
      core/src/main/java/com/github/weisj/darklaf/ui/numberingpane/DarkNumberingPaneUI.java
  8. 18
      core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/DarkHandler.java
  9. 14
      core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/DarkTabbedPaneUI.java
  10. 20
      core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabFrameTabLabelUI.java
  11. 1
      core/src/main/java/com/github/weisj/darklaf/ui/tabframe/TabDragListener.java
  12. 9
      core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableHeaderUI.java
  13. 4
      core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableUI.java
  14. 21
      core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextBorder.java
  15. 51
      core/src/main/java/com/github/weisj/darklaf/util/DarkUIUtil.java
  16. 2
      core/src/main/resources/com/github/weisj/darklaf/properties/icons/presets/light_icons.properties
  17. 3
      core/src/main/resources/com/github/weisj/darklaf/properties/ui/tabFrame.properties
  18. 1
      core/src/main/resources/com/github/weisj/darklaf/properties/ui/text.properties
  19. 2
      core/src/main/resources/com/github/weisj/darklaf/theme/darcula/darcula_defaults.properties
  20. 6
      core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_dark/high_contrast_dark_defaults.properties
  21. 8
      core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_dark/high_contrast_dark_styleSheet.css
  22. 1
      core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_dark/high_contrast_dark_ui.properties
  23. 157
      core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_light/high_contrast_light_defaults.properties
  24. 47
      core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_light/high_contrast_light_icons.properties
  25. 34
      core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_light/high_contrast_light_platform.properties
  26. 337
      core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_light/high_contrast_light_styleSheet.css
  27. 32
      core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_light/high_contrast_light_ui.properties
  28. 3
      core/src/main/resources/com/github/weisj/darklaf/theme/intellij/intellij_defaults.properties
  29. 2
      core/src/main/resources/com/github/weisj/darklaf/theme/solarized_dark/solarized_dark_defaults.properties
  30. 2
      core/src/main/resources/com/github/weisj/darklaf/theme/solarized_light/solarized_light_defaults.properties

18
core/src/main/java/com/github/weisj/darklaf/components/tabframe/JTabFrame.java

@ -465,6 +465,7 @@ public class JTabFrame extends JComponent {
* @param a the alignment position.{@link TabFramePosition#getAlignment()} * @param a the alignment position.{@link TabFramePosition#getAlignment()}
* @param index the index.{@link TabFramePosition#getIndex()} * @param index the index.{@link TabFramePosition#getIndex()}
* @return the tab component. * @return the tab component.
* @throws IndexOutOfBoundsException if the alignment or index is out of bounds, or the tab doesn't exist.
*/ */
public TabFrameTab getTabComponentAt(final Alignment a, final int index) { public TabFrameTab getTabComponentAt(final Alignment a, final int index) {
List<TabFrameTab> tabs = tabsForAlignment(a); List<TabFrameTab> tabs = tabsForAlignment(a);
@ -488,6 +489,7 @@ public class JTabFrame extends JComponent {
* @param a the alignment position.{@link TabFramePosition#getAlignment()} * @param a the alignment position.{@link TabFramePosition#getAlignment()}
* @param index the index. {@link TabFramePosition#getIndex()} ()} * @param index the index. {@link TabFramePosition#getIndex()} ()}
* @return the popup component specified by {@link TabFramePopup#getContentPane()}. * @return the popup component specified by {@link TabFramePopup#getContentPane()}.
* @throws IndexOutOfBoundsException if the alignment or index is out of bounds, or the tab doesn't exist.
*/ */
public Component getComponentAt(final Alignment a, final int index) { public Component getComponentAt(final Alignment a, final int index) {
List<TabFramePopup> tabs = compsForAlignment(a); List<TabFramePopup> tabs = compsForAlignment(a);
@ -529,6 +531,7 @@ public class JTabFrame extends JComponent {
* *
* @param a the alignment position of the popup.{@link TabFramePosition#getAlignment()} * @param a the alignment position of the popup.{@link TabFramePosition#getAlignment()}
* @param index the index of the tab.{@link TabFramePosition#getIndex()} * @param index the index of the tab.{@link TabFramePosition#getIndex()}
* @throws IndexOutOfBoundsException if the alignment or index is out of bounds, or the tab doesn't exist.
*/ */
public void closeTab(final Alignment a, final int index) { public void closeTab(final Alignment a, final int index) {
toggleTab(a, index, false); toggleTab(a, index, false);
@ -540,11 +543,13 @@ public class JTabFrame extends JComponent {
* @param a the alignment position.{@link TabFramePosition#getAlignment()} * @param a the alignment position.{@link TabFramePosition#getAlignment()}
* @param index the index.{@link TabFramePosition#getIndex()} * @param index the index.{@link TabFramePosition#getIndex()}
* @param enabled true if visible. * @param enabled true if visible.
* @throws IndexOutOfBoundsException if the alignment or index is out of bounds, or the tab doesn't exist.
*/ */
public void toggleTab(final Alignment a, final int index, final boolean enabled) { public void toggleTab(final Alignment a, final int index, final boolean enabled) {
int oldIndex = selectedIndices[a.getIndex()]; int oldIndex = selectedIndices[a.getIndex()];
if (content.isEnabled(a) == enabled && oldIndex == index) return; if (content.isEnabled(a) == enabled && oldIndex == index) return;
TabFrameTab compAtIndex = getTabComponentAt(a, index); TabFrameTab compAtIndex = getTabComponentAt(a, index);
if (!compAtIndex.isEnabled()) return;
compAtIndex.setSelected(enabled); compAtIndex.setSelected(enabled);
notifySelectionChange(compAtIndex); notifySelectionChange(compAtIndex);
setPopupVisibility(compAtIndex, enabled); setPopupVisibility(compAtIndex, enabled);
@ -556,6 +561,19 @@ public class JTabFrame extends JComponent {
new TabFramePosition(a, index)); new TabFramePosition(a, index));
} }
/**
* Enable or disable a tab. A disabled tab cannot be opened. Enabling a tab does not open it. Disabling a tab closes
* it. After the tab has been disabled enabling it won't restore the open state,
*
* @param a the alignment position.{@link TabFramePosition#getAlignment()}
* @param index the index.{@link TabFramePosition#getIndex()}
* @param enabled true if enabled.
* @throws IndexOutOfBoundsException if the alignment or index is out of bounds, or the tab doesn't exist.
*/
public void setTabEnabled(final Alignment a, final int index, final boolean enabled) {
getTabComponentAt(a, index).setEnabled(enabled);
}
/** /**
* Notify the tabFrame that a selection has changed. * Notify the tabFrame that a selection has changed.
* *

16
core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTab.java

@ -80,10 +80,24 @@ public interface TabFrameTab {
/** /**
* Set the selected status of the tab. * Set the selected status of the tab.
* *
* @param selected true if selected * @param selected true if selected.
*/ */
void setSelected(boolean selected); void setSelected(boolean selected);
/**
* Returns whether the tab is enabled.
*
* @return true if enabled.
*/
boolean isEnabled();
/**
* Sets the enabled status of the tab.
*
* @param enabled true if enabled.
*/
void setEnabled(final boolean enabled);
/** /**
* Get the accelerator. * Get the accelerator.
* *

8
core/src/main/java/com/github/weisj/darklaf/components/tabframe/TabFrameTabLabel.java

@ -65,6 +65,14 @@ public class TabFrameTabLabel extends JLabel implements TabFrameTab {
setText(title); setText(title);
} }
@Override
public void setEnabled(final boolean enabled) {
if (enabled != isEnabled() && !enabled) {
getTabFrame().toggleTab(getOrientation(), getIndex(), false);
}
super.setEnabled(enabled);
}
@Override @Override
public String getUIClassID() { public String getUIClassID() {
return "TabFrameTabLabelUI"; return "TabFrameTabLabelUI";

6
core/src/main/java/com/github/weisj/darklaf/components/text/LineHighlighter.java

@ -98,7 +98,11 @@ public class LineHighlighter implements Highlighter.HighlightPainter, ChangeList
// Remove the highlighting from the previously highlighted line // Remove the highlighting from the previously highlighted line
if (lastView != null && lastView.y != currentView.y) { if (lastView != null && lastView.y != currentView.y) {
component.repaint(0, lastView.y, component.getWidth(), lastView.height); if (lastView.isEmpty()) {
component.repaint();
} else {
component.repaint(0, lastView.y, component.getWidth(), lastView.height);
}
lastView = currentView; lastView = currentView;
} }
} catch (BadLocationException ignored) { } catch (BadLocationException ignored) {

77
core/src/main/java/com/github/weisj/darklaf/theme/HighContrastLightTheme.java

@ -0,0 +1,77 @@
/*
* MIT License
*
* Copyright (c) 2020 Jannis Weis
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.github.weisj.darklaf.theme;
import javax.swing.*;
import java.util.Properties;
public class HighContrastLightTheme extends Theme {
@Override
protected IconTheme getPresetIconTheme() {
return IconTheme.LIGHT;
}
@Override
public String getPrefix() {
return "high_contrast_light";
}
@Override
protected String getResourcePath() {
return "high_contrast_light/";
}
@Override
public String getName() {
return "High Contrast Light";
}
@Override
protected Class<? extends Theme> getLoaderClass() {
return HighContrastLightTheme.class;
}
@Override
public boolean isDark() {
return false;
}
@Override
public boolean isHighContrast() {
return true;
}
@Override
public void loadUIProperties(final Properties properties, final UIDefaults currentDefaults) {
super.loadUIProperties(properties, currentDefaults);
loadCustomProperties("ui", properties, currentDefaults);
}
@Override
public void loadPlatformProperties(final Properties properties, final UIDefaults currentDefaults) {
super.loadPlatformProperties(properties, currentDefaults);
loadCustomProperties("platform", properties, currentDefaults);
}
}

21
core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java

@ -238,25 +238,26 @@ public class DarkButtonUI extends BasicButtonUI implements ButtonConstants {
int size = Math.min(width - margin.left - margin.right, int size = Math.min(width - margin.left - margin.right,
height - margin.left - margin.right); height - margin.left - margin.right);
if (!drawOutline) { if (!drawOutline) {
g.fillRoundRect((width - size) / 2, (height - size) / 2, size, size, arc, arc); g.fillRoundRect((width - size) / 2 + 2, (height - size) / 2 + 2,
size - 4, size - 4, arc, arc);
} else { } else {
g.setColor(getBorderlessOutline(b)); g.setColor(getBorderlessOutline(b));
DarkUIUtil.paintLineBorder((Graphics2D) g, (width - size) / 2.0f + 1, g.drawRoundRect((width - size) / 2 + 2, (height - size) / 2 + 2,
(height - size) / 2.0f + 1, size - 2, size - 2, arc); size - 4, size - 4, arc, arc);
} }
} else { } else {
if (!drawOutline) { if (!drawOutline) {
g.fillRoundRect(margin.left, margin.top, g.fillRoundRect(margin.left + 2, margin.top + 2,
width - margin.left - margin.right, width - margin.left - margin.right - 4,
height - margin.top - margin.bottom, height - margin.top - margin.bottom - 4,
arc, arc); arc, arc);
} else { } else {
g.setColor(getBorderlessOutline(b)); g.setColor(getBorderlessOutline(b));
DarkUIUtil.paintLineBorder((Graphics2D) g, margin.left + 1, margin.top + 1, g.drawRoundRect(margin.left + 2, margin.top + 2,
width - margin.left - margin.right - 2, width - margin.left - margin.right - 4,
height - margin.top - margin.bottom - 2, arc); height - margin.top - margin.bottom - 4,
arc, arc);
} }
} }
} }
} }

19
core/src/main/java/com/github/weisj/darklaf/ui/numberingpane/DarkNumberingPaneUI.java

@ -96,24 +96,15 @@ public class DarkNumberingPaneUI extends ComponentUI {
} }
protected MouseListener getMouseListener() { protected MouseListener getMouseListener() {
if (handler == null) { return getHandler();
handler = new Handler();
}
return handler;
} }
protected MouseMotionListener getMouseMotionListener() { protected MouseMotionListener getMouseMotionListener() {
if (handler == null) { return getHandler();
handler = new Handler();
}
return handler;
} }
protected PropertyChangeListener getPropertyChangeListener() { protected PropertyChangeListener getPropertyChangeListener() {
if (handler == null) { return getHandler();
handler = new Handler();
}
return handler;
} }
@Override @Override
@ -137,6 +128,10 @@ public class DarkNumberingPaneUI extends ComponentUI {
} }
protected ChangeListener getChangeListener() { protected ChangeListener getChangeListener() {
return getHandler();
}
protected Handler getHandler() {
if (handler == null) { if (handler == null) {
handler = new Handler(); handler = new Handler();
} }

18
core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/DarkHandler.java

@ -27,10 +27,8 @@ import com.github.weisj.darklaf.util.PropertyKey;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.plaf.UIResource;
import java.awt.*; import java.awt.*;
import java.awt.dnd.DropTarget; import java.awt.dnd.DropTarget;
import java.awt.event.ContainerEvent;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeEvent;
@ -232,22 +230,6 @@ public class DarkHandler extends TabbedPaneHandler {
} }
} }
@Override
public void componentAdded(final ContainerEvent e) {
if (!(e.getChild() instanceof UIResource)) {
e.getChild().addFocusListener(ui.focusListener);
}
super.componentAdded(e);
}
@Override
public void componentRemoved(final ContainerEvent e) {
if (!(e.getChild() instanceof UIResource)) {
e.getChild().removeFocusListener(ui.focusListener);
}
super.componentRemoved(e);
}
protected Point getDragMousePos() { protected Point getDragMousePos() {
Point p = new Point(ui.dragRect.x + ui.dragRect.width / 2, ui.dragRect.y + ui.dragRect.height / 2); Point p = new Point(ui.dragRect.x + ui.dragRect.width / 2, ui.dragRect.y + ui.dragRect.height / 2);
if (ui.scrollableTabLayoutEnabled()) { if (ui.scrollableTabLayoutEnabled()) {

14
core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/DarkTabbedPaneUI.java

@ -35,7 +35,6 @@ import java.awt.*;
import java.awt.dnd.DropTarget; import java.awt.dnd.DropTarget;
import java.awt.event.AWTEventListener; import java.awt.event.AWTEventListener;
import java.awt.event.FocusEvent; import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.TooManyListenersException; import java.util.TooManyListenersException;
import java.util.function.Consumer; import java.util.function.Consumer;
@ -69,20 +68,9 @@ public class DarkTabbedPaneUI extends DarkTabbedPaneUIBridge {
public static final String KEY_ROTATE_TAB_RUNS = KEY_PREFIX + "rotateTabRuns"; public static final String KEY_ROTATE_TAB_RUNS = KEY_PREFIX + "rotateTabRuns";
protected static final TabbedPaneTransferHandler TRANSFER_HANDLER = new TabbedPaneTransferHandler.UIResource(); protected static final TabbedPaneTransferHandler TRANSFER_HANDLER = new TabbedPaneTransferHandler.UIResource();
protected final FocusListener focusListener = new FocusListener() {
@Override
public void focusGained(final FocusEvent e) {
repaintTab(tabPane.getSelectedIndex());
}
@Override
public void focusLost(final FocusEvent e) {
repaintTab(tabPane.getSelectedIndex());
}
};
protected final AWTEventListener awtEventListener = e -> { protected final AWTEventListener awtEventListener = e -> {
if (e.getID() == FocusEvent.FOCUS_GAINED) { if (e.getID() == FocusEvent.FOCUS_GAINED) {
tabPane.repaint(); repaintTab(tabPane.getSelectedIndex());
} }
}; };
protected final Rectangle tabAreaBounds = new Rectangle(0, 0, 0, 0); protected final Rectangle tabAreaBounds = new Rectangle(0, 0, 0, 0);

20
core/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkTabFrameTabLabelUI.java

@ -54,6 +54,7 @@ public class DarkTabFrameTabLabelUI extends DarkLabelUI implements PropertyChang
private final MouseListener mouseListener = new MouseAdapter() { private final MouseListener mouseListener = new MouseAdapter() {
@Override @Override
public void mouseClicked(final MouseEvent e) { public void mouseClicked(final MouseEvent e) {
if (!tabComponent.isEnabled()) return;
if (SwingUtilities.isLeftMouseButton(e)) { if (SwingUtilities.isLeftMouseButton(e)) {
tabComponent.getTabFrame().toggleTab(tabComponent.getOrientation(), tabComponent.getIndex(), tabComponent.getTabFrame().toggleTab(tabComponent.getOrientation(), tabComponent.getIndex(),
!tabComponent.isSelected()); !tabComponent.isSelected());
@ -64,6 +65,7 @@ public class DarkTabFrameTabLabelUI extends DarkLabelUI implements PropertyChang
private HoverListener hoverListener; private HoverListener hoverListener;
private Color defaultFontColor; private Color defaultFontColor;
private Color selectedFontColor; private Color selectedFontColor;
private Color fontHoverColor;
private Color selectedColor; private Color selectedColor;
private Color hoverColor; private Color hoverColor;
private final RotatableIcon rotatableIcon = new RotatableIcon(); private final RotatableIcon rotatableIcon = new RotatableIcon();
@ -111,6 +113,14 @@ public class DarkTabFrameTabLabelUI extends DarkLabelUI implements PropertyChang
} }
} }
@Override
protected void paintEnabledText(final JLabel l, final Graphics g, final String s,
final int textX, final int textY) {
int mnemIndex = l.getDisplayedMnemonicIndex();
g.setColor(getForeground(tabComponent));
SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemIndex, textX, textY);
}
@Override @Override
public void installUI(final JComponent c) { public void installUI(final JComponent c) {
tabComponent = (TabFrameTabLabel) c; tabComponent = (TabFrameTabLabel) c;
@ -137,6 +147,7 @@ public class DarkTabFrameTabLabelUI extends DarkLabelUI implements PropertyChang
selectedColor = UIManager.getColor("TabFrameTab.selectedBackground"); selectedColor = UIManager.getColor("TabFrameTab.selectedBackground");
hoverColor = UIManager.getColor("TabFrameTab.hoverBackground"); hoverColor = UIManager.getColor("TabFrameTab.hoverBackground");
selectedFontColor = UIManager.getColor("TabFrameTab.selectedForeground"); selectedFontColor = UIManager.getColor("TabFrameTab.selectedForeground");
fontHoverColor = UIManager.getColor("TabFrameTab.hoverForeground");
LookAndFeel.installBorder(c, "TabFrameTab.border"); LookAndFeel.installBorder(c, "TabFrameTab.border");
tabComponent.setComponentPopupMenu(new DarkTabFrameComponentPopupMenu(tabComponent)); tabComponent.setComponentPopupMenu(new DarkTabFrameComponentPopupMenu(tabComponent));
} }
@ -244,12 +255,19 @@ public class DarkTabFrameTabLabelUI extends DarkLabelUI implements PropertyChang
} }
public Color getBackground(final TabFrameTabLabel tab) { public Color getBackground(final TabFrameTabLabel tab) {
if (printing) return tab.getBackground(); if (printing || !tab.isEnabled()) return tab.getBackground();
return tab.isSelected() return tab.isSelected()
? selectedColor : hoverListener.isHover() && !tab.getTabFrame().isInTransfer() ? selectedColor : hoverListener.isHover() && !tab.getTabFrame().isInTransfer()
? hoverColor : tab.getBackground(); ? hoverColor : tab.getBackground();
} }
public Color getForeground(final TabFrameTabLabel tab) {
if (printing) return tab.getForeground();
return tab.isSelected()
? selectedFontColor : hoverListener.isHover() && !tab.getTabFrame().isInTransfer()
? fontHoverColor : tab.getForeground();
}
protected Icon getIcon() { protected Icon getIcon() {
Icon icon = (tabComponent.isEnabled()) ? tabComponent.getIcon() : tabComponent.getDisabledIcon(); Icon icon = (tabComponent.isEnabled()) ? tabComponent.getIcon() : tabComponent.getDisabledIcon();
rotatableIcon.setIcon(icon); rotatableIcon.setIcon(icon);

1
core/src/main/java/com/github/weisj/darklaf/ui/tabframe/TabDragListener.java

@ -55,6 +55,7 @@ public class TabDragListener extends MouseAdapter {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public void mouseDragged(final MouseEvent e) { public void mouseDragged(final MouseEvent e) {
if (!tabComponent.isEnabled()) return;
if (origin == null) origin = e.getPoint(); if (origin == null) origin = e.getPoint();
if (distance(origin, e.getPoint()) < 100) return; if (distance(origin, e.getPoint()) < 100) return;
TransferHandler th = tabComponent.getTabFrame().getTransferHandler(); TransferHandler th = tabComponent.getTabFrame().getTransferHandler();

9
core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableHeaderUI.java

@ -40,6 +40,7 @@ import java.awt.*;
*/ */
public class DarkTableHeaderUI extends DarkTableHeaderUIBridge { public class DarkTableHeaderUI extends DarkTableHeaderUIBridge {
public static final String KEY_IS_HEADER_RENDERER = "JComponent.isHeaderRenderer";
private static final int HEADER_HEIGHT = 26; private static final int HEADER_HEIGHT = 26;
protected Color borderColor; protected Color borderColor;
protected Color background; protected Color background;
@ -238,6 +239,14 @@ public class DarkTableHeaderUI extends DarkTableHeaderUIBridge {
config.restore(); config.restore();
} }
@Override
protected void paintCell(final Graphics g, final Rectangle cellRect, final int columnIndex) {
Component component = getHeaderRenderer(columnIndex);
if (component instanceof JComponent) ((JComponent) component).putClientProperty(KEY_IS_HEADER_RENDERER, true);
rendererPane.paintComponent(g, component, header, cellRect.x, cellRect.y,
cellRect.width, cellRect.height, true);
}
protected Color getHeaderBackground() { protected Color getHeaderBackground() {
return background; return background;
} }

4
core/src/main/java/com/github/weisj/darklaf/ui/table/DarkTableUI.java

@ -91,6 +91,10 @@ public class DarkTableUI extends DarkTableUIBridge implements FocusListener {
} else if (PropertyKey.COMPONENT_ORIENTATION.equals(key)) { } else if (PropertyKey.COMPONENT_ORIENTATION.equals(key)) {
table.doLayout(); table.doLayout();
table.repaint(); table.repaint();
} else if (KEY_ALTERNATE_ROW_COLOR.equals(key)
|| KEY_RENDER_BOOLEAN_AS_CHECKBOX.equals(key)
|| KEY_BOOLEAN_RENDER_TYPE.equals(key)) {
table.repaint();
} }
}; };
protected Color selectionBackground; protected Color selectionBackground;

21
core/src/main/java/com/github/weisj/darklaf/ui/text/DarkTextBorder.java

@ -34,7 +34,6 @@ import javax.swing.text.JTextComponent;
import java.awt.*; import java.awt.*;
/** /**
* @author Konstantin Bulenkov
* @author Jannis Weis * @author Jannis Weis
*/ */
public class DarkTextBorder implements Border, UIResource { public class DarkTextBorder implements Border, UIResource {
@ -44,6 +43,7 @@ public class DarkTextBorder implements Border, UIResource {
protected final Color focusBorderColor; protected final Color focusBorderColor;
protected final Color borderColor; protected final Color borderColor;
protected final Color inactiveBorderColor; protected final Color inactiveBorderColor;
protected final Color inactiveFocusBorderColor;
protected final int borderSize; protected final int borderSize;
protected final int arc; protected final int arc;
@ -59,6 +59,7 @@ public class DarkTextBorder implements Border, UIResource {
errorBorderColor = UIManager.getColor("TextField.border.error"); errorBorderColor = UIManager.getColor("TextField.border.error");
borderColor = UIManager.getColor("TextField.border.enabled"); borderColor = UIManager.getColor("TextField.border.enabled");
inactiveBorderColor = UIManager.getColor("TextField.border.disabled"); inactiveBorderColor = UIManager.getColor("TextField.border.disabled");
inactiveFocusBorderColor = UIManager.getColor("TextField.border.disabled.focus");
borderSize = UIManager.getInt("TextField.borderThickness"); borderSize = UIManager.getInt("TextField.borderThickness");
arc = UIManager.getInt("TextField.arc"); arc = UIManager.getInt("TextField.arc");
focusArc = UIManager.getInt("TextField.focusArc"); focusArc = UIManager.getInt("TextField.focusArc");
@ -88,6 +89,10 @@ public class DarkTextBorder implements Border, UIResource {
public void paintBorder(final Component c, final Graphics g2, final int x, final int y, public void paintBorder(final Component c, final Graphics g2, final int x, final int y,
final int width, final int height) { final int width, final int height) {
boolean editable = !(c instanceof JTextComponent) || ((JTextComponent) c).isEditable();
boolean focus = DarkUIUtil.hasFocus(c);
boolean error = hasError(c);
Graphics2D g = (Graphics2D) g2; Graphics2D g = (Graphics2D) g2;
g.translate(x, y); g.translate(x, y);
GraphicsContext config = GraphicsUtil.setupStrokePainting(g); GraphicsContext config = GraphicsUtil.setupStrokePainting(g);
@ -97,26 +102,20 @@ public class DarkTextBorder implements Border, UIResource {
DarkUIUtil.paintOutlineBorder(g, width, height, focusArcSize, borderSize, DarkUIUtil.paintOutlineBorder(g, width, height, focusArcSize, borderSize,
c.hasFocus(), DarkUIUtil.Outline.error); c.hasFocus(), DarkUIUtil.Outline.error);
} else if (c.hasFocus()) { } else if (c.hasFocus()) {
DarkUIUtil.paintFocusBorder(g, width, height, focusArcSize, borderSize); DarkUIUtil.paintFocusBorder(g, width, height, focusArcSize, borderSize, editable);
} }
g.setColor(getBorderColor(c)); g.setColor(getBorderColor(focus, error, editable, c.isEnabled()));
DarkUIUtil.paintLineBorder(g, borderSize, borderSize, width - 2 * borderSize, DarkUIUtil.paintLineBorder(g, borderSize, borderSize, width - 2 * borderSize,
height - 2 * borderSize, arcSize); height - 2 * borderSize, arcSize);
g.translate(-x, -y); g.translate(-x, -y);
config.restore(); config.restore();
} }
protected Color getBorderColor(final Component c) {
boolean editable = !(c instanceof JTextComponent) || ((JTextComponent) c).isEditable();
boolean focus = DarkUIUtil.hasFocus(c);
boolean error = hasError(c);
return getBorderColor(focus, error, editable, c.isEnabled());
}
protected Color getBorderColor(final boolean focus, final boolean error, protected Color getBorderColor(final boolean focus, final boolean error,
final boolean editable, final boolean enabled) { final boolean editable, final boolean enabled) {
if (focus) { if (focus) {
return error ? focusErrorBorderColor : focusBorderColor; return error ? focusErrorBorderColor
: enabled && editable ? focusBorderColor : inactiveFocusBorderColor;
} else if (error) { } else if (error) {
return errorBorderColor; return errorBorderColor;
} else { } else {

51
core/src/main/java/com/github/weisj/darklaf/util/DarkUIUtil.java

@ -25,6 +25,7 @@ package com.github.weisj.darklaf.util;
import com.github.weisj.darklaf.decorators.CellRenderer; import com.github.weisj.darklaf.decorators.CellRenderer;
import com.github.weisj.darklaf.ui.popupmenu.DarkPopupMenuUI; import com.github.weisj.darklaf.ui.popupmenu.DarkPopupMenuUI;
import com.github.weisj.darklaf.ui.table.DarkTableHeaderUI;
import sun.awt.SunToolkit; import sun.awt.SunToolkit;
import javax.swing.*; import javax.swing.*;
@ -93,6 +94,10 @@ public final class DarkUIUtil {
return UIManager.getColor("glowFocus"); return UIManager.getColor("glowFocus");
} }
private static Color getFocusInactiveGlow() {
return UIManager.getColor("glowFocusInactive");
}
private static Color getWarningGlow() { private static Color getWarningGlow() {
return UIManager.getColor("glowWarning"); return UIManager.getColor("glowWarning");
} }
@ -118,30 +123,47 @@ public final class DarkUIUtil {
public static void paintFocusBorder(final Graphics2D g, final int width, final int height, final float arc, public static void paintFocusBorder(final Graphics2D g, final int width, final int height, final float arc,
final float bw) { final float bw) {
paintFocusBorder(g, width, height, arc, bw, true);
}
public static void paintFocusBorder(final Graphics2D g, final int width, final int height, final float arc,
final float bw, final boolean active) {
GraphicsContext config = new GraphicsContext(g); GraphicsContext config = new GraphicsContext(g);
g.setComposite(DarkUIUtil.glowComposite); g.setComposite(DarkUIUtil.glowComposite);
Outline.focus.setGraphicsColor(g, true); Outline.focus.setGraphicsColor(g, active);
doPaint(g, width, height, arc, bw); doPaint(g, width, height, arc, bw);
config.restore(); config.restore();
} }
public static void fillFocusRect(final Graphics2D g, final int x, final int y, final int width, final int height) { public static void fillFocusRect(final Graphics2D g, final int x, final int y,
final int width, final int height) {
fillFocusRect(g, x, y, width, height, true);
}
public static void fillFocusRect(final Graphics2D g, final int x, final int y,
final int width, final int height, final boolean active) {
GraphicsContext config = new GraphicsContext(g); GraphicsContext config = new GraphicsContext(g);
g.setComposite(DarkUIUtil.glowComposite); g.setComposite(DarkUIUtil.glowComposite);
Outline.focus.setGraphicsColor(g, true); Outline.focus.setGraphicsColor(g, active);
g.fillRect(x, y, width, height); g.fillRect(x, y, width, height);
config.restore(); config.restore();
} }
public static void paintFocusOval(final Graphics2D g, final int x, final int y, final int width, final int height) { public static void paintFocusOval(final Graphics2D g, final int x, final int y,
final int width, final int height) {
paintFocusOval(g, (float) x, (float) y, (float) width, (float) height); paintFocusOval(g, (float) x, (float) y, (float) width, (float) height);
} }
public static void paintFocusOval(final Graphics2D g, final float x, final float y, public static void paintFocusOval(final Graphics2D g, final float x, final float y,
final float width, final float height) { final float width, final float height) {
paintFocusOval(g, x, y, width, height, true);
}
public static void paintFocusOval(final Graphics2D g, final float x, final float y,
final float width, final float height, final boolean active) {
GraphicsContext config = new GraphicsContext(g); GraphicsContext config = new GraphicsContext(g);
g.setComposite(DarkUIUtil.glowComposite); g.setComposite(DarkUIUtil.glowComposite);
Outline.focus.setGraphicsColor(g, true); Outline.focus.setGraphicsColor(g, active);
float blw = 3.0f; float blw = 3.0f;
Path2D shape = new Path2D.Float(Path2D.WIND_EVEN_ODD); Path2D shape = new Path2D.Float(Path2D.WIND_EVEN_ODD);
@ -275,11 +297,14 @@ public final class DarkUIUtil {
} }
public static boolean isInCell(final Component c) { public static boolean isInCell(final Component c) {
boolean inCellRenderer = getParentOfType(CellRendererPane.class, c) != null boolean tableHeaderCell = c instanceof JComponent && Boolean.TRUE.equals(
|| getParentOfType(TableCellRenderer.class, c) != null ((JComponent) c).getClientProperty(DarkTableHeaderUI.KEY_IS_HEADER_RENDERER));
|| getParentOfType(TreeCellRenderer.class, c) != null boolean inCellRenderer = !tableHeaderCell
|| getParentOfType(CellRenderer.class, c) != null && (getParentOfType(CellRendererPane.class, c) != null
|| getParentOfType(CellEditor.class, c) != null; || getParentOfType(TableCellRenderer.class, c) != null
|| getParentOfType(TreeCellRenderer.class, c) != null
|| getParentOfType(CellRenderer.class, c) != null
|| getParentOfType(CellEditor.class, c) != null);
return inCellRenderer && getParentOfType(JComboBox.class, c) == null; return inCellRenderer && getParentOfType(JComboBox.class, c) == null;
} }
@ -469,9 +494,11 @@ public final class DarkUIUtil {
focus { focus {
@Override @Override
public void setGraphicsColor(final Graphics2D g, final boolean focused) { public void setGraphicsColor(final Graphics2D g, final boolean active) {
if (focused) { if (active) {
g.setColor(getFocusGlow()); g.setColor(getFocusGlow());
} else {
g.setColor(getFocusInactiveGlow());
} }
} }
}; };

2
core/src/main/resources/com/github/weisj/darklaf/properties/icons/presets/light_icons.properties

@ -43,5 +43,5 @@
%errorIconColor = DB5860 %errorIconColor = DB5860
%informationIconColor = 389FD6 %informationIconColor = 389FD6
%warningIconColor = 389FD6 %warningIconColor = e2a53a
%questionIconColor = EDA200 %questionIconColor = EDA200

3
core/src/main/resources/com/github/weisj/darklaf/properties/ui/tabFrame.properties

@ -29,7 +29,7 @@ TabFramePopup.headerBorder = com.github.weisj.darklaf.ui.t
TabFramePopup.headerBackground = %backgroundColorfulInactive TabFramePopup.headerBackground = %backgroundColorfulInactive
TabFramePopup.headerFocusBackground = %backgroundColorful TabFramePopup.headerFocusBackground = %backgroundColorful
TabFramePopup.headerHoverBackground = %backgroundHover TabFramePopup.headerHoverBackground = %backgroundHover
TabFramePopup.headerSelectedBackground = %backgroundColorful TabFramePopup.headerSelectedBackground = %backgroundColorfulInactive
TabFramePopup.headerSelectedHoverBackground = %backgroundHover TabFramePopup.headerSelectedHoverBackground = %backgroundHover
TabFramePopup.headerFocusHoverBackground = %backgroundHoverColorful TabFramePopup.headerFocusHoverBackground = %backgroundHoverColorful
TabFramePopup.headerFocusSelectedBackground = %backgroundColorful TabFramePopup.headerFocusSelectedBackground = %backgroundColorful
@ -52,6 +52,7 @@ TabFrameTabLabelUI = com.github.weisj.darklaf.ui.t
TabFrameTabContainerUI = com.github.weisj.darklaf.ui.tabframe.DarkTabFrameTabContainerUI TabFrameTabContainerUI = com.github.weisj.darklaf.ui.tabframe.DarkTabFrameTabContainerUI
TabFrameTab.border = com.github.weisj.darklaf.ui.tabframe.DarkTabFrameTabBorder TabFrameTab.border = com.github.weisj.darklaf.ui.tabframe.DarkTabFrameTabBorder
TabFrameTab.foreground = %textForeground TabFrameTab.foreground = %textForeground
TabFrameTab.hoverForeground = %textForeground
TabFrameTab.selectedForeground = %textForegroundHighlight TabFrameTab.selectedForeground = %textForegroundHighlight
TabFrameTab.selectedBackground = %backgroundSelectedSecondary TabFrameTab.selectedBackground = %backgroundSelectedSecondary
TabFrameTab.hoverBackground = %backgroundHoverSecondary TabFrameTab.hoverBackground = %backgroundHoverSecondary

1
core/src/main/resources/com/github/weisj/darklaf/properties/ui/text.properties

@ -35,6 +35,7 @@ TextField.border.disabled = %widgetBorderInactive
TextField.border.focusError = %glowFocusErrorLine TextField.border.focusError = %glowFocusErrorLine
TextField.border.focus = %glowFocusLine TextField.border.focus = %glowFocusLine
TextField.border.error = %glowErrorLine TextField.border.error = %glowErrorLine
TextField.border.disabled.focus = %glowFocusLineInactive
TextField.disabledBackground = %textBackgroundInactive TextField.disabledBackground = %textBackgroundInactive
TextField.inactiveBackground = %textBackgroundInactive TextField.inactiveBackground = %textBackgroundInactive
TextField.background = %textBackground TextField.background = %textBackground

2
core/src/main/resources/com/github/weisj/darklaf/theme/darcula/darcula_defaults.properties

@ -134,7 +134,9 @@ Theme.highContrast = false
%shadowOpacity = 10 %shadowOpacity = 10
%glowFocus = 3e84c9 %glowFocus = 3e84c9
%glowFocusInactive = 3e84c9
%glowFocusLine = 466D94 %glowFocusLine = 466D94
%glowFocusLineInactive = 466D94
%glowError = cf6767 %glowError = cf6767
%glowErrorLine = 73454B %glowErrorLine = 73454B

6
core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_dark/high_contrast_dark_defaults.properties

@ -56,8 +56,8 @@ Theme.highContrast = true
%hoverHighlight = 191919 %hoverHighlight = 191919
%clickHighlight = 2D2D2D %clickHighlight = 2D2D2D
%hoverHighlightOutline = 17D3E5 %hoverHighlightOutline = 1AEBFF
%clickHighlightOutline = 1AEBFF %clickHighlightOutline = 00b0c0
%hoverHighlightColorful = 7E00D9 %hoverHighlightColorful = 7E00D9
%clickHighlightColorful = A200D9 %clickHighlightColorful = A200D9
@ -134,7 +134,9 @@ Theme.highContrast = true
%shadowOpacity = 0 %shadowOpacity = 0
%glowFocus = 1AEBFF %glowFocus = 1AEBFF
%glowFocusInactive = AA6E28
%glowFocusLine = 1AEBFF %glowFocusLine = 1AEBFF
%glowFocusLineInactive = AA6E28
%glowError = 800002 %glowError = 800002
%glowErrorLine = E6194B %glowErrorLine = E6194B

8
core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_dark/high_contrast_dark_styleSheet.css

@ -19,7 +19,7 @@ body {
font-weight: normal; font-weight: normal;
margin-left: 0; margin-left: 0;
margin-right: 0; margin-right: 0;
color: #FFFFFF; color: #000000;
} }
p { p {
@ -279,7 +279,7 @@ var {
} }
table { table {
border-color: Gray; border-color: White;
border-style: outset; border-style: outset;
} }
@ -288,7 +288,7 @@ tr {
} }
td { td {
border-color: Gray; border-color: White;
border-style: inset; border-style: inset;
padding: 3px; padding: 3px;
} }
@ -296,7 +296,7 @@ td {
th { th {
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
border-color: Gray; border-color: White;
border-style: inset; border-style: inset;
padding: 3px; padding: 3px;
} }

1
core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_dark/high_contrast_dark_ui.properties

@ -24,5 +24,6 @@
# suppress inspection "UnusedProperty" for whole file # suppress inspection "UnusedProperty" for whole file
ColorChooser.swatchesDefaultRecentColor = 000000 ColorChooser.swatchesDefaultRecentColor = 000000
Button.borderless.drawOutline = true Button.borderless.drawOutline = true
TabbedPane.selectedHoverBackground = %backgroundHover
ToolTip.paintShadow = false ToolTip.paintShadow = false
ScrollBar.fadeEndColor = %ScrollBar.fadeStartColor ScrollBar.fadeEndColor = %ScrollBar.fadeStartColor

157
core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_light/high_contrast_light_defaults.properties

@ -0,0 +1,157 @@
#MIT License
#
#Copyright (c) 2020 Jannis Weis
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:
#
#The above copyright notice and this permission notice shall be included in all
#copies or substantial portions of the Software.
#
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
#SOFTWARE.
#
# suppress inspection "UnusedProperty" for whole file
Theme.dark = false
Theme.highContrast = true
####Background####
%background = FFFFFF
%backgroundAlternative = CCCCFF
%backgroundColorful = D18CFF
%backgroundColorfulInactive = DACCE5
%backgroundContainer = FFFFFF
%backgroundHeader = 7F7FFF
%backgroundToolTip = ebccff
%backgroundToolTipInactive = DACCE5
%backgroundHover = 7FD7F0
%backgroundSelected = FFFFFF
%backgroundHoverSecondary = 0000CC
%backgroundSelectedSecondary = 0000CC
%backgroundHoverColorful = A426FF
%backgroundSelectedColorful = A426FF
%dropBackground = 000000
%dropForeground = 00EAFF
####Border####
%borderSecondary = 191919
%border = 4C4C4C
%borderTertiary = 191919
%borderFocus = 00D1E5
%gridLine = 191919
####Highlight####
%hoverHighlight = E6E6E6
%clickHighlight = D2D2D2
%hoverHighlightOutline = 1AD6E8
%clickHighlightOutline = 198fb3
%hoverHighlightColorful = A426FF
%clickHighlightColorful = C826FF
%hoverHighlightDefault = 1AD6E8
%clickHighlightDefault = 00D1E5
%hoverHighlightSecondary = 0000CC
%clickHighlightSecondary = 0000CC
%highlightFill = B0B0BD
%highlightFillFocus = 0000CC
%highlightFillFocusSecondary = 00D1E5
%highlightFillMono = 00D1E5
####Widgets####
%widgetBorder = 000000
%widgetBorderInactive = ea9c43
%widgetBorderDefault = 00D1E5
%widgetFill = FFFFFF
%widgetFillSelected = FFFFFF
%widgetFillInactive = FFFFFF
%widgetFillDefault = 00D1E5
####Controls####
%controlBorder = 000000
%controlBorderDisabled = ea9c43
%controlBorderSelected = 000000
%controlBorderFocus = 00D1E5
%controlBorderFocusSelected = 00D1E5
%controlBorderSecondary = FFFFFF
%controlFill = 000000
%controlFillFocus = 000000
%controlFillSecondary = 000000
%controlTrack = 191919
%controlFillDisabled = ea9c43
%controlFillHighlight = 0000CC
%controlFillHighlightDisabled = B0B0BD
%controlBackground = BFBFBF
%controlFadeStart = 000000
%controlFadeEnd = E5E5E5
%controlErrorFadeStart = E6194B
%controlErrorFadeEnd = E3BCC7
%controlPassedFadeStart = 19FF38
%controlPassedFadeEnd = BAEAC3
####Text####
%caret = 000000
%textForeground = 000000
%textForegroundDefault = FFFFFF
%textForegroundHighlight = 000000
%textForegroundInactive = E0861F
%textForegroundSecondary = 666666
%acceleratorForeground = 191919
%textContrastForeground = FFFFFF
%textSelectionForeground = FFFFFF
%textSelectionForegroundInactive = 000000
%textSelectionForegroundDisabled = E0861F
%textSelectionBackground = 00b0e6
%textSelectionBackgroundSecondary = 9999FF
%textBackground = FFFFFF
%textBackgroundInactive = FFFFFF
%textBackgroundSecondary = EBEBEC
%textBackgroundSecondaryInactive = EBEBEC
%hyperlink = 00D1E5
####Misc####
%shadow = 000000
%glowOpacity = 100
%dropOpacity = 50
%shadowOpacity = 0
%glowFocus = 00D1E5
%glowFocusInactive = ea9c43
%glowFocusLine = 00D1E5
%glowFocusLineInactive = ea9c43
%glowError = FF7F81
%glowErrorLine = E6194B
%glowFocusError = E6194B
%glowFocusErrorLine = E6194B
%glowWarning = CE5B0A
%glowWarningLine = CE5B0A
#Arc
%arc = 5
%arcFocus = 5
%arcSecondary = 3
%arcSecondaryFocus = 3
%borderThickness = 3
%shadowHeight = 3

47
core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_light/high_contrast_light_icons.properties

@ -0,0 +1,47 @@
#
# MIT License
#
# Copyright (c) 2020 Jannis Weis
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# suppress inspection "UnusedProperty" for whole file
%menuIconEnabled = 000000
%menuIconHovered = FFFFFF
%menuIconSelected = 000000
%menuIconSelectedSecondary = 000000
%menuIconDisabled = ea9c43
%menuIconHighlight = 00D1E5
%fileIconBackground = 000000
%fileIconForeground = FFFFFF
%fileIconHighlight = 26d94a
%textIconEnabled = 000000
%textIconDisabled = E0861F
%textIconSelected = 000000
%windowButton = 000000
%windowButtonDisabled = 666666
%windowCloseHovered = FFFFFF
%errorIconColor = E6194B
%informationIconColor = 26d94a
%warningIconColor = CE5B0A
%questionIconColor = 26d94a

34
core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_light/high_contrast_light_platform.properties

@ -0,0 +1,34 @@
#
# MIT License
#
# Copyright (c) 2020 Jannis Weis
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# suppress inspection "UnusedProperty" for whole file
###Windows###
Windows.TitlePane.inactiveBackgroundHover = dbcbb8
Windows.TitlePane.inactiveBackgroundClick = 594B39
Windows.TitlePane.inactiveBackground = c5b7a5
Windows.TitlePane.inactiveForeground = %textForegroundSecondary
###MacOS###
MacOS.TitlePane.inactiveBackground = c5b7a5
MacOS.TitlePane.inactiveForeground = %textForegroundSecondary

337
core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_light/high_contrast_light_styleSheet.css

@ -0,0 +1,337 @@
/*
* Copyright 2000-2014 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.
*/
body {
font-size: 14pt;
font-family: Serif, serif;
font-weight: normal;
margin-left: 0;
margin-right: 0;
color: #FFFFFF;
}
p {
margin-top: 15px;
}
h1 {
font-size: x-large;
font-weight: bold;
margin-top: 10px;
margin-bottom: 10px;
}
h2 {
font-size: large;
font-weight: bold;
margin-top: 10px;
margin-bottom: 10px;
}
h3 {
font-size: medium;
font-weight: bold;
margin-top: 10px;
margin-bottom: 10px;
}
h4 {
font-size: small;
font-weight: bold;
margin-top: 10px;
margin-bottom: 10px;
}
h5 {
font-size: x-small;
font-weight: bold;
margin-top: 10px;
margin-bottom: 10px;
}
h6 {
font-size: xx-small;
font-weight: bold;
margin-top: 10px;
margin-bottom: 10px;
}
li p {
margin-top: 0;
margin-bottom: 0;
}
td p {
margin-top: 0;
}
menu li p {
margin-top: 0;
margin-bottom: 0;
}
menu li {
margin: 0;
}
menu {
margin-left-ltr: 40px;
margin-right-rtl: 40px;
margin-top: 10px;
margin-bottom: 10px;
}
dir li p {
margin-top: 0;
margin-bottom: 0;
}
dir li {
margin: 0;
}
dir {
margin-left-ltr: 40px;
margin-right-rtl: 40px;
margin-top: 10px;
margin-bottom: 10px;
}
dd {
margin-left-ltr: 40px;
margin-right-rtl: 40px;
margin-top: 0;
margin-bottom: 0;
}
dd p {
margin: 0;
}
dt {
margin-top: 0;
margin-bottom: 0;
}
dl {
margin-left: 0;
margin-top: 10px;
margin-bottom: 10px;
}
ol li {
margin: 0;
}
ol {
margin-top: 10px;
margin-bottom: 10px;
margin-left-ltr: 50px;
margin-right-rtl: 50px;
list-style-type: decimal;
}
ol li p {
margin-top: 0;
margin-bottom: 0;
}
ul li {
margin: 0;
}
ul {
margin-top: 10px;
margin-bottom: 10px;
margin-left-ltr: 50px;
margin-right-rtl: 50px;
list-style-type: disc;
-bullet-gap: 10px;
}
ul li ul li {
margin: 0;
}
ul li ul {
list-style-type: circle;
margin-left-ltr: 25px;
margin-right-rtl: 25px;
}
ul li ul li ul li {
margin: 0;
}
ul li ul li ul {
list-style-type: square;
margin-left-ltr: 25px;
margin-right-rtl: 25px;
}
ul li menu {
list-style-type: circle;
margin-left-ltr: 25px;
margin-right-rtl: 25px;
}
ul li p {
margin-top: 0;
margin-bottom: 0;
}
a {
color: #00D1E5;
text-decoration: underline;
}
address {
color: #00D1E5;
font-style: italic;
}
big {
font-size: x-large;
}
small {
font-size: x-small;
}
samp {
font-size: small;
font-family: Monospaced, monospace;
}
cite {
font-style: italic;
}
code {
font-size: small;
font-family: Monospaced, monospace;
}
dfn {
font-style: italic;
}
em {
font-style: italic;
}
i {
font-style: italic;
}
b {
font-weight: bold;
}
kbd {
font-size: small;
font-family: Monospaced, monospace;
}
s {
text-decoration: line-through;
}
strike {
text-decoration: line-through;
}
strong {
font-weight: bold;
}
sub {
vertical-align: sub;
}
sup {
vertical-align: sub;
}
tt {
font-family: Monospaced, monospace;
}
u {
text-decoration: underline;
}
var {
font-weight: bold;
font-style: italic;
}
table {
border-color: Black;
border-style: outset;
}
tr {
text-align: left;
}
td {
border-color: Black;
border-style: inset;
padding: 3px;
}
th {
text-align: center;
font-weight: bold;
border-color: Black;
border-style: inset;
padding: 3px;
}
blockquote {
margin: 5px 35px;
}
center {
text-align: center;
}
pre {
margin-top: 5px;
margin-bottom: 5px;
font-family: Monospaced, monospace;
}
pre p {
margin-top: 0;
}
caption {
caption-side: top;
text-align: center;
}
table {
border: none;
}
td {
border: none;
}
nobr {
white-space: nowrap;
}

32
core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_light/high_contrast_light_ui.properties

@ -0,0 +1,32 @@
#
# MIT License
#
# Copyright (c) 2020 Jannis Weis
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# suppress inspection "UnusedProperty" for whole file
ColorChooser.swatchesDefaultRecentColor = FFFFFF
Button.borderless.drawOutline = true
ToolTip.paintShadow = false
TableHeader.foreground = FFFFFF
TabbedPane.selectedHoverBackground = %backgroundHover
TabFrameTab.selectedForeground = %textSelectionForeground
TabFrameTab.hoverForeground = %textSelectionForeground
ScrollBar.fadeEndColor = %ScrollBar.fadeStartColor

3
core/src/main/resources/com/github/weisj/darklaf/theme/intellij/intellij_defaults.properties

@ -136,7 +136,10 @@ Theme.highContrast = false
%shadowOpacity = 10 %shadowOpacity = 10
%glowFocus = 3d94f2 %glowFocus = 3d94f2
%glowFocusInactive = 3d94f2
%glowFocusLine = 7B9FC7 %glowFocusLine = 7B9FC7
%glowFocusLineInactive = 7B9FC7
%glowError = EBBCBC %glowError = EBBCBC
%glowErrorLine = E0A8A9 %glowErrorLine = E0A8A9

2
core/src/main/resources/com/github/weisj/darklaf/theme/solarized_dark/solarized_dark_defaults.properties

@ -135,7 +135,9 @@ Theme.highContrast = false
%shadowOpacity = 10 %shadowOpacity = 10
%glowFocus = 3c84c7 %glowFocus = 3c84c7
%glowFocusInactive = 3c84c7
%glowFocusLine = 296996 %glowFocusLine = 296996
%glowFocusLineInactive = 296996
%glowError = 53515A %glowError = 53515A
%glowErrorLine = 564755 %glowErrorLine = 564755

2
core/src/main/resources/com/github/weisj/darklaf/theme/solarized_light/solarized_light_defaults.properties

@ -135,7 +135,9 @@ Theme.highContrast = false
%shadowOpacity = 10 %shadowOpacity = 10
%glowFocus = 3b93eb %glowFocus = 3b93eb
%glowFocusInactive = 3b93eb
%glowFocusLine = A5C7E2 %glowFocusLine = A5C7E2
%glowFocusLineInactive = A5C7E2
%glowError = E8B4A6 %glowError = E8B4A6
%glowErrorLine = DE3641 %glowErrorLine = DE3641

Loading…
Cancel
Save