diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDarculaLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDarculaLaf.java new file mode 100644 index 00000000..7022a819 --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatDarculaLaf.java @@ -0,0 +1,36 @@ +/* + * Copyright 2019 FormDev Software GmbH + * + * 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. + */ + +package com.formdev.flatlaf; + +/** + * A Flat LaF that has a dark color scheme and looks like Darcula LaF. + * + * @author Karl Tauber + */ +public class FlatDarculaLaf + extends FlatDarkLaf +{ + @Override + public String getName() { + return "Flat Darcula"; + } + + @Override + public String getDescription() { + return "Flat Darcula Look and Feel"; + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatIntelliJLaf.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatIntelliJLaf.java new file mode 100644 index 00000000..5aa2e3ab --- /dev/null +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatIntelliJLaf.java @@ -0,0 +1,36 @@ +/* + * Copyright 2019 FormDev Software GmbH + * + * 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. + */ + +package com.formdev.flatlaf; + +/** + * A Flat LaF that has a light color scheme and looks like IntelliJ LaF. + * + * @author Karl Tauber + */ +public class FlatIntelliJLaf + extends FlatLightLaf +{ + @Override + public String getName() { + return "Flat IntelliJ"; + } + + @Override + public String getDescription() { + return "Flat IntelliJ Look and Feel"; + } +} diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatRadioButtonIcon.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatRadioButtonIcon.java index 44ad786e..5b6ee1a8 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatRadioButtonIcon.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/icons/FlatRadioButtonIcon.java @@ -17,15 +17,21 @@ package com.formdev.flatlaf.icons; import java.awt.Graphics2D; +import java.awt.geom.Ellipse2D; +import com.formdev.flatlaf.ui.FlatUIUtils; /** * Icon for {@link javax.swing.JRadioButton}. * + * @uiDefault RadioButton.icon.centerDiameter int + * * @author Karl Tauber */ public class FlatRadioButtonIcon extends FlatCheckBoxIcon { + protected final int centerDiameter = FlatUIUtils.getUIInt( "RadioButton.icon.centerDiameter", 8 ); + @Override protected void paintFocusBorder( Graphics2D g2 ) { g2.fillOval( 0, 0, iconSize, iconSize ); @@ -43,6 +49,7 @@ public class FlatRadioButtonIcon @Override protected void paintCheckmark( Graphics2D g2 ) { - g2.fillOval( focusWidth + 5, focusWidth + 5, 5, 5 ); + float xy = (iconSize - centerDiameter) / 2f; + g2.fill( new Ellipse2D.Float( xy, xy, centerDiameter, centerDiameter ) ); } } diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarculaLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarculaLaf.properties new file mode 100644 index 00000000..0d2ce1fe --- /dev/null +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatDarculaLaf.properties @@ -0,0 +1,28 @@ +# +# Copyright 2019 FormDev Software GmbH +# +# 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. +# + +# Colors and style mostly based on Darcula theme from IntelliJ IDEA Community Edition, +# which is licensed under the Apache 2.0 license. Copyright 2000-2019 JetBrains s.r.o. +# See: https://github.com/JetBrains/intellij-community/ + +#---- Component ---- + +Component.focusWidth=2 + + +#---- RadioButton ---- + +RadioButton.icon.centerDiameter=5 diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties new file mode 100644 index 00000000..069dc434 --- /dev/null +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatIntelliJLaf.properties @@ -0,0 +1,35 @@ +# +# Copyright 2019 FormDev Software GmbH +# +# 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. +# + +# Colors and style mostly based on IntelliJ theme from IntelliJ IDEA Community Edition, +# which is licensed under the Apache 2.0 license. Copyright 2000-2019 JetBrains s.r.o. +# See: https://github.com/JetBrains/intellij-community/ + +#---- CheckBox ---- + +CheckBox.icon.selectedBorderColor=4982CC +CheckBox.icon.selectedBackground=4D89C9 +CheckBox.icon.checkmarkColor=FFFFFF + + +#---- Component ---- + +Component.focusWidth=2 + + +#---- RadioButton ---- + +RadioButton.icon.centerDiameter=5 diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties index 570b999b..37e052e5 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLaf.properties @@ -93,7 +93,7 @@ ComboBox.padding=1,6,1,6 #---- Component ---- -Component.focusWidth=2 +Component.focusWidth=0 Component.arc=5 @@ -189,6 +189,7 @@ ProgressBar.verticalSize=6,146 RadioButton.border=com.formdev.flatlaf.ui.FlatMarginBorder RadioButton.icon=com.formdev.flatlaf.icons.FlatRadioButtonIcon +RadioButton.icon.centerDiameter=8 #---- RadioButtonMenuItem ---- diff --git a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties index a408469c..3288e13c 100644 --- a/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties +++ b/flatlaf-core/src/main/resources/com/formdev/flatlaf/FlatLightLaf.properties @@ -82,13 +82,13 @@ Button.toolbar.pressedBackground=cfcfcf CheckBox.icon.borderColor=878787 CheckBox.icon.disabledBorderColor=BDBDBD -CheckBox.icon.selectedBorderColor=4982CC +CheckBox.icon.selectedBorderColor=878787 CheckBox.icon.focusedBorderColor=7B9FC7 CheckBox.icon.selectedFocusedBorderColor=ACCFF7 CheckBox.icon.background=FFFFFF CheckBox.icon.disabledBackground=@background -CheckBox.icon.selectedBackground=4D89C9 -CheckBox.icon.checkmarkColor=FFFFFF +CheckBox.icon.selectedBackground=FFFFFF +CheckBox.icon.checkmarkColor=4D89C9 CheckBox.icon.disabledCheckmarkColor=ABABAB diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/ControlBar.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/ControlBar.java index ecb38dc0..6504402a 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/ControlBar.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/ControlBar.java @@ -44,6 +44,8 @@ class ControlBar DefaultComboBoxModel lafModel = new DefaultComboBoxModel<>(); lafModel.addElement( new LafInfo( "Flat Light (F1)", FlatLightLaf.class.getName() ) ); lafModel.addElement( new LafInfo( "Flat Dark (F2)", FlatDarkLaf.class.getName() ) ); + lafModel.addElement( new LafInfo( "Flat IntelliJ (F3)", FlatIntelliJLaf.class.getName() ) ); + lafModel.addElement( new LafInfo( "Flat Darcula (F4)", FlatDarculaLaf.class.getName() ) ); UIManager.LookAndFeelInfo[] lookAndFeels = UIManager.getInstalledLookAndFeels(); for( UIManager.LookAndFeelInfo lookAndFeel : lookAndFeels ) { @@ -82,6 +84,8 @@ class ControlBar // register F1, F2, ... keys to switch to Light, Dark or other LaFs registerSwitchToLookAndFeel( KeyEvent.VK_F1, FlatLightLaf.class.getName() ); registerSwitchToLookAndFeel( KeyEvent.VK_F2, FlatDarkLaf.class.getName() ); + registerSwitchToLookAndFeel( KeyEvent.VK_F3, FlatIntelliJLaf.class.getName() ); + registerSwitchToLookAndFeel( KeyEvent.VK_F4, FlatDarculaLaf.class.getName() ); registerSwitchToLookAndFeel( KeyEvent.VK_F10, NimbusLookAndFeel.class.getName() ); registerSwitchToLookAndFeel( KeyEvent.VK_F11, MetalLookAndFeel.class.getName() );