Merge remote-tracking branch 'origin/main' into styling

# Conflicts:
#	flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java
#	flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatInternalFrameUI.java
#	flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTextFieldUI.java
This commit is contained in:
Karl Tauber
2021-08-31 15:41:46 +02:00
194 changed files with 8222 additions and 2465 deletions

View File

@@ -97,11 +97,22 @@ jobs:
restore-keys: ${{ runner.os }}-gradle
- name: Publish snapshot to oss.sonatype.org
run: ./gradlew publish -Dorg.gradle.internal.publish.checksums.insecure=true
run: ./gradlew publish :flatlaf-theme-editor:build -Dorg.gradle.internal.publish.checksums.insecure=true
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
- name: Upload theme editor
uses: sebastianpopp/ftp-action@releases/v2
with:
host: ${{ secrets.FTP_SERVER }}
user: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
forceSsl: true
localDir: "flatlaf-theme-editor/build/libs"
remoteDir: "snapshots"
options: "--only-newer --no-recursion --verbose=1"
release:
runs-on: ubuntu-latest
@@ -133,7 +144,7 @@ jobs:
restore-keys: ${{ runner.os }}-gradle
- name: Release a new stable version to Maven Central
run: ./gradlew publish :flatlaf-demo:build -Drelease=true
run: ./gradlew publish :flatlaf-demo:build :flatlaf-theme-editor:build -Drelease=true
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
@@ -150,3 +161,14 @@ jobs:
localDir: "flatlaf-demo/build/libs"
remoteDir: "."
options: "--only-newer --no-recursion --verbose=1"
- name: Upload theme editor
uses: sebastianpopp/ftp-action@releases/v2
with:
host: ${{ secrets.FTP_SERVER }}
user: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
forceSsl: true
localDir: "flatlaf-theme-editor/build/libs"
remoteDir: "."
options: "--only-newer --no-recursion --verbose=1"

View File

@@ -1,7 +1,55 @@
FlatLaf Change Log
==================
## 1.4-SNAPSHOT
## 1.6-SNAPSHOT
#### New features and improvements
- InternalFrame: Double-click on icon in internal frame title bar now closes the
internal frame. (issue #374)
- IntelliJ Themes: Removed deprecated `install()` methods.
#### Fixed bugs
- Menus: Fixed missing modifiers flags in `ActionEvent` (e.g. `Ctrl` key
pressed) when running in Java 9+ on Linux, macOS. Occurs also on Windows in
large popup menus that do not fit into the window. (issue #371; regression
since FlatLaf 1.3)
- OptionPane: Fixed `OptionPane.sameSizeButtons`, which did not work as expected
when setting to `false`.
## 1.5
#### New features and improvements
- SwingX: Added search and clear icons to `JXSearchField`. (issue #359)
#### Fixed bugs
- Button and TextComponent: Do not apply minimum width/height if margins are
set. (issue #364)
- ComboBox and Spinner: Limit arrow button width if component has large
preferred height. (issue #361)
- FileChooser: Fixed missing (localized) texts when FlatLaf is loaded in special
classloader (e.g. plugin system in Apache NetBeans).
- InternalFrame: Limit internal frame bounds to parent bounds on resize. Also
honor maximum size of internal frame. (issue #362)
- Popup: Fixed incorrectly placed drop shadow for medium-weight popups in
maximized windows. (issue #358)
- Native window decorations (Windows 10 only):
- Fixed occasional application crash in `flatlaf-windows.dll`. (issue #357)
- When window is initially shown, fill background with window background color
(instead of white), which avoids flickering in dark themes. (issue 339)
- When resizing a window at the right/bottom edge, then first fill the new
space with the window background color (instead of black) before the layout
is updated.
- When resizing a window at the left/top edge, then first fill the new space
with the window background color (instead of garbage) before the layout is
updated.
## 1.4
#### New features and improvements
@@ -13,7 +61,7 @@ FlatLaf Change Log
- Table and PopupFactory: Use `StackWalker` in Java 9+ for better performance.
(issue #334)
- ToolBar: Paint focus indicator for focused button in toolbar. (issue #346)
- ToolBar: Support focusable buttons in toolbar (set UI values
- ToolBar: Support focusable buttons in toolbar (set UI value
`ToolBar.focusableButtons` to `true`). (issue #346)
#### Fixed bugs

View File

@@ -67,10 +67,13 @@ docs).
Addons
------
- [IntelliJ Themes Pack](flatlaf-intellij-themes)
- [Extras](flatlaf-extras)
- [SwingX](flatlaf-swingx)
- [JIDE Common Layer](flatlaf-jide-oss)
- [IntelliJ Themes Pack](flatlaf-intellij-themes) - bundles many popular
open-source 3rd party themes
- [Extras](flatlaf-extras) - SVG icon, tri-state check box, UI inspectors, and
more
- [SwingX](flatlaf-swingx) - support for SwingX components
- [JIDE Common Layer](flatlaf-jide-oss) - support for JIDE Common Layer
components
Getting started

View File

@@ -14,8 +14,8 @@
* limitations under the License.
*/
val releaseVersion = "1.3"
val developmentVersion = "1.4-SNAPSHOT"
val releaseVersion = "1.5"
val developmentVersion = "1.6-SNAPSHOT"
version = if( java.lang.Boolean.getBoolean( "release" ) ) releaseVersion else developmentVersion

View File

@@ -32,10 +32,14 @@ import java.beans.PropertyChangeListener;
import java.io.File;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.MissingResourceException;
import java.util.Properties;
import java.util.ResourceBundle;
import java.util.ServiceLoader;
import java.util.function.Consumer;
import java.util.function.Function;
@@ -63,9 +67,11 @@ import javax.swing.text.html.HTMLEditorKit;
import com.formdev.flatlaf.ui.FlatNativeWindowBorder;
import com.formdev.flatlaf.ui.FlatPopupFactory;
import com.formdev.flatlaf.ui.FlatRootPaneUI;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.GrayFilter;
import com.formdev.flatlaf.util.LoggingFacade;
import com.formdev.flatlaf.util.MultiResolutionImageSupport;
import com.formdev.flatlaf.util.StringUtils;
import com.formdev.flatlaf.util.SystemInfo;
import com.formdev.flatlaf.util.UIScale;
@@ -92,6 +98,7 @@ public abstract class FlatLaf
private MnemonicHandler mnemonicHandler;
private Consumer<UIDefaults> postInitialization;
private List<Function<Object, Object>> uiDefaultsGetters;
/**
* Sets the application look and feel to the given LaF
@@ -350,14 +357,21 @@ public abstract class FlatLaf
@Override
public UIDefaults getDefaults() {
UIDefaults defaults = super.getDefaults();
// use larger initial capacity to avoid resizing UI defaults hash table
// (from 610 to 1221 to 2443 entries) and to save some memory
UIDefaults defaults = new FlatUIDefaults( 1500, 0.75f );
// initialize basic defaults (see super.getDefaults())
initClassDefaults( defaults );
initSystemColorDefaults( defaults );
initComponentDefaults( defaults );
// add flag that indicates whether the LaF is light or dark
// (can be queried without using FlatLaf API)
defaults.put( "laf.dark", isDark() );
// add resource bundle for localized texts
defaults.addResourceBundle( "com.formdev.flatlaf.resources.Bundle" );
// init resource bundle for localized texts
initResourceBundle( defaults, "com.formdev.flatlaf.resources.Bundle" );
// initialize some defaults (for overriding) that are used in UI delegates,
// but are not set in BasicLookAndFeel
@@ -453,6 +467,45 @@ public abstract class FlatLaf
return null;
}
private void initResourceBundle( UIDefaults defaults, String bundleName ) {
// add resource bundle for localized texts
defaults.addResourceBundle( bundleName );
// Check whether Swing can not load the FlatLaf resource bundle,
// which can happen in applications that use some plugin system
// and load FlatLaf in a plugin that uses its own classloader.
// (e.g. Apache NetBeans)
if( defaults.get( "FileChooser.fileNameHeaderText" ) != null )
return;
// load FlatLaf resource bundle and add content to defaults
try {
ResourceBundle bundle = ResourceBundle.getBundle( bundleName, defaults.getDefaultLocale() );
Enumeration<String> keys = bundle.getKeys();
while( keys.hasMoreElements() ) {
String key = keys.nextElement();
String value = bundle.getString( key );
String baseKey = StringUtils.removeTrailing( key, ".textAndMnemonic" );
if( baseKey != key ) {
String text = value.replace( "&", "" );
String mnemonic = null;
int index = value.indexOf( '&' );
if( index >= 0 )
mnemonic = Integer.toString( Character.toUpperCase( value.charAt( index + 1 ) ) );
defaults.put( baseKey + "Text", text );
if( mnemonic != null )
defaults.put( baseKey + "Mnemonic", mnemonic );
} else
defaults.put( key, value );
}
} catch( MissingResourceException ex ) {
LoggingFacade.INSTANCE.logSevere( null, ex );
}
}
private void initFonts( UIDefaults defaults ) {
FontUIResource uiFont = null;
@@ -886,6 +939,139 @@ public abstract class FlatLaf
return super.hashCode();
}
/**
* Registers a UI defaults getter function that is invoked before the standard getter.
* This allows using different UI defaults for special purposes
* (e.g. using multiple themes at the same time).
* <p>
* The key is passed as parameter to the function.
* If the function returns {@code null}, then the next registered function is invoked.
* If all registered functions return {@code null}, then the current look and feel is asked.
* If the function returns {@link #NULL_VALUE}, then the UI value becomes {@code null}.
*
* @see #unregisterUIDefaultsGetter(Function)
* @see #runWithUIDefaultsGetter(Function, Runnable)
* @since 1.6
*/
public void registerUIDefaultsGetter( Function<Object, Object> uiDefaultsGetter ) {
if( uiDefaultsGetters == null )
uiDefaultsGetters = new ArrayList<>();
uiDefaultsGetters.remove( uiDefaultsGetter );
uiDefaultsGetters.add( uiDefaultsGetter );
// disable shared UIs
FlatUIUtils.setUseSharedUIs( false );
}
/**
* Unregisters a UI defaults getter function that was invoked before the standard getter.
*
* @see #registerUIDefaultsGetter(Function)
* @see #runWithUIDefaultsGetter(Function, Runnable)
* @since 1.6
*/
public void unregisterUIDefaultsGetter( Function<Object, Object> uiDefaultsGetter ) {
if( uiDefaultsGetters == null )
return;
uiDefaultsGetters.remove( uiDefaultsGetter );
// enable shared UIs
if( uiDefaultsGetters.isEmpty() )
FlatUIUtils.setUseSharedUIs( true );
}
/**
* Registers a UI defaults getter function that is invoked before the standard getter,
* runs the given runnable and unregisters the UI defaults getter function again.
* This allows using different UI defaults for special purposes
* (e.g. using multiple themes at the same time).
* If the current look and feel is not FlatLaf, then the getter is ignored and
* the given runnable invoked.
* <p>
* The key is passed as parameter to the function.
* If the function returns {@code null}, then the next registered function is invoked.
* If all registered functions return {@code null}, then the current look and feel is asked.
* If the function returns {@link #NULL_VALUE}, then the UI value becomes {@code null}.
* <p>
* Example:
* <pre>{@code
* // create secondary theme
* UIDefaults darkDefaults = new FlatDarkLaf().getDefaults();
*
* // create panel using secondary theme
* FlatLaf.runWithUIDefaultsGetter( key -> {
* Object value = darkDefaults.get( key );
* return (value != null) ? value : FlatLaf.NULL_VALUE;
* }, () -> {
* // TODO create components that should use secondary theme here
* } );
* }</pre>
*
* @see #registerUIDefaultsGetter(Function)
* @see #unregisterUIDefaultsGetter(Function)
* @since 1.6
*/
public static void runWithUIDefaultsGetter( Function<Object, Object> uiDefaultsGetter, Runnable runnable ) {
LookAndFeel laf = UIManager.getLookAndFeel();
if( laf instanceof FlatLaf ) {
((FlatLaf)laf).registerUIDefaultsGetter( uiDefaultsGetter );
try {
runnable.run();
} finally {
((FlatLaf)laf).unregisterUIDefaultsGetter( uiDefaultsGetter );
}
} else
runnable.run();
}
/**
* Special value returned by functions used in {@link #runWithUIDefaultsGetter(Function, Runnable)}
* or {@link #registerUIDefaultsGetter(Function)} to indicate that the UI value should
* become {@code null}.
*
* @see #runWithUIDefaultsGetter(Function, Runnable)
* @see #registerUIDefaultsGetter(Function)
* @since 1.6
*/
public static final Object NULL_VALUE = new Object();
//---- class FlatUIDefaults -----------------------------------------------
private class FlatUIDefaults
extends UIDefaults
{
FlatUIDefaults( int initialCapacity, float loadFactor ) {
super( initialCapacity, loadFactor );
}
@Override
public Object get( Object key ) {
Object value = getValue( key );
return (value != null) ? (value != NULL_VALUE ? value : null) : super.get( key );
}
@Override
public Object get( Object key, Locale l ) {
Object value = getValue( key );
return (value != null) ? (value != NULL_VALUE ? value : null) : super.get( key, l );
}
private Object getValue( Object key ) {
if( uiDefaultsGetters == null )
return null;
for( int i = uiDefaultsGetters.size() - 1; i >= 0; i-- ) {
Object value = uiDefaultsGetters.get( i ).apply( key );
if( value != null )
return value;
}
return null;
}
}
//---- class ActiveFont ---------------------------------------------------
private static class ActiveFont

View File

@@ -605,6 +605,13 @@ class UIDefaultsLoader
case "fadeout": return parseColorHSLIncreaseDecrease( 3, false, params, resolver, reportError );
case "fade": return parseColorFade( params, resolver, reportError );
case "spin": return parseColorSpin( params, resolver, reportError );
case "changeHue": return parseColorChange( 0, params, resolver, reportError );
case "changeSaturation":return parseColorChange( 1, params, resolver, reportError );
case "changeLightness": return parseColorChange( 2, params, resolver, reportError );
case "changeAlpha": return parseColorChange( 3, params, resolver, reportError );
case "mix": return parseColorMix( null, params, resolver, reportError );
case "tint": return parseColorMix( "#fff", params, resolver, reportError );
case "shade": return parseColorMix( "#000", params, resolver, reportError );
}
} finally {
parseColorDepth--;
@@ -754,6 +761,68 @@ class UIDefaultsLoader
return parseFunctionBaseColor( colorStr, function, derived, resolver, reportError );
}
/**
* Syntax: changeHue(color,value[,options]) or
* changeSaturation(color,value[,options]) or
* changeLightness(color,value[,options]) or
* changeAlpha(color,value[,options])
* - color: a color (e.g. #f00) or a color function
* - value: for hue: number of degrees; otherwise: percentage 0-100%
* - options: [derived]
*/
private static Object parseColorChange( int hslIndex,
List<String> params, Function<String, String> resolver, boolean reportError )
{
String colorStr = params.get( 0 );
int value = (hslIndex == 0)
? parseInteger( params.get( 1 ), true )
: parsePercentage( params.get( 1 ) );
boolean derived = false;
if( params.size() > 2 ) {
String options = params.get( 2 );
derived = options.contains( "derived" );
}
// create function
ColorFunction function = new ColorFunctions.HSLChange( hslIndex, value );
// parse base color, apply function and create derived color
return parseFunctionBaseColor( colorStr, function, derived, resolver, reportError );
}
/**
* Syntax: mix(color1,color2[,weight]) or
* tint(color[,weight]) or
* shade(color[,weight])
* - color1: a color (e.g. #f00) or a color function
* - color2: a color (e.g. #f00) or a color function
* - weight: the weight (in range 0-100%) to mix the two colors
* larger weight uses more of first color, smaller weight more of second color
*/
private static Object parseColorMix( String color1Str, List<String> params, Function<String, String> resolver, boolean reportError ) {
int i = 0;
if( color1Str == null )
color1Str = params.get( i++ );
String color2Str = params.get( i++ );
int weight = 50;
if( params.size() > i )
weight = parsePercentage( params.get( i++ ) );
// parse second color
String resolvedColor2Str = resolver.apply( color2Str );
ColorUIResource color2 = (ColorUIResource) parseColorOrFunction( resolvedColor2Str, resolver, reportError );
if( color2 == null )
return null;
// create function
ColorFunction function = new ColorFunctions.Mix( color2, weight );
// parse first color, apply function and create mixed color
return parseFunctionBaseColor( color1Str, function, false, resolver, reportError );
}
private static Object parseFunctionBaseColor( String colorStr, ColorFunction function,
boolean derived, Function<String, String> resolver, boolean reportError )
{

View File

@@ -0,0 +1,85 @@
/*
* Copyright 2021 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
*
* https://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.icons;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics2D;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.Path2D;
import javax.swing.AbstractButton;
import javax.swing.ButtonModel;
import javax.swing.UIManager;
import com.formdev.flatlaf.ui.FlatUIUtils;
/**
* "clear" icon for search fields.
*
* @uiDefault SearchField.clearIconColor Color
* @uiDefault SearchField.clearIconHoverColor Color
* @uiDefault SearchField.clearIconPressedColor Color
*
* @author Karl Tauber
* @since 1.5
*/
public class FlatClearIcon
extends FlatAbstractIcon
{
protected Color clearIconColor = UIManager.getColor( "SearchField.clearIconColor" );
protected Color clearIconHoverColor = UIManager.getColor( "SearchField.clearIconHoverColor" );
protected Color clearIconPressedColor = UIManager.getColor( "SearchField.clearIconPressedColor" );
public FlatClearIcon() {
super( 16, 16, null );
}
@Override
protected void paintIcon( Component c, Graphics2D g ) {
if( c instanceof AbstractButton ) {
ButtonModel model = ((AbstractButton)c).getModel();
if( model.isPressed() || model.isRollover() ) {
/*
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#7F8B91" fill-opacity=".5" fill-rule="evenodd" d="M8,1.75 C11.4517797,1.75 14.25,4.54822031 14.25,8 C14.25,11.4517797 11.4517797,14.25 8,14.25 C4.54822031,14.25 1.75,11.4517797 1.75,8 C1.75,4.54822031 4.54822031,1.75 8,1.75 Z M10.5,4.5 L8,7 L5.5,4.5 L4.5,5.5 L7,8 L4.5,10.5 L5.5,11.5 L8,9 L10.5,11.5 L11.5,10.5 L9,8 L11.5,5.5 L10.5,4.5 Z"/>
</svg>
*/
// paint filled circle with cross
g.setColor( model.isPressed() ? clearIconPressedColor : clearIconHoverColor );
Path2D path = new Path2D.Float( Path2D.WIND_EVEN_ODD );
path.append( new Ellipse2D.Float( 1.75f, 1.75f, 12.5f, 12.5f ), false );
path.append( FlatUIUtils.createPath( 4.5,5.5, 5.5,4.5, 8,7, 10.5,4.5, 11.5,5.5, 9,8, 11.5,10.5, 10.5,11.5, 8,9, 5.5,11.5, 4.5,10.5, 7,8 ), false );
g.fill( path );
return;
}
}
/*
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="none" stroke="#7F8B91" stroke-linecap="square" stroke-opacity=".5" d="M5,5 L11,11 M5,11 L11,5"/>
</svg>
*/
// paint cross
g.setColor( clearIconColor );
Path2D path = new Path2D.Float( Path2D.WIND_EVEN_ODD );
path.append( new Line2D.Float( 5,5, 11,11 ), false );
path.append( new Line2D.Float( 5,11, 11,5 ), false );
g.draw( path );
}
}

View File

@@ -0,0 +1,69 @@
/*
* Copyright 2021 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
*
* https://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.icons;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics2D;
import java.awt.geom.Area;
import java.awt.geom.Ellipse2D;
import javax.swing.UIManager;
import com.formdev.flatlaf.ui.FlatButtonUI;
import com.formdev.flatlaf.ui.FlatUIUtils;
/**
* "search" icon for search fields.
*
* @uiDefault SearchField.searchIconColor Color
* @uiDefault SearchField.searchIconHoverColor Color
* @uiDefault SearchField.searchIconPressedColor Color
*
* @author Karl Tauber
* @since 1.5
*/
public class FlatSearchIcon
extends FlatAbstractIcon
{
protected Color searchIconColor = UIManager.getColor( "SearchField.searchIconColor" );
protected Color searchIconHoverColor = UIManager.getColor( "SearchField.searchIconHoverColor" );
protected Color searchIconPressedColor = UIManager.getColor( "SearchField.searchIconPressedColor" );
public FlatSearchIcon() {
super( 16, 16, null );
}
@Override
protected void paintIcon( Component c, Graphics2D g ) {
/*
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-opacity=".9" fill-rule="evenodd">
<polygon fill="#7F8B91" points="10.813 9.75 14 12.938 12.938 14 9.75 10.813"/>
<path fill="#7F8B91" d="M7,2 C9.76142375,2 12,4.23857625 12,7 C12,9.76142375 9.76142375,12 7,12 C4.23857625,12 2,9.76142375 2,7 C2,4.23857625 4.23857625,2 7,2 Z M7,3 C4.790861,3 3,4.790861 3,7 C3,9.209139 4.790861,11 7,11 C9.209139,11 11,9.209139 11,7 C11,4.790861 9.209139,3 7,3 Z"/>
</g>
</svg>
*/
g.setColor( FlatButtonUI.buttonStateColor( c, searchIconColor, searchIconColor,
null, searchIconHoverColor, searchIconPressedColor ) );
// paint magnifier
Area area = new Area( new Ellipse2D.Float( 2, 2, 10, 10 ) );
area.subtract( new Area( new Ellipse2D.Float( 3, 3, 8, 8 ) ) );
area.add( new Area( FlatUIUtils.createPath( 10.813,9.75, 14,12.938, 12.938,14, 9.75,10.813 ) ) );
g.fill( area );
}
}

View File

@@ -0,0 +1,55 @@
/*
* Copyright 2021 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
*
* https://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.icons;
import java.awt.Component;
import java.awt.Graphics2D;
import com.formdev.flatlaf.ui.FlatUIUtils;
/**
* "search with history" icon for search fields.
*
* @author Karl Tauber
* @since 1.5
*/
public class FlatSearchWithHistoryIcon
extends FlatSearchIcon
{
public FlatSearchWithHistoryIcon() {
}
@Override
protected void paintIcon( Component c, Graphics2D g ) {
/*
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-opacity=".9" fill-rule="evenodd">
<polygon fill="#7F8B91" points="8.813 9.75 12 12.938 10.938 14 7.75 10.813"/>
<path fill="#7F8B91" d="M5,2 C7.76142375,2 10,4.23857625 10,7 C10,9.76142375 7.76142375,12 5,12 C2.23857625,12 0,9.76142375 0,7 C0,4.23857625 2.23857625,2 5,2 Z M5,3 C2.790861,3 1,4.790861 1,7 C1,9.209139 2.790861,11 5,11 C7.209139,11 9,9.209139 9,7 C9,4.790861 7.209139,3 5,3 Z"/>
<polygon fill="#7F8B91" points="11 7 16 7 13.5 10"/>
</g>
</svg>
*/
// paint magnifier
g.translate( -2, 0 );
super.paintIcon( c, g );
g.translate( 2, 0 );
// paint history arrow
g.fill( FlatUIUtils.createPath( 11,7, 16,7, 13.5,10 ) );
}
}

View File

@@ -31,6 +31,7 @@ import java.awt.Rectangle;
import java.awt.geom.RoundRectangle2D;
import java.beans.PropertyChangeEvent;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.swing.AbstractButton;
import javax.swing.ButtonModel;
@@ -137,6 +138,7 @@ public class FlatButtonUI
@Styleable(dot=true) protected Color toolbarSelectedBackground;
private Icon helpButtonIcon;
private Insets defaultMargin;
private final boolean shared;
private boolean helpButtonIconShared = true;
@@ -204,8 +206,9 @@ public class FlatButtonUI
toolbarSelectedBackground = UIManager.getColor( prefix + "toolbar.selectedBackground" );
helpButtonIcon = UIManager.getIcon( "HelpButton.icon" );
helpButtonIconShared = true;
defaultMargin = UIManager.getInsets( prefix + "margin" );
helpButtonIconShared = true;
defaults_initialized = true;
}
@@ -581,7 +584,9 @@ public class FlatButtonUI
} else if( isIconOnlyOrSingleCharacter && ((AbstractButton)c).getIcon() == null ) {
// make single-character-no-icon button square (increase width)
prefSize.width = Math.max( prefSize.width, prefSize.height );
} else if( !isIconOnlyOrSingleCharacter && !isToolBarButton( c ) && c.getBorder() instanceof FlatButtonBorder ) {
} else if( !isIconOnlyOrSingleCharacter && !isToolBarButton( c ) &&
c.getBorder() instanceof FlatButtonBorder && hasDefaultMargins( c ) )
{
// apply minimum width/height
int fw = Math.round( FlatUIUtils.getBorderFocusWidth( c ) * 2 );
prefSize.width = Math.max( prefSize.width, scale( FlatUIUtils.minimumWidth( c, minimumWidth ) ) + fw );
@@ -591,6 +596,11 @@ public class FlatButtonUI
return prefSize;
}
private boolean hasDefaultMargins( JComponent c ) {
Insets margin = ((AbstractButton)c).getMargin();
return margin instanceof UIResource && Objects.equals( margin, defaultMargin );
}
//---- class FlatButtonListener -------------------------------------------
protected class FlatButtonListener

View File

@@ -23,6 +23,7 @@ import java.awt.Component;
import java.awt.ComponentOrientation;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
@@ -280,8 +281,12 @@ public class FlatComboBoxUI
super.layoutContainer( parent );
if( arrowButton != null ) {
// limit button width to height of a raw combobox (without insets)
FontMetrics fm = comboBox.getFontMetrics( comboBox.getFont() );
int maxButtonWidth = fm.getHeight() + scale( padding.top ) + scale( padding.bottom );
Insets insets = getInsets();
int buttonWidth = parent.getPreferredSize().height - insets.top - insets.bottom;
int buttonWidth = Math.min( parent.getPreferredSize().height - insets.top - insets.bottom, maxButtonWidth );
if( buttonWidth != arrowButton.getWidth() ) {
// set width of arrow button to preferred height of combobox
int xOffset = comboBox.getComponentOrientation().isLeftToRight()

View File

@@ -21,6 +21,7 @@ import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.event.FocusListener;
import java.beans.PropertyChangeEvent;
import java.util.Map;
@@ -76,6 +77,8 @@ public class FlatEditorPaneUI
private Color oldDisabledBackground;
private Color oldInactiveBackground;
private Insets defaultMargin;
private Object oldHonorDisplayProperties;
private FocusListener focusListener;
private Map<String, Object> oldStyleValues;
@@ -103,6 +106,8 @@ public class FlatEditorPaneUI
inactiveBackground = UIManager.getColor( prefix + ".inactiveBackground" );
focusedBackground = UIManager.getColor( prefix + ".focusedBackground" );
defaultMargin = UIManager.getInsets( prefix + ".margin" );
// use component font and foreground for HTML text
oldHonorDisplayProperties = getComponent().getClientProperty( JEditorPane.HONOR_DISPLAY_PROPERTIES );
getComponent().putClientProperty( JEditorPane.HONOR_DISPLAY_PROPERTIES, true );
@@ -202,15 +207,19 @@ public class FlatEditorPaneUI
@Override
public Dimension getPreferredSize( JComponent c ) {
return applyMinimumWidth( c, super.getPreferredSize( c ), minimumWidth );
return applyMinimumWidth( c, super.getPreferredSize( c ), minimumWidth, defaultMargin );
}
@Override
public Dimension getMinimumSize( JComponent c ) {
return applyMinimumWidth( c, super.getMinimumSize( c ), minimumWidth );
return applyMinimumWidth( c, super.getMinimumSize( c ), minimumWidth, defaultMargin );
}
static Dimension applyMinimumWidth( JComponent c, Dimension size, int minimumWidth ) {
static Dimension applyMinimumWidth( JComponent c, Dimension size, int minimumWidth, Insets defaultMargin ) {
// do not apply minimum width if JTextComponent.margin is set
if( !FlatTextFieldUI.hasDefaultMargins( c, defaultMargin ) )
return size;
// Assume that text area is in a scroll pane (that displays the border)
// and subtract 1px border line width.
// Using "(scale( 1 ) * 2)" instead of "scale( 2 )" to deal with rounding

View File

@@ -21,6 +21,7 @@ import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.LayoutManager;
import java.awt.Rectangle;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.BorderFactory;
@@ -146,6 +147,19 @@ public class FlatInternalFrameTitlePane
closeButton.setVisible( frame.isClosable() );
}
Rectangle getFrameIconBounds() {
Icon icon = titleLabel.getIcon();
if( icon == null )
return null;
int iconWidth = icon.getIconWidth();
int iconHeight = icon.getIconHeight();
boolean leftToRight = titleLabel.getComponentOrientation().isLeftToRight();
int x = titleLabel.getX() + (leftToRight ? 0 : (titleLabel.getWidth() - iconWidth));
int y = titleLabel.getY() + ((titleLabel.getHeight() - iconHeight) / 2);
return new Rectangle( x, y, iconWidth, iconHeight );
}
/**
* Does nothing because FlatLaf internal frames do not have system menus.
*/

View File

@@ -22,6 +22,8 @@ import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeListener;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -30,6 +32,7 @@ import javax.swing.JComponent;
import javax.swing.JInternalFrame;
import javax.swing.LookAndFeel;
import javax.swing.UIManager;
import javax.swing.event.MouseInputAdapter;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicInternalFrameUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable;
@@ -138,6 +141,11 @@ public class FlatInternalFrameUI
return new FlatWindowResizer.InternalFrameResizer( frame, this::getDesktopManager );
}
@Override
protected MouseInputAdapter createBorderListener( JInternalFrame w ) {
return new FlatBorderListener();
}
@Override
protected PropertyChangeListener createPropertyChangeListener() {
return FlatStyleSupport.createPropertyChangeListener( frame, this::applyStyle,
@@ -272,4 +280,26 @@ public class FlatInternalFrameUI
}
}
}
//---- class FlatBorderListener -------------------------------------------
protected class FlatBorderListener
extends BorderListener
{
@Override
public void mouseClicked( MouseEvent e ) {
if( e.getClickCount() == 2 && !frame.isIcon() &&
e.getSource() instanceof FlatInternalFrameTitlePane )
{
Rectangle iconBounds = ((FlatInternalFrameTitlePane)e.getSource()).getFrameIconBounds();
if( iconBounds != null && iconBounds.contains( e.getX(), e.getY() ) ) {
if( frame.isClosable() )
frame.doDefaultCloseAction();
return;
}
}
super.mouseClicked( e );
}
}
}

View File

@@ -91,6 +91,7 @@ public class FlatOptionPaneUI
protected int messagePadding;
protected int maxCharactersPerLine;
private int focusWidth;
private boolean sameSizeButtons;
public static ComponentUI createUI( JComponent c ) {
return new FlatOptionPaneUI();
@@ -104,6 +105,7 @@ public class FlatOptionPaneUI
messagePadding = UIManager.getInt( "OptionPane.messagePadding" );
maxCharactersPerLine = UIManager.getInt( "OptionPane.maxCharactersPerLine" );
focusWidth = UIManager.getInt( "Component.focusWidth" );
sameSizeButtons = FlatUIUtils.getUIBoolean( "OptionPane.sameSizeButtons", true );
}
@Override
@@ -217,6 +219,11 @@ public class FlatOptionPaneUI
return null;
}
@Override
protected boolean getSizeButtonsToSameWidth() {
return sameSizeButtons;
}
//---- class NonUIResourceBorder ------------------------------------------
private static class NonUIResourceBorder

View File

@@ -489,6 +489,9 @@ public class FlatPopupFactory
JLayeredPane layeredPane = ((RootPaneContainer)window).getLayeredPane();
layeredPane.add( dropShadowPanel, JLayeredPane.POPUP_LAYER, 0 );
moveMediumWeightDropShadow();
resizeMediumWeightDropShadow();
mediumPanelListener = new ComponentListener() {
@Override
public void componentShown( ComponentEvent e ) {
@@ -504,17 +507,12 @@ public class FlatPopupFactory
@Override
public void componentMoved( ComponentEvent e ) {
if( dropShadowPanel != null && mediumWeightPanel != null ) {
Point location = mediumWeightPanel.getLocation();
Insets insets = dropShadowPanel.getInsets();
dropShadowPanel.setLocation( location.x - insets.left, location.y - insets.top );
}
moveMediumWeightDropShadow();
}
@Override
public void componentResized( ComponentEvent e ) {
if( dropShadowPanel != null )
dropShadowPanel.setSize( FlatUIUtils.addInsets( mediumWeightPanel.getSize(), dropShadowPanel.getInsets() ) );
resizeMediumWeightDropShadow();
}
};
mediumWeightPanel.addComponentListener( mediumPanelListener );
@@ -530,5 +528,18 @@ public class FlatPopupFactory
parent.repaint( bounds.x, bounds.y, bounds.width, bounds.height );
}
}
private void moveMediumWeightDropShadow() {
if( dropShadowPanel != null && mediumWeightPanel != null ) {
Point location = mediumWeightPanel.getLocation();
Insets insets = dropShadowPanel.getInsets();
dropShadowPanel.setLocation( location.x - insets.left, location.y - insets.top );
}
}
private void resizeMediumWeightDropShadow() {
if( dropShadowPanel != null && mediumWeightPanel != null )
dropShadowPanel.setSize( FlatUIUtils.addInsets( mediumWeightPanel.getSize(), dropShadowPanel.getInsets() ) );
}
}
}

View File

@@ -27,9 +27,11 @@ import java.awt.Insets;
import java.awt.LayoutManager;
import java.awt.LayoutManager2;
import java.awt.Window;
import java.awt.event.HierarchyEvent;
import java.awt.event.HierarchyListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.function.Function;
import javax.swing.JComponent;
import javax.swing.JDialog;
@@ -38,6 +40,7 @@ import javax.swing.JLayeredPane;
import javax.swing.JMenuBar;
import javax.swing.JRootPane;
import javax.swing.LookAndFeel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.plaf.BorderUIResource;
@@ -81,7 +84,8 @@ public class FlatRootPaneUI
private Object nativeWindowBorderData;
private LayoutManager oldLayout;
private HierarchyListener hierarchyListener;
private PropertyChangeListener ancestorListener;
private ComponentListener componentListener;
public static ComponentUI createUI( JComponent c ) {
return new FlatRootPaneUI();
@@ -149,16 +153,32 @@ public class FlatRootPaneUI
// This is very disturbing in dark themes, but hard to notice in light themes.
// Seems to be a rounding issue when Swing adds dirty region of window
// using RepaintManager.nativeAddDirtyRegion().
hierarchyListener = e -> {
if( (e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0 &&
rootPane.getParent() instanceof Window )
{
// add whole root pane to dirty regions when window is initially shown
rootPane.getParent().repaint( rootPane.getX(), rootPane.getY(),
rootPane.getWidth(), rootPane.getHeight() );
//
// Note: Not using a HierarchyListener here, which would be much easier,
// because this causes problems with mouse clicks in heavy-weight popups.
// Instead, add a listener to the root pane that waits until it is added
// to a window, then add a component listener to the window.
// See: https://github.com/JFormDesigner/FlatLaf/issues/371
ancestorListener = e -> {
Object oldValue = e.getOldValue();
Object newValue = e.getNewValue();
if( newValue instanceof Window ) {
if( componentListener == null ) {
componentListener = new ComponentAdapter() {
@Override
public void componentShown( ComponentEvent e ) {
// add whole root pane to dirty regions when window is initially shown
root.getParent().repaint( root.getX(), root.getY(), root.getWidth(), root.getHeight() );
}
};
}
((Window)newValue).addComponentListener( componentListener );
} else if( newValue == null && oldValue instanceof Window ) {
if( componentListener != null )
((Window)oldValue).removeComponentListener( componentListener );
}
};
root.addHierarchyListener( hierarchyListener );
root.addPropertyChangeListener( "ancestor", ancestorListener );
}
}
@@ -167,8 +187,14 @@ public class FlatRootPaneUI
super.uninstallListeners( root );
if( SystemInfo.isJava_9_orLater ) {
root.removeHierarchyListener( hierarchyListener );
hierarchyListener = null;
if( componentListener != null ) {
Window window = SwingUtilities.windowForComponent( root );
if( window != null )
window.removeComponentListener( componentListener );
componentListener = null;
}
root.removePropertyChangeListener( "ancestor", ancestorListener );
ancestorListener = null;
}
}

View File

@@ -21,6 +21,7 @@ import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
@@ -464,8 +465,12 @@ public class FlatSpinnerUI
Rectangle editorRect = new Rectangle( r );
Rectangle buttonsRect = new Rectangle( r );
// limit buttons width to height of a raw spinner (without insets)
FontMetrics fm = spinner.getFontMetrics( spinner.getFont() );
int maxButtonWidth = fm.getHeight() + scale( padding.top ) + scale( padding.bottom );
// make button area square (if spinner has preferred height)
int buttonsWidth = parent.getPreferredSize().height - insets.top - insets.bottom;
int buttonsWidth = Math.min( parent.getPreferredSize().height - insets.top - insets.bottom, maxButtonWidth );
buttonsRect.width = buttonsWidth;
if( parent.getComponentOrientation().isLeftToRight() ) {

View File

@@ -928,6 +928,17 @@ public class FlatTabbedPaneUI
paintTabArea( g, tabPlacement, selectedIndex );
}
@Override
protected void paintTabArea( Graphics g, int tabPlacement, int selectedIndex ) {
// need to set rendering hints here too because this method is also invoked
// from BasicTabbedPaneUI.ScrollableTabPanel.paintComponent()
Object[] oldHints = FlatUIUtils.setRenderingHints( g );
super.paintTabArea( g, tabPlacement, selectedIndex );
FlatUIUtils.resetRenderingHints( g, oldHints );
}
@Override
protected void paintTab( Graphics g, int tabPlacement, Rectangle[] rects,
int tabIndex, Rectangle iconRect, Rectangle textRect )

View File

@@ -173,6 +173,12 @@ public class FlatTableHeaderUI
}
}
// overridden and made public to allow usage in custom renderers
@Override
public int getRolloverColumn() {
return super.getRolloverColumn();
}
@Override
public void paint( Graphics g, JComponent c ) {
TableColumnModel columnModel = header.getColumnModel();

View File

@@ -20,6 +20,7 @@ import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.event.FocusListener;
import java.beans.PropertyChangeEvent;
import java.util.Map;
@@ -72,6 +73,8 @@ public class FlatTextAreaUI
private Color oldDisabledBackground;
private Color oldInactiveBackground;
private Insets defaultMargin;
private FocusListener focusListener;
private Map<String, Object> oldStyleValues;
@@ -96,6 +99,8 @@ public class FlatTextAreaUI
disabledBackground = UIManager.getColor( "TextArea.disabledBackground" );
inactiveBackground = UIManager.getColor( "TextArea.inactiveBackground" );
focusedBackground = UIManager.getColor( "TextArea.focusedBackground" );
defaultMargin = UIManager.getInsets( "TextArea.margin" );
}
@Override
@@ -189,7 +194,7 @@ public class FlatTextAreaUI
if( c instanceof JTextArea && ((JTextArea)c).getColumns() > 0 )
return size;
return FlatEditorPaneUI.applyMinimumWidth( c, size, minimumWidth );
return FlatEditorPaneUI.applyMinimumWidth( c, size, minimumWidth, defaultMargin );
}
@Override

View File

@@ -28,6 +28,7 @@ import java.awt.Rectangle;
import java.awt.event.FocusListener;
import java.beans.PropertyChangeEvent;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Consumer;
import javax.swing.JComboBox;
@@ -92,6 +93,8 @@ public class FlatTextFieldUI
private Color oldDisabledBackground;
private Color oldInactiveBackground;
private Insets defaultMargin;
private FocusListener focusListener;
private Map<String, Object> oldStyleValues;
private AtomicBoolean borderShared;
@@ -120,6 +123,8 @@ public class FlatTextFieldUI
placeholderForeground = UIManager.getColor( prefix + ".placeholderForeground" );
focusedBackground = UIManager.getColor( prefix + ".focusedBackground" );
defaultMargin = UIManager.getInsets( prefix + ".margin" );
LookAndFeel.installProperty( getComponent(), "opaque", false );
MigLayoutVisualPadding.install( getComponent() );
@@ -355,11 +360,15 @@ public class FlatTextFieldUI
return applyMinimumWidth( c, super.getMinimumSize( c ), minimumWidth );
}
static Dimension applyMinimumWidth( JComponent c, Dimension size, int minimumWidth ) {
private Dimension applyMinimumWidth( JComponent c, Dimension size, int minimumWidth ) {
// do not apply minimum width if JTextField.columns is set
if( c instanceof JTextField && ((JTextField)c).getColumns() > 0 )
return size;
// do not apply minimum width if JTextComponent.margin is set
if( !hasDefaultMargins( c, defaultMargin ) )
return size;
// do not apply minimum width if used in combobox or spinner
Container parent = c.getParent();
if( parent instanceof JComboBox ||
@@ -373,6 +382,11 @@ public class FlatTextFieldUI
return size;
}
static boolean hasDefaultMargins( JComponent c, Insets defaultMargin ) {
Insets margin = ((JTextComponent)c).getMargin();
return margin instanceof UIResource && Objects.equals( margin, defaultMargin );
}
@Override
protected Rectangle getVisibleEditorRect() {
Rectangle r = super.getVisibleEditorRect();

View File

@@ -20,6 +20,7 @@ import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.event.FocusListener;
import java.beans.PropertyChangeEvent;
import java.util.Map;
@@ -72,6 +73,8 @@ public class FlatTextPaneUI
private Color oldDisabledBackground;
private Color oldInactiveBackground;
private Insets defaultMargin;
private Object oldHonorDisplayProperties;
private FocusListener focusListener;
private Map<String, Object> oldStyleValues;
@@ -99,6 +102,8 @@ public class FlatTextPaneUI
inactiveBackground = UIManager.getColor( prefix + ".inactiveBackground" );
focusedBackground = UIManager.getColor( prefix + ".focusedBackground" );
defaultMargin = UIManager.getInsets( prefix + ".margin" );
// use component font and foreground for HTML text
oldHonorDisplayProperties = getComponent().getClientProperty( JEditorPane.HONOR_DISPLAY_PROPERTIES );
getComponent().putClientProperty( JEditorPane.HONOR_DISPLAY_PROPERTIES, true );
@@ -184,12 +189,12 @@ public class FlatTextPaneUI
@Override
public Dimension getPreferredSize( JComponent c ) {
return FlatEditorPaneUI.applyMinimumWidth( c, super.getPreferredSize( c ), minimumWidth );
return FlatEditorPaneUI.applyMinimumWidth( c, super.getPreferredSize( c ), minimumWidth, defaultMargin );
}
@Override
public Dimension getMinimumSize( JComponent c ) {
return FlatEditorPaneUI.applyMinimumWidth( c, super.getMinimumSize( c ), minimumWidth );
return FlatEditorPaneUI.applyMinimumWidth( c, super.getMinimumSize( c ), minimumWidth, defaultMargin );
}
@Override

View File

@@ -289,6 +289,26 @@ public class FlatTreeUI
tree.repaint( 0, r.y, tree.getWidth(), r.height );
}
@Override
public Rectangle getPathBounds( JTree tree, TreePath path ) {
Rectangle bounds = super.getPathBounds( tree, path );
// If this method was invoked from JTree.getPathForLocation(int x, int y) to check whether
// the location is within tree node bounds, then return the bounds of a wide node.
// This changes the behavior of JTree.getPathForLocation(int x, int y) and
// JTree.getRowForLocation(int x, int y), which now return the path/row even
// if [x,y] is in the wide row area outside of the actual tree node.
if( bounds != null &&
isWideSelection() &&
UIManager.getBoolean( "FlatLaf.experimental.tree.widePathForLocation" ) &&
StackUtils.wasInvokedFrom( JTree.class.getName(), "getPathForLocation", 5 ) )
{
bounds.x = 0;
bounds.width = tree.getWidth();
}
return bounds;
}
/**
* @since TODO
*/

View File

@@ -69,6 +69,7 @@ public class FlatUIUtils
{
public static final boolean MAC_USE_QUARTZ = Boolean.getBoolean( "apple.awt.graphics.UseQuartz" );
private static boolean useSharedUIs = true;
private static WeakHashMap<LookAndFeel, IdentityHashMap<Object, ComponentUI>> sharedUIinstances = new WeakHashMap<>();
public static Rectangle addInsets( Rectangle r, Insets insets ) {
@@ -825,6 +826,27 @@ debug*/
return explicitlySet;
}
/**
* Returns whether shared UI delegates are used.
*
* @since 1.6
*/
public static boolean isUseSharedUIs() {
return useSharedUIs;
}
/**
* Specifies whether shared UI delegates are used.
* This does not change already existing UI delegates.
*
* @since 1.6
*/
public static boolean setUseSharedUIs( boolean useSharedUIs ) {
boolean old = FlatUIUtils.useSharedUIs;
FlatUIUtils.useSharedUIs = useSharedUIs;
return old;
}
/**
* Creates a shared component UI for the given key and the current Laf.
* Each Laf instance has its own shared component UI instance.
@@ -833,6 +855,9 @@ debug*/
* may use multiple Laf instances at the same time.
*/
public static ComponentUI createSharedUI( Object key, Supplier<ComponentUI> newInstanceSupplier ) {
if( !useSharedUIs )
return newInstanceSupplier.get();
return sharedUIinstances
.computeIfAbsent( UIManager.getLookAndFeel(), k -> new IdentityHashMap<>() )
.computeIfAbsent( key, k -> newInstanceSupplier.get() );

View File

@@ -181,8 +181,12 @@ public abstract class FlatWindowResizer
protected abstract boolean isWindowResizable();
protected abstract Rectangle getWindowBounds();
protected abstract void setWindowBounds( Rectangle r );
protected abstract boolean limitToParentBounds();
protected abstract Rectangle getParentBounds();
protected abstract boolean honorMinimumSizeOnResize();
protected abstract boolean honorMaximumSizeOnResize();
protected abstract Dimension getWindowMinimumSize();
protected abstract Dimension getWindowMaximumSize();
protected void beginResizing( int direction ) {}
protected void endResizing() {}
@@ -283,6 +287,16 @@ public abstract class FlatWindowResizer
}
}
@Override
protected boolean limitToParentBounds() {
return false;
}
@Override
protected Rectangle getParentBounds() {
return null;
}
@Override
protected boolean honorMinimumSizeOnResize() {
return
@@ -290,11 +304,21 @@ public abstract class FlatWindowResizer
(honorDialogMinimumSizeOnResize && window instanceof Dialog);
}
@Override
protected boolean honorMaximumSizeOnResize() {
return false;
}
@Override
protected Dimension getWindowMinimumSize() {
return window.getMinimumSize();
}
@Override
protected Dimension getWindowMaximumSize() {
return window.getMaximumSize();
}
@Override
boolean isDialog() {
return window instanceof Dialog;
@@ -354,16 +378,36 @@ public abstract class FlatWindowResizer
desktopManager.get().resizeFrame( getFrame(), r.x, r.y, r.width, r.height );
}
@Override
protected boolean limitToParentBounds() {
return true;
}
@Override
protected Rectangle getParentBounds() {
return getFrame().getParent().getBounds();
}
@Override
protected boolean honorMinimumSizeOnResize() {
return true;
}
@Override
protected boolean honorMaximumSizeOnResize() {
return true;
}
@Override
protected Dimension getWindowMinimumSize() {
return getFrame().getMinimumSize();
}
@Override
protected Dimension getWindowMaximumSize() {
return getFrame().getMaximumSize();
}
@Override
protected void beginResizing( int direction ) {
desktopManager.get().beginResizingFrame( getFrame(), direction );
@@ -521,7 +565,7 @@ debug*/
int xOnScreen = e.getXOnScreen();
int yOnScreen = e.getYOnScreen();
// Get current window bounds and compute new bounds based them.
// Get current window bounds and compute new bounds based on them.
// This is necessary because window manager may alter window bounds while resizing.
// E.g. when having two monitors with different scale factors and resizing
// a window on first screen to the second screen, then the window manager may
@@ -535,41 +579,72 @@ debug*/
// top
if( resizeDir == N_RESIZE_CURSOR || resizeDir == NW_RESIZE_CURSOR || resizeDir == NE_RESIZE_CURSOR ) {
newBounds.y = yOnScreen - dragTopOffset;
if( limitToParentBounds() && newBounds.y < 0 )
newBounds.y = 0;
newBounds.height += (oldBounds.y - newBounds.y);
}
// bottom
if( resizeDir == S_RESIZE_CURSOR || resizeDir == SW_RESIZE_CURSOR || resizeDir == SE_RESIZE_CURSOR )
if( resizeDir == S_RESIZE_CURSOR || resizeDir == SW_RESIZE_CURSOR || resizeDir == SE_RESIZE_CURSOR ) {
newBounds.height = (yOnScreen + dragBottomOffset) - newBounds.y;
if( limitToParentBounds() ) {
int parentHeight = getParentBounds().height;
if( newBounds.y + newBounds.height > parentHeight )
newBounds.height = parentHeight - newBounds.y;
}
}
// left
if( resizeDir == W_RESIZE_CURSOR || resizeDir == NW_RESIZE_CURSOR || resizeDir == SW_RESIZE_CURSOR ) {
newBounds.x = xOnScreen - dragLeftOffset;
if( limitToParentBounds() && newBounds.x < 0 )
newBounds.x = 0;
newBounds.width += (oldBounds.x - newBounds.x);
}
// right
if( resizeDir == E_RESIZE_CURSOR || resizeDir == NE_RESIZE_CURSOR || resizeDir == SE_RESIZE_CURSOR )
if( resizeDir == E_RESIZE_CURSOR || resizeDir == NE_RESIZE_CURSOR || resizeDir == SE_RESIZE_CURSOR ) {
newBounds.width = (xOnScreen + dragRightOffset) - newBounds.x;
if( limitToParentBounds() ) {
int parentWidth = getParentBounds().width;
if( newBounds.x + newBounds.width > parentWidth )
newBounds.width = parentWidth - newBounds.x;
}
}
// apply minimum window size
Dimension minimumSize = honorMinimumSizeOnResize() ? getWindowMinimumSize() : null;
if( minimumSize == null )
minimumSize = UIScale.scale( new Dimension( 150, 50 ) );
if( newBounds.width < minimumSize.width ) {
if( newBounds.x != oldBounds.x )
newBounds.x -= (minimumSize.width - newBounds.width);
newBounds.width = minimumSize.width;
}
if( newBounds.height < minimumSize.height ) {
if( newBounds.y != oldBounds.y )
newBounds.y -= (minimumSize.height - newBounds.height);
newBounds.height = minimumSize.height;
if( newBounds.width < minimumSize.width )
changeWidth( oldBounds, newBounds, minimumSize.width );
if( newBounds.height < minimumSize.height )
changeHeight( oldBounds, newBounds, minimumSize.height );
// apply maximum window size
if( honorMaximumSizeOnResize() ) {
Dimension maximumSize = getWindowMaximumSize();
if( newBounds.width > maximumSize.width )
changeWidth( oldBounds, newBounds, maximumSize.width );
if( newBounds.height > maximumSize.height )
changeHeight( oldBounds, newBounds, maximumSize.height );
}
// set window bounds
if( !newBounds.equals( oldBounds ) )
setWindowBounds( newBounds );
}
private void changeWidth( Rectangle oldBounds, Rectangle newBounds, int width ) {
if( newBounds.x != oldBounds.x )
newBounds.x -= (width - newBounds.width);
newBounds.width = width;
}
private void changeHeight( Rectangle oldBounds, Rectangle newBounds, int height ) {
if( newBounds.y != oldBounds.y )
newBounds.y -= (height - newBounds.height);
newBounds.height = height;
}
}
}

View File

@@ -25,6 +25,8 @@ import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Window;
import java.awt.geom.AffineTransform;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.Collections;
import java.util.IdentityHashMap;
import java.util.List;
@@ -289,6 +291,7 @@ class FlatWindowsNativeWindowBorder
//---- class WndProc ------------------------------------------------------
private class WndProc
implements PropertyChangeListener
{
// WM_NCHITTEST mouse position codes
private static final int
@@ -313,18 +316,36 @@ class FlatWindowsNativeWindowBorder
// remove the OS window title bar
updateFrame( hwnd, (window instanceof JFrame) ? ((JFrame)window).getExtendedState() : 0 );
// set window background (used when resizing window)
updateWindowBackground();
window.addPropertyChangeListener( "background", this );
}
void uninstall() {
window.removePropertyChangeListener( "background", this );
uninstallImpl( hwnd );
// cleanup
window = null;
}
@Override
public void propertyChange( PropertyChangeEvent e ) {
updateWindowBackground();
}
private void updateWindowBackground() {
Color bg = window.getBackground();
if( bg != null )
setWindowBackground( hwnd, bg.getRed(), bg.getGreen(), bg.getBlue() );
}
private native long installImpl( Window window );
private native void uninstallImpl( long hwnd );
private native void updateFrame( long hwnd, int state );
private native void setWindowBackground( long hwnd, int r, int g, int b );
private native void showWindow( long hwnd, int cmd );
// invoked from native code

View File

@@ -26,13 +26,16 @@ import java.awt.Color;
public class ColorFunctions
{
public static Color applyFunctions( Color color, ColorFunction... functions ) {
// convert RGB to HSL
float[] hsl = HSLColor.fromRGB( color );
float alpha = color.getAlpha() / 255f;
float[] hsla = { hsl[0], hsl[1], hsl[2], alpha * 100 };
// apply color functions
for( ColorFunction function : functions )
function.apply( hsla );
// convert HSL to RGB
return HSLColor.toRGB( hsla[0], hsla[1], hsla[2], hsla[3] / 100 );
}
@@ -145,7 +148,46 @@ public class ColorFunctions
}
}
//---- class HSLIncreaseDecrease ------------------------------------------
//---- class HSLChange ----------------------------------------------------
/**
* Set the hue, saturation, luminance or alpha of a color.
*
* @since 1.6
*/
public static class HSLChange
implements ColorFunction
{
public final int hslIndex;
public final float value;
public HSLChange( int hslIndex, float value ) {
this.hslIndex = hslIndex;
this.value = value;
}
@Override
public void apply( float[] hsla ) {
hsla[hslIndex] = (hslIndex == 0)
? value % 360
: clamp( value );
}
@Override
public String toString() {
String name;
switch( hslIndex ) {
case 0: name = "changeHue"; break;
case 1: name = "changeSaturation"; break;
case 2: name = "changeLightness"; break;
case 3: name = "changeAlpha"; break;
default: throw new IllegalArgumentException();
}
return String.format( "%s(%.0f%s)", name, value, (hslIndex == 0 ? "" : "%") );
}
}
//---- class Fade ---------------------------------------------------------
/**
* Set the alpha of a color.
@@ -169,4 +211,42 @@ public class ColorFunctions
return String.format( "fade(%.0f%%)", amount );
}
}
//---- class Mix ----------------------------------------------------------
/**
* Mix two colors.
*
* @since 1.6
*/
public static class Mix
implements ColorFunction
{
public final Color color2;
public final float weight;
public Mix( Color color2, float weight ) {
this.color2 = color2;
this.weight = weight;
}
@Override
public void apply( float[] hsla ) {
// convert from HSL to RGB because color mixing is done on RGB values
Color color1 = HSLColor.toRGB( hsla[0], hsla[1], hsla[2], hsla[3] / 100 );
// mix
Color color = mix( color1, color2, weight / 100 );
// convert RGB to HSL
float[] hsl = HSLColor.fromRGB( color );
System.arraycopy( hsl, 0, hsla, 0, hsl.length );
hsla[3] = (color.getAlpha() / 255f) * 100;
}
@Override
public String toString() {
return String.format( "mix(#%08x,%.0f%%)", color2.getRGB(), weight );
}
}
}

View File

@@ -514,6 +514,17 @@ ScrollPane.fillUpperCorner = true
ScrollPane.smoothScrolling = true
#---- SearchField ----
SearchField.searchIconColor = fadeout(Actions.GreyInline,10%,lazy)
SearchField.searchIconHoverColor = fadeout(Actions.GreyInline,30%,lazy)
SearchField.searchIconPressedColor = fadeout(Actions.GreyInline,50%,lazy)
SearchField.clearIconColor = fadeout(Actions.GreyInline,50%,lazy)
SearchField.clearIconHoverColor = $SearchField.clearIconColor
SearchField.clearIconPressedColor = fadeout(Actions.GreyInline,20%,lazy)
#---- Separator ----
Separator.height = 3

View File

@@ -1,7 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<rect width="16" height="16" fill="#6E6E6E" rx="3"/>
<rect width="6" height="2" x="5" y="12" fill="#FFF"/>
<rect width="6" height="2" x="5" y="11.5" fill="#FFF"/>
<path fill="#FFF" d="M2,8 L8,2 L14,8 L11,8 L11,10 L5,10 L5,8 L2,8 Z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 328 B

View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#7F8B91" fill-opacity=".5" fill-rule="evenodd" d="M8,1.75 C11.4517797,1.75 14.25,4.54822031 14.25,8 C14.25,11.4517797 11.4517797,14.25 8,14.25 C4.54822031,14.25 1.75,11.4517797 1.75,8 C1.75,4.54822031 4.54822031,1.75 8,1.75 Z M10.5,4.5 L8,7 L5.5,4.5 L4.5,5.5 L7,8 L4.5,10.5 L5.5,11.5 L8,9 L10.5,11.5 L11.5,10.5 L9,8 L11.5,5.5 L10.5,4.5 Z"/>
</svg>

After

Width:  |  Height:  |  Size: 446 B

View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="none" stroke="#7F8B91" stroke-linecap="square" stroke-opacity=".5" d="M5,5 L11,11 M5,11 L11,5"/>
</svg>

After

Width:  |  Height:  |  Size: 202 B

View File

@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-opacity=".9" fill-rule="evenodd">
<polygon fill="#7F8B91" points="10.813 9.75 14 12.938 12.938 14 9.75 10.813"/>
<path fill="#7F8B91" d="M7,2 C9.76142375,2 12,4.23857625 12,7 C12,9.76142375 9.76142375,12 7,12 C4.23857625,12 2,9.76142375 2,7 C2,4.23857625 4.23857625,2 7,2 Z M7,3 C4.790861,3 3,4.790861 3,7 C3,9.209139 4.790861,11 7,11 C9.209139,11 11,9.209139 11,7 C11,4.790861 9.209139,3 7,3 Z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 526 B

View File

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-opacity=".9" fill-rule="evenodd">
<polygon fill="#7F8B91" points="8.813 9.75 12 12.938 10.938 14 7.75 10.813"/>
<path fill="#7F8B91" d="M5,2 C7.76142375,2 10,4.23857625 10,7 C10,9.76142375 7.76142375,12 5,12 C2.23857625,12 0,9.76142375 0,7 C0,4.23857625 2.23857625,2 5,2 Z M5,3 C2.790861,3 1,4.790861 1,7 C1,9.209139 2.790861,11 5,11 C7.209139,11 9,9.209139 9,7 C9,4.790861 7.209139,3 5,3 Z"/>
<polygon fill="#7F8B91" points="11 7 16 7 13.5 10"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 579 B

View File

@@ -18,6 +18,10 @@ package com.formdev.flatlaf.demo;
import java.awt.*;
import java.awt.event.*;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.time.Year;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.prefs.Preferences;
@@ -34,8 +38,10 @@ import com.formdev.flatlaf.extras.FlatUIDefaultsInspector;
import com.formdev.flatlaf.extras.components.FlatButton;
import com.formdev.flatlaf.extras.components.FlatButton.ButtonType;
import com.formdev.flatlaf.extras.FlatSVGUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.ui.JBRCustomDecorations;
import com.formdev.flatlaf.util.SystemInfo;
import com.formdev.flatlaf.util.UIScale;
import net.miginfocom.layout.ConstraintParser;
import net.miginfocom.layout.LC;
import net.miginfocom.layout.UnitValue;
@@ -127,7 +133,36 @@ class DemoFrame
}
private void aboutActionPerformed() {
JOptionPane.showMessageDialog( this, "FlatLaf Demo", "About", JOptionPane.PLAIN_MESSAGE );
JLabel titleLabel = new JLabel( "FlatLaf Demo" );
Font titleFont = titleLabel.getFont();
titleLabel.setFont( titleFont.deriveFont( (float) titleFont.getSize() + UIScale.scale( 6 ) ) );
String link = "https://www.formdev.com/flatlaf/";
JLabel linkLabel = new JLabel( "<html><a href=\"#\">" + link + "</a></html>" );
linkLabel.setCursor( Cursor.getPredefinedCursor( Cursor.HAND_CURSOR ) );
linkLabel.addMouseListener( new MouseAdapter() {
@Override
public void mouseClicked( MouseEvent e ) {
try {
Desktop.getDesktop().browse( new URI( link ) );
} catch( IOException | URISyntaxException ex ) {
JOptionPane.showMessageDialog( linkLabel,
"Failed to open '" + link + "' in browser.",
"About", JOptionPane.PLAIN_MESSAGE );
}
}
} );
JOptionPane.showMessageDialog( this,
new Object[] {
titleLabel,
"Demonstrates FlatLaf Swing look and feel",
" ",
"Copyright 2019-" + Year.now() + " FormDev Software GmbH",
linkLabel,
},
"About", JOptionPane.PLAIN_MESSAGE );
}
private void selectedTabChanged() {
@@ -185,6 +220,8 @@ class DemoFrame
Font font = UIManager.getFont( "defaultFont" );
Font newFont = StyleContext.getDefaultStyleContext().getFont( fontFamily, font.getStyle(), font.getSize() );
// StyleContext.getFont() may return a UIResource, which would cause loosing user scale factor on Windows
newFont = FlatUIUtils.nonUIResource( newFont );
UIManager.put( "defaultFont", newFont );
FlatLaf.updateUI();

View File

@@ -169,14 +169,6 @@ public class IJThemesClassGenerator
" }\n" +
" }\n" +
"\n" +
" /**\n" +
" * @deprecated use {@link #setup()} instead; this method will be removed in a future version\n" +
" */\n" +
" @Deprecated\n" +
" public static boolean install() {\n" +
" return setup();\n" +
" }\n" +
"\n" +
" public static void installLafInfo() {\n" +
" installLafInfo( NAME, ${themeClass}.class );\n" +
" }\n" +

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd" transform="translate(2 2)">
<rect width="5.5" height="5.5" fill="#59A869"/>

Before

Width:  |  Height:  |  Size: 403 B

After

Width:  |  Height:  |  Size: 550 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<path fill="#6E6E6E" d="M11,3 L4,3 L4,11 L2,11 L2,1 L11,1 L11,3 Z"/>

Before

Width:  |  Height:  |  Size: 363 B

After

Width:  |  Height:  |  Size: 510 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<polygon fill="#59A869" fill-rule="evenodd" points="4 2 14 8 4 14"/>
</svg>

Before

Width:  |  Height:  |  Size: 162 B

After

Width:  |  Height:  |  Size: 309 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<rect width="6" height="1" x="5" y="12" fill="#6E6E6E"/>

Before

Width:  |  Height:  |  Size: 493 B

After

Width:  |  Height:  |  Size: 640 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<rect width="6" height="1" x="5" y="12" fill="#6E6E6E"/>

Before

Width:  |  Height:  |  Size: 493 B

After

Width:  |  Height:  |  Size: 640 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<rect width="10" height="10" x="3" y="3" fill="#DB5860" fill-rule="evenodd"/>
</svg>

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 318 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<path fill="#DB5860" fill-rule="evenodd" d="M16,30 C8.2680135,30 2,23.7319865 2,16 C2,8.2680135 8.2680135,2 16,2 C23.7319865,2 30,8.2680135 30,16 C30,23.7319865 23.7319865,30 16,30 Z M14,7 L14,18 L18,18 L18,7 L14,7 Z M14,21 L14,25 L18,25 L18,21 L14,21 Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 350 B

After

Width:  |  Height:  |  Size: 497 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<path fill="#389FD6" fill-rule="evenodd" d="M16,30 C8.2680135,30 2,23.7319865 2,16 C2,8.2680135 8.2680135,2 16,2 C23.7319865,2 30,8.2680135 30,16 C30,23.7319865 23.7319865,30 16,30 Z M14,7 L14,18 L18,18 L18,7 L14,7 Z M14,21 L14,25 L18,25 L18,21 L14,21 Z" transform="rotate(180 16 16)"/>
</svg>

Before

Width:  |  Height:  |  Size: 380 B

After

Width:  |  Height:  |  Size: 527 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
<defs>
<rect id="abstractclass-a" width="8" height="14"/>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
<defs>
<rect id="abstractmethod-a" width="8" height="14"/>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<path fill="#62B543" fill-opacity=".6" d="M15,8 C15,11.866 11.866,15 8,15 C4.134,15 1,11.866 1,8 C1,4.134 4.134,1 8,1 C11.866,1 15,4.134 15,8"/>

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -1,10 +1,17 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<polygon fill="#9AA7B0" fill-opacity=".8" points="7 1 3 5 7 5"/>
<polygon fill="#9AA7B0" fill-opacity=".8" points="8 1 8 6 3 6 3 8 13 8 13 1"/>
<polygon fill="#40B6E0" fill-opacity=".7" points="1 16 16 16 16 9 1 9"/>
<path fill="#231F20" fill-opacity=".7" d="M0,2.501 C0,1 0.931,2.02832126e-16 2.256,0 C3.20239258,0 3.55,0.311 3.969,0.753 L3.42669678,1.42712402 C3.07669678,1.06812402 2.75,1 2.25,1 C1.418,1 1,1.73791504 1,2.487 C1,3.23608496 1.412,4 2.25,4 C2.787,4 3.05169678,3.89340869 3.42669678,3.50640869 L4,4.144 C3.544,4.669 3.19732666,5 2.225,5 C0.949,5 7.35277938e-17,4.002 0,2.501 Z" transform="translate(2 10)"/>
<path fill="#231F20" fill-opacity=".7" d="M0.972767969,1.50152588 C0.972767969,1.13305664 1.284,1 1.845,1 C1.85033333,1 2.23533333,1 3,1 L3,0 C2.26266667,0 1.88266667,0 1.86,0 C0.778,0 0,0.45916748 0,1.45 C0,2.31452637 0.419555664,2.69049072 1.47125244,2.91607666 C2.24158869,3.08131157 2.496155,3.22862939 2.496155,3.548 C2.496155,3.86737061 2.13842773,4 1.47125244,4 C1.46058577,4 1.07016829,4 0.3,4 L0.3,5 C1.07550163,5 1.46591911,5 1.47125244,5 C3.5,5 3.5,4 3.5,3.548 C3.5,2.91607666 3.02026367,2.42071533 2.15869141,2.14685059 C1.29711914,1.87298584 0.972767969,1.86999512 0.972767969,1.50152588 Z" transform="translate(7 10)"/>
<path fill="#231F20" fill-opacity=".7" d="M0.972767969,1.50152588 C0.972767969,1.13305664 1.284,1 1.845,1 C1.85033333,1 2.23533333,1 3,1 L3,0 C2.26266667,0 1.88266667,0 1.86,0 C0.778,0 0,0.45916748 0,1.45 C0,2.31452637 0.419555664,2.69049072 1.47125244,2.91607666 C2.24158869,3.08131157 2.496155,3.22862939 2.496155,3.548 C2.496155,3.86737061 2.13842773,4 1.47125244,4 C1.46058577,4 1.07016829,4 0.3,4 L0.3,5 C1.07550163,5 1.46591911,5 1.47125244,5 C3.5,5 3.5,4 3.5,3.548 C3.5,2.91607666 3.02026367,2.42071533 2.15869141,2.14685059 C1.29711914,1.87298584 0.972767969,1.86999512 0.972767969,1.50152588 Z" transform="translate(11 10)"/>
</g>
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="css">
<path id="Fill 1" fill-rule="evenodd" clip-rule="evenodd" d="M7 1L3 5H7V1Z" fill="#9AA7B0" fill-opacity="0.8"/>
<path id="Fill 3" fill-rule="evenodd" clip-rule="evenodd" d="M8 1V6H3V8H13V1H8Z" fill="#9AA7B0" fill-opacity="0.8"/>
<path id="Fill 5" fill-rule="evenodd" clip-rule="evenodd" d="M1 16H16V9H1V16Z" fill="#F98B9E" fill-opacity="0.6"/>
<g id="&#226;&#140;&#152;/alphabet/C">
<path id="&#226;&#140;&#152;/alphabet/C_2" fill-rule="evenodd" clip-rule="evenodd" d="M2 12.501C2 11 2.931 10 4.256 10C5.20239 10 5.55 10.311 5.969 10.753L5.4267 11.4271C5.0767 11.0681 4.75 11 4.25 11C3.418 11 3 11.7379 3 12.487C3 13.2361 3.412 14 4.25 14C4.787 14 5.0517 13.8934 5.4267 13.5064L6 14.144C5.544 14.669 5.19733 15 4.225 15C2.949 15 2 14.002 2 12.501Z" fill="#231F20" fill-opacity="0.7"/>
</g>
<g id="&#226;&#140;&#152;/alphabet/S">
<path id="&#226;&#140;&#152;/alphabet/S_2" fill-rule="evenodd" clip-rule="evenodd" d="M7.97277 11.5015C7.97277 11.1331 8.284 11 8.845 11C8.853 11 10 11 10 11V10C10 10 8.894 10 8.86 10C7.778 10 7 10.4592 7 11.45C7 12.3145 7.41956 12.6905 8.47125 12.9161C9.24159 13.0813 9.49616 13.2286 9.49616 13.548C9.49616 13.8674 9.13843 14 8.47125 14C8.45525 14 7.3 14 7.3 14V15C7.3 15 8.46325 15 8.47125 15C10.5 15 10.5 14 10.5 13.548C10.5 12.9161 10.0203 12.4207 9.15869 12.1469C8.29712 11.873 7.97277 11.87 7.97277 11.5015Z" fill="#231F20" fill-opacity="0.7"/>
</g>
<g id="&#226;&#140;&#152;/alphabet/S_3">
<path id="&#226;&#140;&#152;/alphabet/S_4" fill-rule="evenodd" clip-rule="evenodd" d="M11.9728 11.5015C11.9728 11.1331 12.284 11 12.845 11C12.853 11 14 11 14 11V10C14 10 12.894 10 12.86 10C11.778 10 11 10.4592 11 11.45C11 12.3145 11.4196 12.6905 12.4713 12.9161C13.2416 13.0813 13.4962 13.2286 13.4962 13.548C13.4962 13.8674 13.1384 14 12.4713 14C12.4553 14 11.3 14 11.3 14V15C11.3 15 12.4633 15 12.4713 15C14.5 15 14.5 14 14.5 13.548C14.5 12.9161 14.0203 12.4207 13.1587 12.1469C12.2971 11.873 11.9728 11.87 11.9728 11.5015Z" fill="#231F20" fill-opacity="0.7"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<polygon fill="#F4AF3D" fill-opacity=".7" points="1 16 16 16 16 9 1 9"/>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<polygon fill="#F26522" fill-opacity=".7" points="1 16 16 16 16 9 1 9"/>

Before

Width:  |  Height:  |  Size: 498 B

After

Width:  |  Height:  |  Size: 645 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<path fill="#EDA200" fill-rule="evenodd" d="M16,2 L31,28 L1,28 L16,2 Z M18,25 L18,21 L14,21 L14,25 L18,25 Z M18,18 L18,10 L14,10 L14,18 L18,18 Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 388 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10 0C8.02219 0 6.08879 0.58649 4.4443 1.6853C2.79981 2.78412 1.51809 4.3459 0.761209 6.17317C0.00433284 8.00043 -0.193701 10.0111 0.192152 11.9509C0.578004 13.8907 1.53041 15.6725 2.92894 17.0711C4.32746 18.4696 6.10929 19.422 8.0491 19.8079C9.98891 20.1937 11.9996 19.9957 13.8268 19.2388C15.6541 18.4819 17.2159 17.2002 18.3147 15.5557C19.4135 13.9112 20 11.9778 20 10C20 7.34784 18.9464 4.8043 17.0711 2.92893C15.1957 1.05357 12.6522 0 10 0ZM10 18.2C8.3782 18.2 6.79281 17.7191 5.44433 16.8181C4.09585 15.917 3.04483 14.6364 2.42419 13.138C1.80355 11.6397 1.64117 9.9909 1.95757 8.40026C2.27396 6.80961 3.05494 5.34852 4.20173 4.20172C5.34852 3.05493 6.80962 2.27396 8.40026 1.95756C9.99091 1.64116 11.6397 1.80355 13.138 2.42419C14.6364 3.04483 15.917 4.09584 16.8181 5.44432C17.7191 6.79281 18.2 8.37819 18.2 10C18.1974 12.174 17.3326 14.2581 15.7954 15.7954C14.2581 17.3326 12.174 18.1974 10 18.2ZM10.9 9.43L14.46 11.09L13.7 12.72L9.10001 10.57V4H10.9V9.43Z" fill="#9AA7B0" fill-opacity="0.8"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="#6E6E6E" fill-rule="evenodd" transform="translate(1 3)">
<rect width="12" height="2" x="1" y="4"/>

Before

Width:  |  Height:  |  Size: 442 B

After

Width:  |  Height:  |  Size: 589 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#389FD6" fill-rule="evenodd" d="M14.0431479,8.44999981 L14.3048222,13.4430431 L12.574725,11.885269 C11.4741571,13.1817306 9.83248424,14.0044386 7.99865879,14.0044386 C5.03921121,14.0044386 2.58020312,11.8617896 2.08827651,9.04314243 L3.94798986,9.10858763 C4.43427312,10.8903005 6.0642585,12.2000519 8.00015362,12.2000519 C9.30169687,12.2000519 10.4649641,11.6080237 11.2353504,10.6785714 L9.05000019,8.71167959 L14.0431479,8.44999981 Z M7.99865879,2.00443857 C10.9184669,2.00443857 13.3511517,4.09007371 13.888219,6.85284133 L12.0226275,6.7880427 C11.5024638,5.05933714 9.89836709,3.8000774 8.00015362,3.8000774 C6.69883692,3.8000774 5.53574811,4.39189956 4.76535914,5.32107268 L6.95482203,7.29304326 L1.96167436,7.55472304 L1.70000005,2.56167973 L3.42768119,4.11762166 C4.52821742,2.82461451 6.1676575,2.00443857 7.99865879,2.00443857 Z" transform="rotate(3 8.002 8.004)"/>
</svg>

Before

Width:  |  Height:  |  Size: 981 B

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<polygon fill="#59A869" points="13.789 2.09 15.535 3.837 6.292 13.08 1.95 8.738 3.698 6.99 6.293 9.585"/>
</svg>

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 346 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<path fill="#6E6E6E" d="M11,3 L4,3 L4,11 L2,11 L2,1 L11,1 L11,3 Z"/>

Before

Width:  |  Height:  |  Size: 363 B

After

Width:  |  Height:  |  Size: 510 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="#389FD6" fill-rule="evenodd" transform="translate(1)">
<path d="M10.9000003,4.89999992 L14.0999999,4.89999992 L9.9000001,9.09999973 L5.70000029,4.89999992 L8.90000027,4.89999992 L8.90000027,0.899999917 L10.9000003,0.899999917 L10.9000003,4.89999992 Z" transform="rotate(90 9.9 5)"/>

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 777 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<polygon fill="#6E6E6E" points="9 7 12 7 8 11 4 7 7 7 7 2 9 2" transform="matrix(-1 0 0 1 16 0)"/>

Before

Width:  |  Height:  |  Size: 301 B

After

Width:  |  Height:  |  Size: 448 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<polygon fill="#F4AF3D" fill-rule="evenodd" points="7.998 11.522 3.673 14.311 4.989 9.336 1 6.084 6.138 5.798 7.998 1 9.858 5.798 14.996 6.084 11.007 9.336 12.323 14.311"/>
</svg>

Before

Width:  |  Height:  |  Size: 266 B

After

Width:  |  Height:  |  Size: 413 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<rect width="11" height="2" x="2" y="7" fill="#6E6E6E" transform="matrix(-1 0 0 1 15 0)"/>

Before

Width:  |  Height:  |  Size: 484 B

After

Width:  |  Height:  |  Size: 631 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#161514" fill-rule="evenodd" d="M7.99707713,1 C4.13339149,1 1,4.1329619 1,7.9979363 C1,11.0896581 3.00487223,13.7122732 5.78557461,14.6375989 C6.13568621,14.7020366 6.2632729,14.4859554 6.2632729,14.3003748 C6.2632729,14.1345551 6.25725871,13.6942307 6.25382203,13.1104249 C4.30737333,13.5331364 3.89669027,12.1722117 3.89669027,12.1722117 C3.57836793,11.3637332 3.11957137,11.1485112 3.11957137,11.1485112 C2.48421546,10.7146305 3.16768487,10.7232222 3.16768487,10.7232222 C3.87005601,10.7726245 4.23949893,11.4444951 4.23949893,11.4444951 C4.86368564,12.5137317 5.87750575,12.2048602 6.27616044,12.0257233 C6.33973899,11.5738001 6.52059419,11.2653582 6.72035112,11.0905172 C5.16654292,10.9139579 3.53283195,10.3133983 3.53283195,7.63193005 C3.53283195,6.86812829 3.80561829,6.24308241 4.25324565,5.75421492 C4.1810754,5.57722598 3.9409375,4.86540398 4.32197921,3.90227487 C4.32197921,3.90227487 4.90922163,3.71411673 6.24608951,4.61968148 C6.80412015,4.46417178 7.40296136,4.38684652 7.9979363,4.38383942 C8.59248165,4.38684652 9.19089327,4.46417178 9.74978309,4.61968148 C11.0857918,3.71411673 11.672175,3.90227487 11.672175,3.90227487 C12.0540759,4.86540398 11.813938,5.57722598 11.7421974,5.75421492 C12.1906839,6.24308241 12.4613223,6.86812829 12.4613223,7.63193005 C12.4613223,10.3202717 10.8250338,10.91181 9.26650019,11.0849326 C9.51737771,11.3010138 9.74119139,11.7280211 9.74119139,12.38099 C9.74119139,13.316196 9.7325997,14.0709765 9.7325997,14.3003748 C9.7325997,14.4876738 9.85889763,14.7054733 10.2137347,14.6371693 C12.9922891,13.7096957 14.995443,11.0887989 14.995443,7.9979363 C14.995443,4.1329619 11.8620515,1 7.99707713,1"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#FFFFFE" fill-rule="evenodd" d="M7.99707713,1 C4.13339149,1 1,4.1329619 1,7.9979363 C1,11.0896581 3.00487223,13.7122732 5.78557461,14.6375989 C6.13568621,14.7020366 6.2632729,14.4859554 6.2632729,14.3003748 C6.2632729,14.1341255 6.25725871,13.6942307 6.25382203,13.1104249 C4.30737333,13.5331364 3.89669027,12.1722117 3.89669027,12.1722117 C3.57836793,11.3637332 3.11957137,11.1485112 3.11957137,11.1485112 C2.48421546,10.7146305 3.16768487,10.7232222 3.16768487,10.7232222 C3.87005601,10.7726245 4.23949893,11.4444951 4.23949893,11.4444951 C4.86368564,12.5137317 5.87750575,12.2048602 6.27616044,12.0257233 C6.33973899,11.5738001 6.52059419,11.2653582 6.72035112,11.0905172 C5.16654292,10.9139579 3.53283195,10.3133983 3.53283195,7.63193005 C3.53283195,6.86812829 3.80561829,6.24308241 4.25324565,5.75421492 C4.1810754,5.57722598 3.9409375,4.86540398 4.32197921,3.90227487 C4.32197921,3.90227487 4.90922163,3.71411673 6.24608951,4.61968148 C6.80412015,4.46417178 7.40296136,4.38684652 7.9979363,4.38383942 C8.59248165,4.38684652 9.19089327,4.46417178 9.74978309,4.61968148 C11.0857918,3.71411673 11.672175,3.90227487 11.672175,3.90227487 C12.0540759,4.86540398 11.813938,5.57722598 11.7421974,5.75421492 C12.1906839,6.24308241 12.4613223,6.86812829 12.4613223,7.63193005 C12.4613223,10.3202717 10.8250338,10.91181 9.26650019,11.0849326 C9.51737771,11.3010138 9.74119139,11.7280211 9.74119139,12.3805604 C9.74119139,13.316196 9.7325997,14.0709765 9.7325997,14.3003748 C9.7325997,14.4876738 9.85889763,14.7054733 10.2137347,14.6371693 C12.9922891,13.7096957 14.995443,11.0887989 14.995443,7.9979363 C14.995443,4.1329619 11.8620515,1 7.99707713,1"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<rect width="12" height="2" x="2" y="3" fill="#6E6E6E"/>

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 467 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#6E6E6E" d="M6.53206047,5.10906 C6.68535547,4.77581 6.77200047,4.40923501 6.77200047,4.01600001 C6.77200047,2.54303502 5.57896548,1.35000002 4.10600049,1.35000002 C2.63303549,1.35000002 1.4400005,2.54303502 1.4400005,4.01600001 C1.4400005,5.488965 2.63303549,6.68199999 4.10600049,6.68199999 C4.49923548,6.68199999 4.86581048,6.59535499 5.19906048,6.44205999 L6.77200047,8.01499999 L5.19906048,9.58793998 C4.86581048,9.43464498 4.49923548,9.34799998 4.10600049,9.34799998 C2.63303549,9.34799998 1.4400005,10.541035 1.4400005,12.014 C1.4400005,13.486965 2.63303549,14.6799999 4.10600049,14.6799999 C5.57896548,14.6799999 6.77200047,13.486965 6.77200047,12.014 C6.77200047,11.620765 6.68535547,11.25419 6.53206047,10.92094 L8.10500046,9.34799998 L12.7705004,14 L14.7700004,14 L14.7700004,13.347 L6.53206047,5.10906 Z M4.1053342,5.33702364 C3.37236745,5.33702364 2.77266738,4.74383861 2.77266738,4.00402356 C2.77266738,3.26420851 3.37236745,2.67102348 4.1053342,2.67102348 C4.83830096,2.67102348 5.43800103,3.26420851 5.43800103,4.00402356 C5.43800103,4.74383861 4.83830096,5.33702364 4.1053342,5.33702364 Z M4.1053342,13.3350241 C3.37236745,13.3350241 2.77266738,12.7418391 2.77266738,12.0020241 C2.77266738,11.262209 3.37236745,10.669024 4.1053342,10.669024 C4.83830096,10.669024 5.43800103,11.262209 5.43800103,12.0020241 C5.43800103,12.7418391 4.83830096,13.3350241 4.1053342,13.3350241 Z M8.10333468,8.33627383 C7.91676132,8.33627383 7.77016797,8.18964382 7.77016797,8.00302381 C7.77016797,7.8164038 7.91676132,7.66977379 8.10333468,7.66977379 C8.28990803,7.66977379 8.43650138,7.8164038 8.43650138,8.00302381 C8.43650138,8.18964382 8.28990803,8.33627383 8.10333468,8.33627383 Z M12.7710002,2.00452344 L8.77299971,6.00352368 L10.1056665,7.33652377 L14.7700004,2.67102348 L14.7700004,2.00452344 L12.7710002,2.00452344 Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -1,3 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#6E6E6E" fill-rule="evenodd" d="M3,1 L3,0 L7,0 L7,1 L10,1 L10,13 L0,13 L0,1 L3,1 Z M4,1 L4,2 L6,2 L6,1 L4,1 Z M2,4 L2,11 L8,11 L8,4 L2,4 Z" transform="translate(3 1)"/>
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="menu-paste">
<g id="paste">
<path id="Shape" fill-rule="evenodd" clip-rule="evenodd" d="M6 2V1H10V2H13V14H3V2H6ZM7 2V3H9V2H7ZM5 5V12H11V5H5Z" fill="#6E6E6E"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 274 B

After

Width:  |  Height:  |  Size: 426 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g fill="none" fill-rule="evenodd">
<path fill="#9AA7B0" fill-opacity=".8" d="M1,1 L15,1 L15,14 L1,14 L1,1 Z M2,4 L2,13 L14,13 L14,4 L2,4 Z"/>

Before

Width:  |  Height:  |  Size: 326 B

After

Width:  |  Height:  |  Size: 473 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#6E6E6E" d="M8.35170965,4.66666667 C6.5846115,4.66666667 4.98422073,5.32666667 3.75058618,6.4 L1.35000002,4 L1.35000002,10 L7.35146542,10 L4.93754267,7.58666667 C5.86443566,6.81333333 7.04472385,6.33333333 8.35170965,6.33333333 C10.712286,6.33333333 12.7194428,7.87333333 13.4196138,10 L14.9999996,9.48 C14.0731067,6.68666667 11.4524668,4.66666667 8.35170965,4.66666667 Z" transform="matrix(-1 0 0 1 16.35 0)"/>
</svg>

Before

Width:  |  Height:  |  Size: 517 B

After

Width:  |  Height:  |  Size: 664 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#6E6E6E" fill-rule="evenodd" d="M12.5747152,11.8852806 C11.4741474,13.1817355 9.83247882,14.0044386 7.99865879,14.0044386 C5.03907292,14.0044386 2.57997332,11.8615894 2.08820756,9.0427473 L3.94774327,9.10768372 C4.43372186,10.8898575 6.06393114,12.2000519 8.00015362,12.2000519 C9.30149237,12.2000519 10.4645985,11.6082097 11.2349873,10.6790094 L9.05000019,8.71167959 L14.0431479,8.44999981 L14.3048222,13.4430431 L12.5747152,11.8852806 Z M3.42785637,4.11741586 C4.52839138,2.82452748 6.16775464,2.00443857 7.99865879,2.00443857 C10.918604,2.00443857 13.3513802,4.09026967 13.8882946,6.8532307 L12.0226389,6.78808057 C11.5024872,5.05935553 9.89838095,3.8000774 8.00015362,3.8000774 C6.69867367,3.8000774 5.53545628,4.39204806 4.76506921,5.32142241 L6.95482203,7.29304326 L1.96167436,7.55472304 L1.70000005,2.56167973 L3.42785637,4.11741586 Z" transform="rotate(3 8.002 8.004)"/>
</svg>

Before

Width:  |  Height:  |  Size: 984 B

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#7F8B91" fill-opacity=".9" fill-rule="evenodd" d="M11.038136,9.94904865 L13.9980971,12.9090097 L12.9374369,13.9696699 L9.98176525,11.0139983 C9.14925083,11.6334368 8.11743313,12 7,12 C4.23857625,12 2,9.76142375 2,7 C2,4.23857625 4.23857625,2 7,2 C9.76142375,2 12,4.23857625 12,7 C12,8.1028408 11.642948,9.12228765 11.038136,9.94904865 Z M7,11 C9.209139,11 11,9.209139 11,7 C11,4.790861 9.209139,3 7,3 C4.790861,3 3,4.790861 3,7 C3,9.209139 4.790861,11 7,11 Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 567 B

After

Width:  |  Height:  |  Size: 714 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#6E6E6E" d="M8,3 C4.81818182,3 2.10090909,5.07333333 1,8 C2.10090909,10.9266667 4.81818182,13 8,13 C11.1818182,13 13.8990909,10.9266667 15,8 C13.8990909,5.07333333 11.1818182,3 8,3 Z M8,11.5 C6.068,11.5 4.5,9.932 4.5,8 C4.5,6.068 6.068,4.5 8,4.5 C9.932,4.5 11.5,6.068 11.5,8 C11.5,9.932 9.932,11.5 8,11.5 Z M8,6 C6.89333333,6 6,6.89333333 6,8 C6,9.10666667 6.89333333,10 8,10 C9.10666667,10 10,9.10666667 10,8 C10,6.89333333 9.10666667,6 8,6 Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 552 B

After

Width:  |  Height:  |  Size: 699 B

View File

@@ -1,3 +1,4 @@
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="#6E6E6E" d="M8.00170962,4.66666667 C6.23461148,4.66666667 4.63422071,5.32666667 3.40058616,6.4 L1,4 L1,10 L7.00146539,10 L4.58754265,7.58666667 C5.51443563,6.81333333 6.69472383,6.33333333 8.00170962,6.33333333 C10.362286,6.33333333 12.3694428,7.87333333 13.0696137,10 L14.6499996,9.48 C13.7231066,6.68666667 11.1024667,4.66666667 8.00170962,4.66666667 Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 463 B

After

Width:  |  Height:  |  Size: 610 B

View File

@@ -1 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><rect id="frame" width="16" height="16" fill="none"/><path d="M11.6 8.5c1.104 0 1.992-.88 1.992-1.964 0-1.085-.888-1.965-1.992-1.965s-2 .88-2 1.965c0 1.084.896 1.964 2 1.964zm-6-.786c1.328 0 2.392-1.053 2.392-2.357C7.992 4.053 6.928 3 5.6 3 4.272 3 3.2 4.053 3.2 5.357c0 1.304 1.072 2.357 2.4 2.357zm6 2.357c-1.464 0-4.4.723-4.4 2.161V14H16v-1.768c0-1.438-2.936-2.16-4.4-2.16zm-6-.785c-1.864 0-5.6.919-5.6 2.75V14h5.6v-1.768c0-.668.264-1.838 1.896-2.726-.696-.142-1.368-.22-1.896-.22z" fill="#6E6E6E"/></svg>
<!-- Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.6 8.5C12.704 8.5 13.592 7.62 13.592 6.53571C13.592 5.45143 12.704 4.57143 11.6 4.57143C10.496 4.57143 9.6 5.45143 9.6 6.53571C9.6 7.62 10.496 8.5 11.6 8.5ZM5.6 7.71429C6.928 7.71429 7.992 6.66143 7.992 5.35714C7.992 4.05286 6.928 3 5.6 3C4.272 3 3.2 4.05286 3.2 5.35714C3.2 6.66143 4.272 7.71429 5.6 7.71429ZM11.6 10.0714C10.136 10.0714 7.2 10.7943 7.2 12.2321V14H16V12.2321C16 10.7943 13.064 10.0714 11.6 10.0714ZM5.6 9.28571C3.736 9.28571 0 10.205 0 12.0357V14H5.6V12.2321C5.6 11.5643 5.864 10.3936 7.496 9.50571C6.8 9.36429 6.128 9.28571 5.6 9.28571Z" fill="#6E6E6E"/>
</svg>

Before

Width:  |  Height:  |  Size: 603 B

After

Width:  |  Height:  |  Size: 835 B

View File

@@ -700,16 +700,16 @@ public class FlatUIDefaultsInspector
if( value instanceof Color ) {
Color color = (info instanceof Color[]) ? ((Color[])info)[0] : (Color) value;
HSLColor hslColor = new HSLColor( color );
int hue = Math.round( hslColor.getHue() );
int saturation = Math.round( hslColor.getSaturation() );
int luminance = Math.round( hslColor.getLuminance() );
if( color.getAlpha() == 255 ) {
return String.format( "%-9s HSL %3d %3d %3d",
color2hex( color ),
(int) hslColor.getHue(), (int) hslColor.getSaturation(),
(int) hslColor.getLuminance() );
color2hex( color ), hue, saturation, luminance );
} else {
int alpha = Math.round( hslColor.getAlpha() * 100 );
return String.format( "%-9s HSL %3d %3d %3d %2d",
color2hex( color ),
(int) hslColor.getHue(), (int) hslColor.getSaturation(),
(int) hslColor.getLuminance(), (int) (hslColor.getAlpha() * 100) );
color2hex( color ), hue, saturation, luminance, alpha );
}
} else if( value instanceof Insets ) {
Insets insets = (Insets) value;

View File

@@ -39,14 +39,6 @@ public class FlatArcDarkIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatArcDarkIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatArcDarkOrangeIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatArcDarkOrangeIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatArcIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatArcIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatArcOrangeIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatArcOrangeIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatCarbonIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatCarbonIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatCobalt2IJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatCobalt2IJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatCyanLightIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatCyanLightIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatDarkFlatIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatDarkFlatIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatDarkPurpleIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatDarkPurpleIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatDraculaIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatDraculaIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatGradiantoDarkFuchsiaIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatGradiantoDarkFuchsiaIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatGradiantoDeepOceanIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatGradiantoDeepOceanIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatGradiantoMidnightBlueIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatGradiantoMidnightBlueIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatGradiantoNatureGreenIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatGradiantoNatureGreenIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatGrayIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatGrayIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatGruvboxDarkHardIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatGruvboxDarkHardIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatGruvboxDarkMediumIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatGruvboxDarkMediumIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatGruvboxDarkSoftIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatGruvboxDarkSoftIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatHiberbeeDarkIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatHiberbeeDarkIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatHighContrastIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatHighContrastIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatLightFlatIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatLightFlatIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatMaterialDesignDarkIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatMaterialDesignDarkIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatMonocaiIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatMonocaiIJTheme.class );
}

View File

@@ -39,14 +39,6 @@ public class FlatNordIJTheme
}
}
/**
* @deprecated use {@link #setup()} instead; this method will be removed in a future version
*/
@Deprecated
public static boolean install() {
return setup();
}
public static void installLafInfo() {
installLafInfo( NAME, FlatNordIJTheme.class );
}

Some files were not shown because too many files have changed in this diff Show More