Browse Source

Made theme consistent across demo classes.

Added *.disabledText to globals.
Fixed incorrect disabled foreground for labels.
Adjusted radioButton baseline offset.
Adjusted some values for dark high contrast theme.
pull/127/head
weisj 5 years ago
parent
commit
88331ee2ad
  1. 2
      core/src/main/java/com/github/weisj/darklaf/ui/label/DarkLabelUI.java
  2. 1
      core/src/main/resources/com/github/weisj/darklaf/properties/globals.properties
  3. 2
      core/src/main/resources/com/github/weisj/darklaf/properties/ui/radioButton.properties
  4. 4
      core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_dark/high_contrast_dark_defaults.properties
  5. 2
      core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_dark/high_contrast_dark_icons.properties
  6. 2
      core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_dark/high_contrast_dark_ui.properties
  7. 3
      core/src/test/java/icon/AllIcons.java
  8. 6
      core/src/test/java/ui/ComponentDemo.java
  9. 3
      core/src/test/java/ui/colorChooser/ColorChooserDemo.java
  10. 4
      core/src/test/java/ui/dialog/DialogDemo.java
  11. 3
      core/src/test/java/ui/fileChooser/FileChooserDemo.java
  12. 3
      core/src/test/java/ui/internalFrame/InternalFrameDemo.java
  13. 59
      core/src/test/java/ui/tabbedPane/TabbedPaneKeyboardShortcut.java

2
core/src/main/java/com/github/weisj/darklaf/ui/label/DarkLabelUI.java

@ -152,7 +152,7 @@ public class DarkLabelUI extends BasicLabelUI implements PropertyChangeListener
} }
} }
} else { } else {
g.setColor(l.getForeground()); g.setColor(inactiveForeground);
} }
SwingUtilities2.drawStringUnderlineCharAt(l, g, s, accChar, SwingUtilities2.drawStringUnderlineCharAt(l, g, s, accChar,
textX, textY); textX, textY);

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

@ -30,6 +30,7 @@ global.caretForeground = %caret
global.textForeground = %textForeground global.textForeground = %textForeground
global.foreground = %textForeground global.foreground = %textForeground
global.selectionInactiveForeground = %textForegroundInactive global.selectionInactiveForeground = %textForegroundInactive
global.disabledText = %textForegroundInactive
global.selectionForeground = %textSelectionForeground global.selectionForeground = %textSelectionForeground
global.selectionForegroundInactive = %textSelectionForegroundInactive global.selectionForegroundInactive = %textSelectionForegroundInactive
global.selectionBackground = %textSelectionBackground global.selectionBackground = %textSelectionBackground

2
core/src/main/resources/com/github/weisj/darklaf/properties/ui/radioButton.properties

@ -38,7 +38,7 @@ RadioButton.activeBorderColor = %controlBorder
RadioButton.inactiveBorderColor = %controlBorderDisabled RadioButton.inactiveBorderColor = %controlBorderDisabled
RadioButton.borderInsets = 4,4,4,4 RadioButton.borderInsets = 4,4,4,4
RadioButton.iconBaselineOffset = 2 RadioButton.iconBaselineOffset = 1
#Icons #Icons
RadioButton.icon = {control/radio.svg[themed](19,19);\ RadioButton.icon = {control/radio.svg[themed](19,19);\

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

@ -41,7 +41,7 @@ Theme.dark = true
%backgroundHoverColorful = 7E00D9 %backgroundHoverColorful = 7E00D9
%backgroundSelectedColorful = 7E00D9 %backgroundSelectedColorful = 7E00D9
%dropBackground = 000000 %dropBackground = FFFFFF
%dropForeground = 00EAFF %dropForeground = 00EAFF
####Border#### ####Border####
@ -129,7 +129,7 @@ Theme.dark = true
%shadow = 000000 %shadow = 000000
%glowOpacity = 100 %glowOpacity = 100
%dropOpacity = 80 %dropOpacity = 50
%shadowOpacity = 0 %shadowOpacity = 0
%glowFocus = 1AEBFF %glowFocus = 1AEBFF

2
core/src/main/resources/com/github/weisj/darklaf/theme/high_contrast_dark/high_contrast_dark_icons.properties

@ -26,7 +26,7 @@
%menuIconHovered = FFFFFF %menuIconHovered = FFFFFF
%menuIconSelected = FFFFFF %menuIconSelected = FFFFFF
%menuIconSelectedSecondary = FFFFFF %menuIconSelectedSecondary = FFFFFF
%menuIconDisabled = 5B5B5B %menuIconDisabled = AA6E28
%menuIconHighlight = 1AEBFF %menuIconHighlight = 1AEBFF
%fileIconBackground = FFFFFF %fileIconBackground = FFFFFF

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

@ -22,7 +22,7 @@
# SOFTWARE. # SOFTWARE.
# #
# suppress inspection "UnusedProperty" for whole file # suppress inspection "UnusedProperty" for whole file
ColorChooser.swatchesDefaultRecentColor = FFFFFF ColorChooser.swatchesDefaultRecentColor = 000000
Button.borderless.drawOutline = true Button.borderless.drawOutline = true
ToolTip.paintShadow = false ToolTip.paintShadow = false
ScrollBar.fadeEndColor = %ScrollBar.fadeStartColor ScrollBar.fadeEndColor = %ScrollBar.fadeStartColor

3
core/src/test/java/icon/AllIcons.java

@ -30,6 +30,7 @@ import com.github.weisj.darklaf.icons.IconLoader;
import com.github.weisj.darklaf.icons.ThemedSVGIcon; import com.github.weisj.darklaf.icons.ThemedSVGIcon;
import com.github.weisj.darklaf.util.Pair; import com.github.weisj.darklaf.util.Pair;
import com.kitfox.svg.app.beans.SVGIcon; import com.kitfox.svg.app.beans.SVGIcon;
import ui.ComponentDemo;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ListDataListener; import javax.swing.event.ListDataListener;
@ -55,7 +56,7 @@ public class AllIcons {
public static void main(final String[] args) { public static void main(final String[] args) {
SwingUtilities.invokeLater(() -> { SwingUtilities.invokeLater(() -> {
LafManager.install(); LafManager.install(ComponentDemo.getTheme());
try { try {
JFrame frame = new JFrame("Icons"); JFrame frame = new JFrame("Icons");
JList<Pair<String, Icon>> list = new JList<>(new ListModel<Pair<String, Icon>>() { JList<Pair<String, Icon>> list = new JList<>(new ListModel<Pair<String, Icon>>() {

6
core/src/test/java/ui/ComponentDemo.java

@ -32,6 +32,10 @@ import java.awt.event.ActionEvent;
public interface ComponentDemo { public interface ComponentDemo {
static Theme getTheme() {
return new IntelliJTheme();
}
JComponent createComponent(); JComponent createComponent();
static void showDemo(final ComponentDemo demo) { static void showDemo(final ComponentDemo demo) {
@ -40,7 +44,7 @@ public interface ComponentDemo {
static void showDemo(final ComponentDemo demo, final Dimension dimension) { static void showDemo(final ComponentDemo demo, final Dimension dimension) {
SwingUtilities.invokeLater(() -> { SwingUtilities.invokeLater(() -> {
LafManager.install(); LafManager.install(getTheme());
JFrame frame = new JFrame(); JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setTitle(demo.getTitle()); frame.setTitle(demo.getTitle());

3
core/src/test/java/ui/colorChooser/ColorChooserDemo.java

@ -24,6 +24,7 @@
package ui.colorChooser; package ui.colorChooser;
import com.github.weisj.darklaf.LafManager; import com.github.weisj.darklaf.LafManager;
import ui.ComponentDemo;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -32,7 +33,7 @@ public final class ColorChooserDemo {
public static void main(final String[] args) { public static void main(final String[] args) {
SwingUtilities.invokeLater(() -> { SwingUtilities.invokeLater(() -> {
LafManager.install(); LafManager.install(ComponentDemo.getTheme());
/* /*
* In newer versions of the JDK you can control whether the transparency slider is visible or not. * In newer versions of the JDK you can control whether the transparency slider is visible or not.
*/ */

4
core/src/test/java/ui/dialog/DialogDemo.java

@ -25,7 +25,7 @@
package ui.dialog; package ui.dialog;
import com.github.weisj.darklaf.LafManager; import com.github.weisj.darklaf.LafManager;
import com.github.weisj.darklaf.theme.DarculaTheme; import ui.ComponentDemo;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.Border; import javax.swing.border.Border;
@ -90,7 +90,7 @@ public class DialogDemo extends JPanel {
public static void main(final String[] args) { public static void main(final String[] args) {
//Schedule a job for the event-dispatching thread: //Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI. //creating and showing this application's GUI.
LafManager.install(new DarculaTheme()); LafManager.install(ComponentDemo.getTheme());
javax.swing.SwingUtilities.invokeLater(DialogDemo::createAndShowGUI); javax.swing.SwingUtilities.invokeLater(DialogDemo::createAndShowGUI);
} }

3
core/src/test/java/ui/fileChooser/FileChooserDemo.java

@ -24,6 +24,7 @@
package ui.fileChooser; package ui.fileChooser;
import com.github.weisj.darklaf.LafManager; import com.github.weisj.darklaf.LafManager;
import ui.ComponentDemo;
import javax.swing.*; import javax.swing.*;
import javax.swing.filechooser.FileNameExtensionFilter; import javax.swing.filechooser.FileNameExtensionFilter;
@ -32,7 +33,7 @@ public final class FileChooserDemo {
public static void main(final String[] args) { public static void main(final String[] args) {
SwingUtilities.invokeLater(() -> { SwingUtilities.invokeLater(() -> {
LafManager.install(); LafManager.install(ComponentDemo.getTheme());
JFileChooser chooser = new JFileChooser(System.getProperty("user.home")); JFileChooser chooser = new JFileChooser(System.getProperty("user.home"));
chooser.addChoosableFileFilter(new FileNameExtensionFilter("Test Filter", ".svg")); chooser.addChoosableFileFilter(new FileNameExtensionFilter("Test Filter", ".svg"));
chooser.setMultiSelectionEnabled(true); chooser.setMultiSelectionEnabled(true);

3
core/src/test/java/ui/internalFrame/InternalFrameDemo.java

@ -24,6 +24,7 @@
package ui.internalFrame; package ui.internalFrame;
import com.github.weisj.darklaf.LafManager; import com.github.weisj.darklaf.LafManager;
import ui.ComponentDemo;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -94,7 +95,7 @@ public class InternalFrameDemo extends JFrame implements ActionListener {
* Create the GUI and show it. For thread safety, this method should be invoked from the event-dispatching thread. * Create the GUI and show it. For thread safety, this method should be invoked from the event-dispatching thread.
*/ */
private static void createAndShowGUI() { private static void createAndShowGUI() {
LafManager.install(); LafManager.install(ComponentDemo.getTheme());
//Create and set up the window. //Create and set up the window.
InternalFrameDemo frame = new InternalFrameDemo(); InternalFrameDemo frame = new InternalFrameDemo();

59
core/src/test/java/ui/tabbedPane/TabbedPaneKeyboardShortcut.java

@ -23,48 +23,41 @@
*/ */
package ui.tabbedPane; package ui.tabbedPane;
import com.github.weisj.darklaf.LafManager; import ui.ComponentDemo;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
public class TabbedPaneKeyboardShortcut extends JPanel { public class TabbedPaneKeyboardShortcut implements ComponentDemo {
public TabbedPaneKeyboardShortcut() {
initializeUI();
}
private void initializeUI() {
LafManager.install();
this.setLayout(new BorderLayout());
this.setPreferredSize(new Dimension(500, 200));
JTabbedPane pane = new JTabbedPane();
pane.addTab("A Tab", new JPanel());
pane.addTab("B Tab", new JPanel());
pane.addTab("C Tab", new JPanel());
pane.addTab("D Tab", new JPanel());
pane.setMnemonicAt(0, KeyEvent.VK_A);
pane.setMnemonicAt(1, KeyEvent.VK_B);
pane.setMnemonicAt(2, KeyEvent.VK_C);
pane.setMnemonicAt(3, KeyEvent.VK_D);
this.add(pane, BorderLayout.CENTER);
}
public static void main(final String[] args) { public static void main(final String[] args) {
SwingUtilities.invokeLater(() -> TabbedPaneKeyboardShortcut.showFrame()); ComponentDemo.showDemo(new TabbedPaneKeyboardShortcut());
} }
public static void showFrame() { @Override
JPanel panel = new TabbedPaneKeyboardShortcut(); public JComponent createComponent() {
panel.setOpaque(true); JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.setPreferredSize(new Dimension(500, 200));
JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.addTab("A Tab", new JPanel());
tabbedPane.addTab("B Tab", new JPanel());
tabbedPane.addTab("C Tab", new JPanel());
tabbedPane.addTab("D Tab", new JPanel());
tabbedPane.setMnemonicAt(0, KeyEvent.VK_A);
tabbedPane.setMnemonicAt(1, KeyEvent.VK_B);
tabbedPane.setMnemonicAt(2, KeyEvent.VK_C);
tabbedPane.setMnemonicAt(3, KeyEvent.VK_D);
panel.add(tabbedPane, BorderLayout.CENTER);
return panel;
}
JFrame frame = new JFrame("JTabbedPane Demo"); @Override
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); public String getTitle() {
frame.setContentPane(panel); return "Tabbed Pane Keyboard Shortcut Demo";
frame.pack();
frame.setVisible(true);
} }
} }

Loading…
Cancel
Save