mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
Compare commits
75 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f842530537 | ||
|
|
63077bbb19 | ||
|
|
4dad337377 | ||
|
|
10a965d765 | ||
|
|
3e9c9c9066 | ||
|
|
8b5a738e65 | ||
|
|
2c041dce3a | ||
|
|
ef151c68f4 | ||
|
|
52feaac92a | ||
|
|
cddbb3d7d4 | ||
|
|
42764550e6 | ||
|
|
6ee737b314 | ||
|
|
f460ef7685 | ||
|
|
9977bcb468 | ||
|
|
7437d984c7 | ||
|
|
5cd0b2403c | ||
|
|
a372da22f3 | ||
|
|
8b10d3ba5a | ||
|
|
a8b15c6a12 | ||
|
|
23bac7e5fd | ||
|
|
b82ee2ef61 | ||
|
|
b7761f4b71 | ||
|
|
f9a4f9771c | ||
|
|
d2acb2c98a | ||
|
|
d60bd5df14 | ||
|
|
73b6ca3762 | ||
|
|
6c18431a30 | ||
|
|
a49d20249f | ||
|
|
ad384acd57 | ||
|
|
69851b7f3a | ||
|
|
92b53bf0df | ||
|
|
93e0496fd2 | ||
|
|
5151951f46 | ||
|
|
58dbccec2d | ||
|
|
90de14d013 | ||
|
|
5f961618bf | ||
|
|
37c375e2fa | ||
|
|
1758c175ed | ||
|
|
96f2a02cfa | ||
|
|
96d4bda6c8 | ||
|
|
02cf6050a1 | ||
|
|
38cf32a2e9 | ||
|
|
2ae7589d14 | ||
|
|
bcb2e1f0a1 | ||
|
|
14932d3f07 | ||
|
|
c3b9dc397d | ||
|
|
58b653f55d | ||
|
|
1dcdc42dde | ||
|
|
58a0a16985 | ||
|
|
a117243f14 | ||
|
|
22411060be | ||
|
|
045263ae58 | ||
|
|
024b6daaf6 | ||
|
|
bd5512c121 | ||
|
|
9afce83a02 | ||
|
|
07a8bd9486 | ||
|
|
bcdc0a8fce | ||
|
|
b295809432 | ||
|
|
52763ab932 | ||
|
|
99666265c9 | ||
|
|
af3e280d74 | ||
|
|
b57e4c0565 | ||
|
|
aca9931560 | ||
|
|
d09e166e4a | ||
|
|
68a7a60ff2 | ||
|
|
f21261914b | ||
|
|
7b11339fdc | ||
|
|
081fd43d98 | ||
|
|
ef2eedfc7c | ||
|
|
0dba9265be | ||
|
|
301aae9b8e | ||
|
|
c63f4e9662 | ||
|
|
47508dc6ac | ||
|
|
3a8879608a | ||
|
|
b221889549 |
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
@@ -28,13 +28,13 @@ jobs:
|
||||
- 17 # LTS
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: gradle/wrapper-validation-action@v1
|
||||
if: matrix.java == '8'
|
||||
|
||||
- name: Setup Java ${{ matrix.java }}
|
||||
uses: actions/setup-java@v2
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
distribution: adopt # Java 8 and 11 are pre-installed on ubuntu-latest
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
run: ./gradlew build
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
if: matrix.java == '11'
|
||||
with:
|
||||
name: FlatLaf-build-artifacts
|
||||
@@ -63,10 +63,10 @@ jobs:
|
||||
github.repository == 'JFormDesigner/FlatLaf'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Java 11
|
||||
uses: actions/setup-java@v2
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: 11
|
||||
distribution: adopt # pre-installed on ubuntu-latest
|
||||
@@ -99,10 +99,10 @@ jobs:
|
||||
github.repository == 'JFormDesigner/FlatLaf'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Java 11
|
||||
uses: actions/setup-java@v2
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: 11
|
||||
distribution: adopt # pre-installed on ubuntu-latest
|
||||
|
||||
9
.github/workflows/natives.yml
vendored
9
.github/workflows/natives.yml
vendored
@@ -25,12 +25,12 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: gradle/wrapper-validation-action@v1
|
||||
|
||||
- name: Setup Java 11
|
||||
uses: actions/setup-java@v2
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: 11
|
||||
distribution: adopt
|
||||
@@ -39,11 +39,12 @@ jobs:
|
||||
- name: Build with Gradle
|
||||
# --no-daemon is necessary on Windows otherwise caching Gradle would fail with:
|
||||
# tar.exe: Couldn't open ~/.gradle/caches/modules-2/modules-2.lock: Permission denied
|
||||
run: ./gradlew :flatlaf-natives-windows:build --no-daemon
|
||||
run: ./gradlew :flatlaf-natives-windows:build-natives --no-daemon
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: FlatLaf-natives-windows-build-artifacts
|
||||
path: |
|
||||
flatlaf-core/src/main/resources/com/formdev/flatlaf/natives
|
||||
flatlaf-natives/flatlaf-natives-windows/build
|
||||
|
||||
99
CHANGELOG.md
99
CHANGELOG.md
@@ -1,6 +1,103 @@
|
||||
FlatLaf Change Log
|
||||
==================
|
||||
|
||||
## 2.4
|
||||
|
||||
#### New features and improvements
|
||||
|
||||
- Native window decorations (Windows 10/11 only):
|
||||
- There is now a small area at top of the embedded menu bar to resize the
|
||||
window.
|
||||
- Improved window title bar layout for small window widths:
|
||||
- Width of iconify/maximize/close buttons is reduced (if necessary) to give
|
||||
more space to embedded menu bar and title.
|
||||
- Window title now has a minimum width to always allow moving window
|
||||
(click-and-drag on window title). Instead, embedded menu bar is made
|
||||
smaller.
|
||||
- Option to show window icon beside window title, if menu bar is embedded or
|
||||
title is centered. Set UI value `TitlePane.showIconBesideTitle` to `true`.
|
||||
- No longer reduce height of window title bar if it has an embedded menu bar
|
||||
and is maximized.
|
||||
|
||||
#### Fixed bugs
|
||||
|
||||
- ComboBox: Fixed vertical alignment of text in popup list with text in combo
|
||||
box in IntelliJ/Darcula themes.
|
||||
- Menus: Fixed application freeze under very special conditions (invoking
|
||||
`FlatLaf.initialize()` twice in NetBeans GUI builder) and using menu that has
|
||||
submenus. See
|
||||
[NetBeans issue #4231](https://github.com/apache/netbeans/issues/4231#issuecomment-1179611682)
|
||||
for details.
|
||||
- MenuItem: Fixed sometimes wrapped HTML text on HiDPI screens on Windows.
|
||||
- TableHeader: Fixed exception when changing table structure (e.g. removing
|
||||
column) from a table header popup menu action. (issue #532)
|
||||
- `HiDPIUtils.paintAtScale1x()` now supports rotated graphics. (issue #557)
|
||||
- Typography: No longer use `Consolas` or `Courier New` as monospaced font on
|
||||
Windows because they have bad vertically placement.
|
||||
- Native window decorations (Windows 10/11 only):
|
||||
- Do not center window title if embedded menu bar is empty or has no menus at
|
||||
left side, but some components at right side. (issue #558)
|
||||
- Do not use window decorations if system property `sun.java2d.opengl` is
|
||||
`true` on Windows 10. (issue #540)
|
||||
- Fixed missing top window border in dark themes if window drop shadows are
|
||||
disabled in system settings. (issue #554; Windows 10 only)
|
||||
- Right-to-left component orientation of title bar was lost when switching
|
||||
theme.
|
||||
|
||||
|
||||
## 2.3
|
||||
|
||||
#### New features and improvements
|
||||
|
||||
- FileChooser: Added (optional) shortcuts panel. On Windows it contains "Recent
|
||||
Items", "Desktop", "Documents", "This PC" and "Network". On macOS and Linux it
|
||||
is empty/hidden. (issue #100)
|
||||
- Button and ToggleButton: Added missing foreground colors for hover, pressed,
|
||||
focused and selected states. (issue #535)
|
||||
- Table: Optionally paint alternating rows below table if table is smaller than
|
||||
scroll pane. Set UI value `Table.paintOutsideAlternateRows` to `true`.
|
||||
Requires that `Table.alternateRowColor` is set to a color. (issue #504)
|
||||
- ToggleButton: Made the underline placement of tab-style toggle buttons
|
||||
configurable. (PR #530; issue #529)
|
||||
- Added spanish translation. (PR #525)
|
||||
|
||||
#### Fixed bugs
|
||||
|
||||
- IntelliJ Themes: Fixed `TitledBorder` text color in "Monokai Pro" theme.
|
||||
(issue #524)
|
||||
|
||||
|
||||
## 2.2
|
||||
|
||||
#### New features and improvements
|
||||
|
||||
- SplitPane: Allow limiting one-touch expanding to a single side (set client
|
||||
property `JSplitPane.expandableSide` to `"left"` or `"right"`). (issue #355)
|
||||
- TabbedPane: Selected tab underline color now changes depending on whether the
|
||||
focus is within the tab content. (issue #398)
|
||||
- IntelliJ Themes:
|
||||
- Added "Monokai Pro" and "Xcode-Dark" themes.
|
||||
- TabbedPane now use different background color for selected tabs in all "Arc"
|
||||
themes, in "Hiberbee Dark" and in all "Material UI Lite" themes.
|
||||
|
||||
#### Fixed bugs
|
||||
|
||||
- Native window decorations (Windows 10/11 only): Fixed wrong window title
|
||||
character encoding used in Windows taskbar. (issue #502)
|
||||
- Button: Fixed icon layout and preferred width of default buttons that use bold
|
||||
font. (issue #506)
|
||||
- FileChooser: Enabled full row selection for details view to fix alternate row
|
||||
coloring. (issue #512)
|
||||
- SplitPane: Fixed `StackOverflowError` caused by layout loop that may occur
|
||||
under special circumstances. (issue #513)
|
||||
- Table: Slightly changed grid colors to make grid better recognizable. (issue
|
||||
#514)
|
||||
- ToolBar: Fixed endless loop in focus navigation that may occur under special
|
||||
circumstances. (issue #505)
|
||||
- IntelliJ Themes: `Component.accentColor` UI property now has useful theme
|
||||
specific values. (issue #507)
|
||||
|
||||
|
||||
## 2.1
|
||||
|
||||
#### New features and improvements
|
||||
@@ -110,7 +207,7 @@ FlatLaf Change Log
|
||||
- Possibility to hide window title bar icon (for single window set client
|
||||
property `JRootPane.titleBarShowIcon` to `false`; for all windows set UI
|
||||
value `TitlePane.showIcon` to `false`).
|
||||
- OptionPane: Hide window title bar icon by default. Can be be made visibly by
|
||||
- OptionPane: Hide window title bar icon by default. Can be made visibly by
|
||||
setting UI default `OptionPane.showIcon` to `true`. (issue #416)
|
||||
- No longer show the Java "duke/cup" icon if no window icon image is set.
|
||||
(issue #416)
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
val releaseVersion = "2.1"
|
||||
val developmentVersion = "2.2-SNAPSHOT"
|
||||
val releaseVersion = "2.4"
|
||||
val developmentVersion = "2.5-SNAPSHOT"
|
||||
|
||||
version = if( java.lang.Boolean.getBoolean( "release" ) ) releaseVersion else developmentVersion
|
||||
|
||||
|
||||
@@ -61,8 +61,6 @@ if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest.attributes( "Multi-Release" to "true" )
|
||||
|
||||
from( sourceSets["module-info"].output ) {
|
||||
include( "module-info.class" )
|
||||
}
|
||||
|
||||
@@ -43,11 +43,6 @@ tasks {
|
||||
options.headerOutputDirectory.set( buildDir.resolve( "generated/jni-headers" ) )
|
||||
}
|
||||
|
||||
processResources {
|
||||
// build native libraries
|
||||
dependsOn( ":flatlaf-natives-windows:assemble" )
|
||||
}
|
||||
|
||||
jar {
|
||||
archiveBaseName.set( "flatlaf" )
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#Signature file v4.1
|
||||
#Version 2.0
|
||||
#Version 2.3
|
||||
|
||||
CLSS public abstract interface com.formdev.flatlaf.FlatClientProperties
|
||||
fld public final static java.lang.String BUTTON_TYPE = "JButton.buttonType"
|
||||
@@ -30,6 +30,9 @@ fld public final static java.lang.String SELECT_ALL_ON_FOCUS_POLICY = "JTextFiel
|
||||
fld public final static java.lang.String SELECT_ALL_ON_FOCUS_POLICY_ALWAYS = "always"
|
||||
fld public final static java.lang.String SELECT_ALL_ON_FOCUS_POLICY_NEVER = "never"
|
||||
fld public final static java.lang.String SELECT_ALL_ON_FOCUS_POLICY_ONCE = "once"
|
||||
fld public final static java.lang.String SPLIT_PANE_EXPANDABLE_SIDE = "JSplitPane.expandableSide"
|
||||
fld public final static java.lang.String SPLIT_PANE_EXPANDABLE_SIDE_LEFT = "left"
|
||||
fld public final static java.lang.String SPLIT_PANE_EXPANDABLE_SIDE_RIGHT = "right"
|
||||
fld public final static java.lang.String SQUARE_SIZE = "JButton.squareSize"
|
||||
fld public final static java.lang.String STYLE = "FlatLaf.style"
|
||||
fld public final static java.lang.String STYLE_CLASS = "FlatLaf.styleClass"
|
||||
@@ -72,6 +75,7 @@ fld public final static java.lang.String TABBED_PANE_TRAILING_COMPONENT = "JTabb
|
||||
fld public final static java.lang.String TAB_BUTTON_SELECTED_BACKGROUND = "JToggleButton.tab.selectedBackground"
|
||||
fld public final static java.lang.String TAB_BUTTON_UNDERLINE_COLOR = "JToggleButton.tab.underlineColor"
|
||||
fld public final static java.lang.String TAB_BUTTON_UNDERLINE_HEIGHT = "JToggleButton.tab.underlineHeight"
|
||||
fld public final static java.lang.String TAB_BUTTON_UNDERLINE_PLACEMENT = "JToggleButton.tab.underlinePlacement"
|
||||
fld public final static java.lang.String TEXT_FIELD_CLEAR_CALLBACK = "JTextField.clearCallback"
|
||||
fld public final static java.lang.String TEXT_FIELD_LEADING_COMPONENT = "JTextField.leadingComponent"
|
||||
fld public final static java.lang.String TEXT_FIELD_LEADING_ICON = "JTextField.leadingIcon"
|
||||
@@ -216,7 +220,7 @@ meth public void setExtraDefaults(java.util.Map<java.lang.String,java.lang.Strin
|
||||
meth public void uninitialize()
|
||||
meth public void unregisterUIDefaultsGetter(java.util.function.Function<java.lang.Object,java.lang.Object>)
|
||||
supr javax.swing.plaf.basic.BasicLookAndFeel
|
||||
hfds DESKTOPFONTHINTS,aquaLoaded,customDefaultsSources,desktopPropertyListener,desktopPropertyName,desktopPropertyName2,extraDefaults,globalExtraDefaults,mnemonicHandler,oldPopupFactory,postInitialization,uiDefaultsGetters,updateUIPending
|
||||
hfds DESKTOPFONTHINTS,aquaLoaded,customDefaultsSources,desktopPropertyListener,desktopPropertyName,desktopPropertyName2,extraDefaults,globalExtraDefaults,mnemonicHandler,oldPopupFactory,postInitialization,subMenuUsabilityHelper,uiDefaultsGetters,updateUIPending
|
||||
hcls ActiveFont,FlatUIDefaults,ImageIconUIResource
|
||||
|
||||
CLSS public abstract interface static com.formdev.flatlaf.FlatLaf$DisabledIconProvider
|
||||
@@ -662,6 +666,7 @@ CLSS public com.formdev.flatlaf.util.SystemInfo
|
||||
cons public init()
|
||||
fld public final static boolean isAARCH64
|
||||
fld public final static boolean isJava_11_orLater
|
||||
fld public final static boolean isJava_12_orLater
|
||||
fld public final static boolean isJava_15_orLater
|
||||
fld public final static boolean isJava_17_orLater
|
||||
fld public final static boolean isJava_18_orLater
|
||||
@@ -670,6 +675,7 @@ fld public final static boolean isJetBrainsJVM
|
||||
fld public final static boolean isJetBrainsJVM_11_orLater
|
||||
fld public final static boolean isKDE
|
||||
fld public final static boolean isLinux
|
||||
fld public final static boolean isMacFullWindowContentSupported
|
||||
fld public final static boolean isMacOS
|
||||
fld public final static boolean isMacOS_10_11_ElCapitan_orLater
|
||||
fld public final static boolean isMacOS_10_14_Mojave_orLater
|
||||
|
||||
@@ -391,6 +391,40 @@ public interface FlatClientProperties
|
||||
*/
|
||||
String SCROLL_PANE_SMOOTH_SCROLLING = "JScrollPane.smoothScrolling";
|
||||
|
||||
//---- JSplitPane ---------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Specifies what side of the spilt pane is allowed to expand
|
||||
* via one-touch expanding arrow buttons.
|
||||
* Requires that one-touch expanding is enabled with
|
||||
* {@link javax.swing.JSplitPane#setOneTouchExpandable(boolean)}.
|
||||
* <p>
|
||||
* <strong>Component</strong> {@link javax.swing.JSplitPane}<br>
|
||||
* <strong>Value type</strong> {@link java.lang.String}<br>
|
||||
* <strong>Allowed Values</strong>
|
||||
* {@link #SPLIT_PANE_EXPANDABLE_SIDE_LEFT} or
|
||||
* {@link #SPLIT_PANE_EXPANDABLE_SIDE_RIGHT}
|
||||
*
|
||||
* @since 2.2
|
||||
*/
|
||||
String SPLIT_PANE_EXPANDABLE_SIDE = "JSplitPane.expandableSide";
|
||||
|
||||
/**
|
||||
* Allow expanding only left/top side of the split pane.
|
||||
*
|
||||
* @see #SPLIT_PANE_EXPANDABLE_SIDE
|
||||
* @since 2.2
|
||||
*/
|
||||
String SPLIT_PANE_EXPANDABLE_SIDE_LEFT = "left";
|
||||
|
||||
/**
|
||||
* Allow expanding only right/bottom side of the split pane.
|
||||
*
|
||||
* @see #SPLIT_PANE_EXPANDABLE_SIDE
|
||||
* @since 2.2
|
||||
*/
|
||||
String SPLIT_PANE_EXPANDABLE_SIDE_RIGHT = "right";
|
||||
|
||||
//---- JTabbedPane --------------------------------------------------------
|
||||
|
||||
/**
|
||||
@@ -958,7 +992,22 @@ public interface FlatClientProperties
|
||||
//---- JToggleButton ------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Height of underline if toggle button type is {@link #BUTTON_TYPE_TAB}.
|
||||
* Placement of underline if toggle button type is {@link #BUTTON_TYPE_TAB}
|
||||
* <p>
|
||||
* <strong>Component</strong> {@link javax.swing.JToggleButton}<br>
|
||||
* <strong>Value type</strong> {@link java.lang.Integer}<br>
|
||||
* <strong>SupportedValues:</strong>
|
||||
* {@link SwingConstants#BOTTOM} (default)
|
||||
* {@link SwingConstants#TOP},
|
||||
* {@link SwingConstants#LEFT} or
|
||||
* {@link SwingConstants#RIGHT}
|
||||
*
|
||||
* @since 2.3
|
||||
*/
|
||||
String TAB_BUTTON_UNDERLINE_PLACEMENT = "JToggleButton.tab.underlinePlacement";
|
||||
|
||||
/**
|
||||
* Thickness of underline if toggle button type is {@link #BUTTON_TYPE_TAB}.
|
||||
* <p>
|
||||
* <strong>Component</strong> {@link javax.swing.JToggleButton}<br>
|
||||
* <strong>Value type</strong> {@link java.lang.Integer}
|
||||
|
||||
@@ -103,7 +103,7 @@ public abstract class FlatLaf
|
||||
|
||||
private PopupFactory oldPopupFactory;
|
||||
private MnemonicHandler mnemonicHandler;
|
||||
private SubMenuUsabilityHelper subMenuUsabilityHelper;
|
||||
private boolean subMenuUsabilityHelperInstalled;
|
||||
|
||||
private Consumer<UIDefaults> postInitialization;
|
||||
private List<Function<Object, Object>> uiDefaultsGetters;
|
||||
@@ -232,6 +232,15 @@ public abstract class FlatLaf
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
// do not initialize if this is not the current look and feel
|
||||
// This is only necessary for special Laf usage. E.g. in GUI builders,
|
||||
// which may use multiple Lafs and may invoke this method directly.
|
||||
// This avoids that listeners and factories are installed multiple times.
|
||||
// In case of the NetBeans GUI builder, which does not invoke uninitialize(),
|
||||
// this also avoids that listeners stay registered in the system.
|
||||
if( UIManager.getLookAndFeel() != this )
|
||||
return;
|
||||
|
||||
if( SystemInfo.isMacOS )
|
||||
initializeAqua();
|
||||
|
||||
@@ -246,8 +255,7 @@ public abstract class FlatLaf
|
||||
mnemonicHandler.install();
|
||||
|
||||
// install submenu usability helper
|
||||
subMenuUsabilityHelper = new SubMenuUsabilityHelper();
|
||||
subMenuUsabilityHelper.install();
|
||||
subMenuUsabilityHelperInstalled = SubMenuUsabilityHelper.install();
|
||||
|
||||
// listen to desktop property changes to update UI if system font or scaling changes
|
||||
if( SystemInfo.isWindows ) {
|
||||
@@ -304,6 +312,10 @@ public abstract class FlatLaf
|
||||
|
||||
@Override
|
||||
public void uninitialize() {
|
||||
// do not uninitialize if this is not the current look and feel
|
||||
if( UIManager.getLookAndFeel() != this )
|
||||
return;
|
||||
|
||||
// remove desktop property listener
|
||||
if( desktopPropertyListener != null ) {
|
||||
Toolkit toolkit = Toolkit.getDefaultToolkit();
|
||||
@@ -329,9 +341,9 @@ public abstract class FlatLaf
|
||||
}
|
||||
|
||||
// uninstall submenu usability helper
|
||||
if( subMenuUsabilityHelper != null ) {
|
||||
subMenuUsabilityHelper.uninstall();
|
||||
subMenuUsabilityHelper = null;
|
||||
if( subMenuUsabilityHelperInstalled ) {
|
||||
SubMenuUsabilityHelper.uninstall();
|
||||
subMenuUsabilityHelperInstalled = false;
|
||||
}
|
||||
|
||||
// restore default link color
|
||||
|
||||
@@ -37,6 +37,7 @@ import com.formdev.flatlaf.json.ParseException;
|
||||
import com.formdev.flatlaf.util.ColorFunctions;
|
||||
import com.formdev.flatlaf.util.LoggingFacade;
|
||||
import com.formdev.flatlaf.util.StringUtils;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
|
||||
/**
|
||||
* This class supports loading IntelliJ .theme.json files and using them as a Laf.
|
||||
@@ -162,8 +163,11 @@ public class IntelliJTheme
|
||||
applyCheckBoxColors( defaults );
|
||||
|
||||
// copy values
|
||||
for( Map.Entry<String, String> e : uiKeyCopying.entrySet() )
|
||||
defaults.put( e.getKey(), defaults.get( e.getValue() ) );
|
||||
for( Map.Entry<String, String> e : uiKeyCopying.entrySet() ) {
|
||||
Object value = defaults.get( e.getValue() );
|
||||
if( value != null )
|
||||
defaults.put( e.getKey(), value );
|
||||
}
|
||||
|
||||
// IDEA does not paint button background if disabled, but FlatLaf does
|
||||
Object panelBackground = defaults.get( "Panel.background" );
|
||||
@@ -311,8 +315,19 @@ public class IntelliJTheme
|
||||
@SuppressWarnings( "unchecked" )
|
||||
private void apply( String key, Object value, UIDefaults defaults, ArrayList<Object> defaultsKeysCache, Set<String> uiKeys ) {
|
||||
if( value instanceof Map ) {
|
||||
for( Map.Entry<String, Object> e : ((Map<String, Object>)value).entrySet() )
|
||||
apply( key + '.' + e.getKey(), e.getValue(), defaults, defaultsKeysCache, uiKeys );
|
||||
Map<String, Object> map = (Map<String, Object>)value;
|
||||
if( map.containsKey( "os.default" ) || map.containsKey( "os.windows" ) || map.containsKey( "os.mac" ) || map.containsKey( "os.linux" ) ) {
|
||||
String osKey = SystemInfo.isWindows ? "os.windows"
|
||||
: SystemInfo.isMacOS ? "os.mac"
|
||||
: SystemInfo.isLinux ? "os.linux" : null;
|
||||
if( osKey != null && map.containsKey( osKey ) )
|
||||
apply( key, map.get( osKey ), defaults, defaultsKeysCache, uiKeys );
|
||||
else if( map.containsKey( "os.default" ) )
|
||||
apply( key, map.get( "os.default" ), defaults, defaultsKeysCache, uiKeys );
|
||||
} else {
|
||||
for( Map.Entry<String, Object> e : map.entrySet() )
|
||||
apply( key + '.' + e.getKey(), e.getValue(), defaults, defaultsKeysCache, uiKeys );
|
||||
}
|
||||
} else {
|
||||
if( "".equals( value ) )
|
||||
return; // ignore empty value
|
||||
@@ -612,6 +627,11 @@ public class IntelliJTheme
|
||||
uiKeyCopying.put( "Spinner.buttonSeparatorColor", "Component.borderColor" );
|
||||
uiKeyCopying.put( "Spinner.buttonDisabledSeparatorColor", "Component.disabledBorderColor" );
|
||||
|
||||
// TabbedPane
|
||||
uiKeyCopying.put( "TabbedPane.selectedBackground", "DefaultTabs.underlinedTabBackground" );
|
||||
uiKeyCopying.put( "TabbedPane.selectedForeground", "DefaultTabs.underlinedTabForeground" );
|
||||
uiKeyCopying.put( "TabbedPane.inactiveUnderlineColor", "DefaultTabs.inactiveUnderlineColor" );
|
||||
|
||||
// TitlePane
|
||||
uiKeyCopying.put( "TitlePane.inactiveBackground", "TitlePane.background" );
|
||||
uiKeyMapping.put( "TitlePane.infoForeground", "TitlePane.foreground" );
|
||||
|
||||
@@ -59,6 +59,11 @@ class SubMenuUsabilityHelper
|
||||
private static final String KEY_USE_SAFE_TRIANGLE = "Menu.useSafeTriangle";
|
||||
private static final String KEY_SHOW_SAFE_TRIANGLE = "FlatLaf.debug.menu.showSafeTriangle";
|
||||
|
||||
// Using a static field to ensure that there is only one instance in the system.
|
||||
// Multiple instances would freeze the application.
|
||||
// https://github.com/apache/netbeans/issues/4231#issuecomment-1179616607
|
||||
private static SubMenuUsabilityHelper instance;
|
||||
|
||||
private SubMenuEventQueue subMenuEventQueue;
|
||||
private SafeTrianglePainter safeTrianglePainter;
|
||||
private boolean changePending;
|
||||
@@ -74,13 +79,22 @@ class SubMenuUsabilityHelper
|
||||
|
||||
private Rectangle invokerBounds;
|
||||
|
||||
void install() {
|
||||
MenuSelectionManager.defaultManager().addChangeListener( this );
|
||||
static synchronized boolean install() {
|
||||
if( instance != null )
|
||||
return false;
|
||||
|
||||
instance = new SubMenuUsabilityHelper();
|
||||
MenuSelectionManager.defaultManager().addChangeListener( instance );
|
||||
return true;
|
||||
}
|
||||
|
||||
void uninstall() {
|
||||
MenuSelectionManager.defaultManager().removeChangeListener( this );
|
||||
uninstallEventQueue();
|
||||
static synchronized void uninstall() {
|
||||
if( instance == null )
|
||||
return;
|
||||
|
||||
MenuSelectionManager.defaultManager().removeChangeListener( instance );
|
||||
instance.uninstallEventQueue();
|
||||
instance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -466,6 +466,10 @@ class UIDefaultsLoader
|
||||
if( knownValueTypes == null ) {
|
||||
// create lazy
|
||||
knownValueTypes = new HashMap<>();
|
||||
// system colors
|
||||
knownValueTypes.put( "activeCaptionBorder", ValueType.COLOR );
|
||||
knownValueTypes.put( "inactiveCaptionBorder", ValueType.COLOR );
|
||||
knownValueTypes.put( "windowBorder", ValueType.COLOR );
|
||||
// SplitPane
|
||||
knownValueTypes.put( "SplitPane.dividerSize", ValueType.INTEGER );
|
||||
knownValueTypes.put( "SplitPaneDivider.gripDotSize", ValueType.INTEGER );
|
||||
@@ -780,6 +784,7 @@ class UIDefaultsLoader
|
||||
case "tint": return parseColorMix( "#fff", params, resolver, reportError );
|
||||
case "shade": return parseColorMix( "#000", params, resolver, reportError );
|
||||
case "contrast": return parseColorContrast( params, resolver, reportError );
|
||||
case "over": return parseColorOver( params, resolver, reportError );
|
||||
}
|
||||
} finally {
|
||||
parseColorDepth--;
|
||||
@@ -847,7 +852,7 @@ class UIDefaultsLoader
|
||||
int lightness = parsePercentage( params.get( 2 ) );
|
||||
int alpha = hasAlpha ? parsePercentage( params.get( 3 ) ) : 100;
|
||||
|
||||
float[] hsl = new float[] { hue, saturation, lightness };
|
||||
float[] hsl = { hue, saturation, lightness };
|
||||
return new ColorUIResource( HSLColor.toRGB( hsl, alpha / 100f ) );
|
||||
}
|
||||
|
||||
@@ -1041,6 +1046,33 @@ class UIDefaultsLoader
|
||||
return parseColorOrFunction( resolver.apply( darkOrLightColor ), resolver, reportError );
|
||||
}
|
||||
|
||||
/**
|
||||
* Syntax: over(foreground,background)
|
||||
* - foreground: a foreground color (e.g. #f00) or a color function;
|
||||
* the alpha of this color is used as weight to mix the two colors
|
||||
* - background: a background color (e.g. #f00) or a color function
|
||||
*/
|
||||
private static Object parseColorOver( List<String> params, Function<String, String> resolver, boolean reportError ) {
|
||||
String foregroundStr = params.get( 0 );
|
||||
String backgroundStr = params.get( 1 );
|
||||
|
||||
// parse foreground color
|
||||
ColorUIResource foreground = (ColorUIResource) parseColorOrFunction( resolver.apply( foregroundStr ), resolver, reportError );
|
||||
if( foreground == null || foreground.getAlpha() == 255 )
|
||||
return foreground;
|
||||
|
||||
Color foreground2 = new Color( foreground.getRGB() );
|
||||
|
||||
// parse background color
|
||||
ColorUIResource background = (ColorUIResource) parseColorOrFunction( resolver.apply( backgroundStr ), resolver, reportError );
|
||||
if( background == null )
|
||||
return foreground2;
|
||||
|
||||
// create new color
|
||||
float weight = foreground.getAlpha() / 255f;
|
||||
return new ColorUIResource( ColorFunctions.mix( foreground2, background, weight ) );
|
||||
}
|
||||
|
||||
private static Object parseFunctionBaseColor( String colorStr, ColorFunction function,
|
||||
boolean derived, Function<String, String> resolver, boolean reportError )
|
||||
{
|
||||
|
||||
@@ -42,6 +42,7 @@ import javax.swing.JTextField;
|
||||
import javax.swing.JToggleButton;
|
||||
import javax.swing.JToolBar;
|
||||
import javax.swing.LookAndFeel;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.plaf.ButtonUI;
|
||||
@@ -77,20 +78,27 @@ import com.formdev.flatlaf.util.UIScale;
|
||||
* @uiDefault Button.startBackground Color optional; if set, a gradient paint is used and Button.background is ignored
|
||||
* @uiDefault Button.endBackground Color optional; if set, a gradient paint is used
|
||||
* @uiDefault Button.focusedBackground Color optional
|
||||
* @uiDefault Button.focusedForeground Color optional
|
||||
* @uiDefault Button.hoverBackground Color optional
|
||||
* @uiDefault Button.hoverForeground Color optional
|
||||
* @uiDefault Button.pressedBackground Color optional
|
||||
* @uiDefault Button.pressedForeground Color optional
|
||||
* @uiDefault Button.selectedBackground Color
|
||||
* @uiDefault Button.selectedForeground Color
|
||||
* @uiDefault Button.disabledBackground Color optional
|
||||
* @uiDefault Button.disabledText Color
|
||||
* @uiDefault Button.disabledSelectedBackground Color
|
||||
* @uiDefault Button.disabledSelectedForeground Color optional
|
||||
* @uiDefault Button.default.background Color
|
||||
* @uiDefault Button.default.startBackground Color optional; if set, a gradient paint is used and Button.default.background is ignored
|
||||
* @uiDefault Button.default.endBackground Color optional; if set, a gradient paint is used
|
||||
* @uiDefault Button.default.foreground Color
|
||||
* @uiDefault Button.default.focusedBackground Color optional
|
||||
* @uiDefault Button.default.focusedForeground Color optional
|
||||
* @uiDefault Button.default.hoverBackground Color optional
|
||||
* @uiDefault Button.default.hoverForeground Color optional
|
||||
* @uiDefault Button.default.pressedBackground Color optional
|
||||
* @uiDefault Button.default.pressedForeground Color optional
|
||||
* @uiDefault Button.default.boldText boolean
|
||||
* @uiDefault Button.paintShadow boolean default is false
|
||||
* @uiDefault Button.shadowWidth int default is 2
|
||||
@@ -98,8 +106,13 @@ import com.formdev.flatlaf.util.UIScale;
|
||||
* @uiDefault Button.default.shadowColor Color optional
|
||||
* @uiDefault Button.toolbar.spacingInsets Insets
|
||||
* @uiDefault Button.toolbar.hoverBackground Color
|
||||
* @uiDefault Button.toolbar.hoverForeground Color optional
|
||||
* @uiDefault Button.toolbar.pressedBackground Color
|
||||
* @uiDefault Button.toolbar.pressedForeground Color optional
|
||||
* @uiDefault Button.toolbar.selectedBackground Color
|
||||
* @uiDefault Button.toolbar.selectedForeground Color optional
|
||||
* @uiDefault Button.toolbar.disabledSelectedBackground Color optional
|
||||
* @uiDefault Button.toolbar.disabledSelectedForeground Color optional
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
@@ -116,20 +129,27 @@ public class FlatButtonUI
|
||||
protected Color startBackground;
|
||||
protected Color endBackground;
|
||||
@Styleable protected Color focusedBackground;
|
||||
/** @since 2.3 */ @Styleable protected Color focusedForeground;
|
||||
@Styleable protected Color hoverBackground;
|
||||
/** @since 2.3 */ @Styleable protected Color hoverForeground;
|
||||
@Styleable protected Color pressedBackground;
|
||||
/** @since 2.3 */ @Styleable protected Color pressedForeground;
|
||||
@Styleable protected Color selectedBackground;
|
||||
@Styleable protected Color selectedForeground;
|
||||
@Styleable protected Color disabledBackground;
|
||||
@Styleable protected Color disabledText;
|
||||
@Styleable protected Color disabledSelectedBackground;
|
||||
/** @since 2.3 */ @Styleable protected Color disabledSelectedForeground;
|
||||
|
||||
@Styleable(dot=true) protected Color defaultBackground;
|
||||
protected Color defaultEndBackground;
|
||||
@Styleable(dot=true) protected Color defaultForeground;
|
||||
@Styleable(dot=true) protected Color defaultFocusedBackground;
|
||||
/** @since 2.3 */ @Styleable(dot=true) protected Color defaultFocusedForeground;
|
||||
@Styleable(dot=true) protected Color defaultHoverBackground;
|
||||
/** @since 2.3 */ @Styleable(dot=true) protected Color defaultHoverForeground;
|
||||
@Styleable(dot=true) protected Color defaultPressedBackground;
|
||||
/** @since 2.3 */ @Styleable(dot=true) protected Color defaultPressedForeground;
|
||||
@Styleable(dot=true) protected boolean defaultBoldText;
|
||||
|
||||
@Styleable protected boolean paintShadow;
|
||||
@@ -138,8 +158,13 @@ public class FlatButtonUI
|
||||
@Styleable(dot=true) protected Color defaultShadowColor;
|
||||
|
||||
@Styleable(dot=true) protected Color toolbarHoverBackground;
|
||||
/** @since 2.3 */ @Styleable(dot=true) protected Color toolbarHoverForeground;
|
||||
@Styleable(dot=true) protected Color toolbarPressedBackground;
|
||||
/** @since 2.3 */ @Styleable(dot=true) protected Color toolbarPressedForeground;
|
||||
@Styleable(dot=true) protected Color toolbarSelectedBackground;
|
||||
/** @since 2.3 */ @Styleable(dot=true) protected Color toolbarSelectedForeground;
|
||||
/** @since 2.3 */ @Styleable(dot=true) protected Color toolbarDisabledSelectedBackground;
|
||||
/** @since 2.3 */ @Styleable(dot=true) protected Color toolbarDisabledSelectedForeground;
|
||||
|
||||
// only used via styling (not in UI defaults, but has likewise client properties)
|
||||
/** @since 2 */ @Styleable protected String buttonType;
|
||||
@@ -189,20 +214,27 @@ public class FlatButtonUI
|
||||
startBackground = UIManager.getColor( prefix + "startBackground" );
|
||||
endBackground = UIManager.getColor( prefix + "endBackground" );
|
||||
focusedBackground = UIManager.getColor( prefix + "focusedBackground" );
|
||||
focusedForeground = UIManager.getColor( prefix + "focusedForeground" );
|
||||
hoverBackground = UIManager.getColor( prefix + "hoverBackground" );
|
||||
hoverForeground = UIManager.getColor( prefix + "hoverForeground" );
|
||||
pressedBackground = UIManager.getColor( prefix + "pressedBackground" );
|
||||
pressedForeground = UIManager.getColor( prefix + "pressedForeground" );
|
||||
selectedBackground = UIManager.getColor( prefix + "selectedBackground" );
|
||||
selectedForeground = UIManager.getColor( prefix + "selectedForeground" );
|
||||
disabledBackground = UIManager.getColor( prefix + "disabledBackground" );
|
||||
disabledText = UIManager.getColor( prefix + "disabledText" );
|
||||
disabledSelectedBackground = UIManager.getColor( prefix + "disabledSelectedBackground" );
|
||||
disabledSelectedForeground = UIManager.getColor( prefix + "disabledSelectedForeground" );
|
||||
|
||||
defaultBackground = FlatUIUtils.getUIColor( "Button.default.startBackground", "Button.default.background" );
|
||||
defaultEndBackground = UIManager.getColor( "Button.default.endBackground" );
|
||||
defaultForeground = UIManager.getColor( "Button.default.foreground" );
|
||||
defaultFocusedBackground = UIManager.getColor( "Button.default.focusedBackground" );
|
||||
defaultFocusedForeground = UIManager.getColor( "Button.default.focusedForeground" );
|
||||
defaultHoverBackground = UIManager.getColor( "Button.default.hoverBackground" );
|
||||
defaultHoverForeground = UIManager.getColor( "Button.default.hoverForeground" );
|
||||
defaultPressedBackground = UIManager.getColor( "Button.default.pressedBackground" );
|
||||
defaultPressedForeground = UIManager.getColor( "Button.default.pressedForeground" );
|
||||
defaultBoldText = UIManager.getBoolean( "Button.default.boldText" );
|
||||
|
||||
paintShadow = UIManager.getBoolean( "Button.paintShadow" );
|
||||
@@ -211,8 +243,13 @@ public class FlatButtonUI
|
||||
defaultShadowColor = UIManager.getColor( "Button.default.shadowColor" );
|
||||
|
||||
toolbarHoverBackground = UIManager.getColor( prefix + "toolbar.hoverBackground" );
|
||||
toolbarHoverForeground = UIManager.getColor( prefix + "toolbar.hoverForeground" );
|
||||
toolbarPressedBackground = UIManager.getColor( prefix + "toolbar.pressedBackground" );
|
||||
toolbarPressedForeground = UIManager.getColor( prefix + "toolbar.pressedForeground" );
|
||||
toolbarSelectedBackground = UIManager.getColor( prefix + "toolbar.selectedBackground" );
|
||||
toolbarSelectedForeground = UIManager.getColor( prefix + "toolbar.selectedForeground" );
|
||||
toolbarDisabledSelectedBackground = UIManager.getColor( prefix + "toolbar.disabledSelectedBackground" );
|
||||
toolbarDisabledSelectedForeground = UIManager.getColor( prefix + "toolbar.disabledSelectedForeground" );
|
||||
|
||||
helpButtonIcon = UIManager.getIcon( "HelpButton.icon" );
|
||||
defaultMargin = UIManager.getInsets( prefix + "margin" );
|
||||
@@ -494,6 +531,23 @@ public class FlatButtonUI
|
||||
super.paint( FlatLabelUI.createGraphicsHTMLTextYCorrection( g, c ), c );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintIcon( Graphics g, JComponent c, Rectangle iconRect ) {
|
||||
// correct icon location when using bold font for default button
|
||||
int xOffset = defaultBoldPlainWidthDiff( c ) / 2;
|
||||
if( xOffset > 0 ) {
|
||||
boolean ltr = c.getComponentOrientation().isLeftToRight();
|
||||
switch( ((AbstractButton)c).getHorizontalTextPosition() ) {
|
||||
case SwingConstants.RIGHT: iconRect.x -= xOffset; break;
|
||||
case SwingConstants.LEFT: iconRect.x += xOffset; break;
|
||||
case SwingConstants.TRAILING: iconRect.x -= ltr ? xOffset : -xOffset; break;
|
||||
case SwingConstants.LEADING: iconRect.x += ltr ? xOffset : -xOffset; break;
|
||||
}
|
||||
}
|
||||
|
||||
super.paintIcon( g, c, iconRect );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintText( Graphics g, AbstractButton b, Rectangle textRect, String text ) {
|
||||
if( isHelpButton( b ) )
|
||||
@@ -514,6 +568,8 @@ public class FlatButtonUI
|
||||
}
|
||||
|
||||
public static void paintText( Graphics g, AbstractButton b, Rectangle textRect, String text, Color foreground ) {
|
||||
if(foreground == null)
|
||||
foreground=Color.red;
|
||||
FontMetrics fm = b.getFontMetrics( b.getFont() );
|
||||
int mnemonicIndex = FlatLaf.isShowMnemonics() ? b.getDisplayedMnemonicIndex() : -1;
|
||||
|
||||
@@ -527,11 +583,14 @@ public class FlatButtonUI
|
||||
|
||||
// selected state
|
||||
if( ((AbstractButton)c).isSelected() ) {
|
||||
// in toolbar use same background colors for disabled and enabled because
|
||||
// in toolbar, if toolbarDisabledSelectedBackground is null,
|
||||
// use same background colors for disabled and enabled because
|
||||
// we assume that toolbar icon is shown disabled
|
||||
return buttonStateColor( c,
|
||||
toolBarButton ? toolbarSelectedBackground : selectedBackground,
|
||||
toolBarButton ? toolbarSelectedBackground : disabledSelectedBackground,
|
||||
toolBarButton
|
||||
? (toolbarDisabledSelectedBackground != null ? toolbarDisabledSelectedBackground : toolbarSelectedBackground)
|
||||
: disabledSelectedBackground,
|
||||
null,
|
||||
null,
|
||||
toolBarButton ? toolbarPressedBackground : pressedBackground );
|
||||
@@ -596,18 +655,48 @@ public class FlatButtonUI
|
||||
}
|
||||
|
||||
protected Color getForeground( JComponent c ) {
|
||||
if( !c.isEnabled() )
|
||||
return disabledText;
|
||||
boolean toolBarButton = isToolBarButton( c ) || isBorderlessButton( c );
|
||||
|
||||
if( ((AbstractButton)c).isSelected() && !(isToolBarButton( c ) || isBorderlessButton( c )) )
|
||||
return selectedForeground;
|
||||
// selected state
|
||||
if( ((AbstractButton)c).isSelected() ) {
|
||||
return buttonStateColor( c,
|
||||
toolBarButton
|
||||
? (toolbarSelectedForeground != null ? toolbarSelectedForeground : c.getForeground())
|
||||
: selectedForeground,
|
||||
toolBarButton
|
||||
? (toolbarDisabledSelectedForeground != null ? toolbarDisabledSelectedForeground : disabledText)
|
||||
: (disabledSelectedForeground != null ? disabledSelectedForeground : disabledText),
|
||||
null,
|
||||
null,
|
||||
toolBarButton ? toolbarPressedForeground : pressedForeground );
|
||||
}
|
||||
|
||||
// toolbar button
|
||||
if( toolBarButton ) {
|
||||
return buttonStateColor( c,
|
||||
c.getForeground(),
|
||||
disabledText,
|
||||
null,
|
||||
toolbarHoverForeground,
|
||||
toolbarPressedForeground );
|
||||
}
|
||||
|
||||
boolean def = isDefaultButton( c );
|
||||
return buttonStateColor( c,
|
||||
getForegroundBase( c, def ),
|
||||
disabledText,
|
||||
isCustomForeground( c.getForeground() ) ? null : (def ? defaultFocusedForeground : focusedForeground),
|
||||
def ? defaultHoverForeground : hoverForeground,
|
||||
def ? defaultPressedForeground : pressedForeground );
|
||||
}
|
||||
|
||||
/** @since 2.3 */
|
||||
protected Color getForegroundBase( JComponent c, boolean def ) {
|
||||
// use component foreground if explicitly set
|
||||
Color fg = c.getForeground();
|
||||
if( isCustomForeground( fg ) )
|
||||
return fg;
|
||||
|
||||
boolean def = isDefaultButton( c );
|
||||
return def ? defaultForeground : fg;
|
||||
}
|
||||
|
||||
@@ -624,6 +713,9 @@ public class FlatButtonUI
|
||||
if( prefSize == null )
|
||||
return null;
|
||||
|
||||
// increase width when using bold font for default button
|
||||
prefSize.width += defaultBoldPlainWidthDiff( c );
|
||||
|
||||
// make square or apply minimum width/height
|
||||
boolean isIconOnlyOrSingleCharacter = isIconOnlyOrSingleCharacterButton( c );
|
||||
if( clientPropertyBoolean( c, SQUARE_SIZE, squareSize ) ) {
|
||||
@@ -644,6 +736,23 @@ public class FlatButtonUI
|
||||
return prefSize;
|
||||
}
|
||||
|
||||
private int defaultBoldPlainWidthDiff( JComponent c ) {
|
||||
if( defaultBoldText && isDefaultButton( c ) && c.getFont() instanceof UIResource ) {
|
||||
String text = ((AbstractButton)c).getText();
|
||||
if( text == null || text.isEmpty() )
|
||||
return 0;
|
||||
|
||||
Font font = c.getFont();
|
||||
Font boldFont = font.deriveFont( Font.BOLD );
|
||||
int boldWidth = c.getFontMetrics( boldFont ).stringWidth( text );
|
||||
int plainWidth = c.getFontMetrics( font ).stringWidth( text );
|
||||
if( boldWidth > plainWidth )
|
||||
return boldWidth - plainWidth;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private boolean hasDefaultMargins( JComponent c ) {
|
||||
Insets margin = ((AbstractButton)c).getMargin();
|
||||
return margin instanceof UIResource && Objects.equals( margin, defaultMargin );
|
||||
|
||||
@@ -86,6 +86,11 @@ import com.formdev.flatlaf.util.SystemInfo;
|
||||
* @uiDefault ComboBox.padding Insets
|
||||
* @uiDefault ComboBox.squareButton boolean default is true
|
||||
*
|
||||
* <!-- BasicComboPopup -->
|
||||
*
|
||||
* @uiDefault ComboBox.selectionBackground Color
|
||||
* @uiDefault ComboBox.selectionForeground Color
|
||||
*
|
||||
* <!-- FlatComboBoxUI -->
|
||||
*
|
||||
* @uiDefault ComboBox.minimumWidth int
|
||||
@@ -603,7 +608,7 @@ public class FlatComboBoxUI
|
||||
|
||||
boolean shouldValidate = (c instanceof JPanel);
|
||||
|
||||
paddingBorder.install( c );
|
||||
paddingBorder.install( c, 0 );
|
||||
currentValuePane.paintComponent( g, c, comboBox, bounds.x, bounds.y, bounds.width, bounds.height, shouldValidate );
|
||||
paddingBorder.uninstall();
|
||||
|
||||
@@ -677,7 +682,7 @@ public class FlatComboBoxUI
|
||||
|
||||
@Override
|
||||
protected Dimension getSizeForComponent( Component comp ) {
|
||||
paddingBorder.install( comp );
|
||||
paddingBorder.install( comp, 0 );
|
||||
Dimension size = super.getSizeForComponent( comp );
|
||||
paddingBorder.uninstall();
|
||||
return size;
|
||||
@@ -895,7 +900,7 @@ public class FlatComboBoxUI
|
||||
Component c = renderer.getListCellRendererComponent( list, value, index, isSelected, cellHasFocus );
|
||||
c.applyComponentOrientation( comboBox.getComponentOrientation() );
|
||||
|
||||
paddingBorder.install( c );
|
||||
paddingBorder.install( c, Math.round( FlatUIUtils.getBorderFocusWidth( comboBox ) ) );
|
||||
|
||||
return c;
|
||||
}
|
||||
@@ -918,6 +923,7 @@ public class FlatComboBoxUI
|
||||
private Insets padding;
|
||||
private JComponent rendererComponent;
|
||||
private Border rendererBorder;
|
||||
private int focusWidth;
|
||||
|
||||
CellPaddingBorder( Insets padding ) {
|
||||
this.padding = padding;
|
||||
@@ -925,10 +931,12 @@ public class FlatComboBoxUI
|
||||
|
||||
// using synchronized to avoid problems with code that modifies combo box
|
||||
// (model, selection, etc) not on AWT thread (which should be not done)
|
||||
synchronized void install( Component c ) {
|
||||
synchronized void install( Component c, int focusWidth ) {
|
||||
if( !(c instanceof JComponent) )
|
||||
return;
|
||||
|
||||
this.focusWidth = focusWidth;
|
||||
|
||||
JComponent jc = (JComponent) c;
|
||||
Border oldBorder = jc.getBorder();
|
||||
if( oldBorder == this )
|
||||
@@ -982,6 +990,12 @@ public class FlatComboBoxUI
|
||||
insets.bottom = padding.bottom;
|
||||
insets.right = padding.right;
|
||||
}
|
||||
|
||||
// if used in popup list, add focus width for exact vertical alignment
|
||||
// of text in popup list with text in combobox
|
||||
insets.left += focusWidth;
|
||||
insets.right += focusWidth;
|
||||
|
||||
return insets;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class FlatEmptyBorder
|
||||
protected static Insets scaleInsets( Component c, Insets insets,
|
||||
int top, int left, int bottom, int right )
|
||||
{
|
||||
boolean leftToRight = left == right || c.getComponentOrientation().isLeftToRight();
|
||||
boolean leftToRight = left == right || c == null || c.getComponentOrientation().isLeftToRight();
|
||||
insets.left = scale( leftToRight ? left : right );
|
||||
insets.top = scale( top );
|
||||
insets.right = scale( leftToRight ? right : left );
|
||||
|
||||
@@ -19,11 +19,21 @@ package com.formdev.flatlaf.ui;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Image;
|
||||
import java.awt.Insets;
|
||||
import java.awt.LayoutManager;
|
||||
import java.awt.RenderingHints;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.function.Function;
|
||||
import javax.swing.AbstractButton;
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
import javax.swing.ButtonGroup;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
@@ -34,12 +44,16 @@ import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.JToggleButton;
|
||||
import javax.swing.JToolBar;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.filechooser.FileSystemView;
|
||||
import javax.swing.filechooser.FileView;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.metal.MetalFileChooserUI;
|
||||
import javax.swing.table.TableCellRenderer;
|
||||
import com.formdev.flatlaf.FlatClientProperties;
|
||||
import com.formdev.flatlaf.util.LoggingFacade;
|
||||
import com.formdev.flatlaf.util.ScaledImageIcon;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -133,12 +147,21 @@ import com.formdev.flatlaf.util.UIScale;
|
||||
* @uiDefault FileChooser.listViewActionLabelText String
|
||||
* @uiDefault FileChooser.detailsViewActionLabelText String
|
||||
*
|
||||
* <!-- FlatFileChooserUI -->
|
||||
*
|
||||
* @uiDefault FileChooser.shortcuts.buttonSize Dimension optional; default is 84,64
|
||||
* @uiDefault FileChooser.shortcuts.iconSize Dimension optional; default is 32,32
|
||||
* @uiDefault FileChooser.shortcuts.filesFunction Function<File[], File[]>
|
||||
* @uiDefault FileChooser.shortcuts.displayNameFunction Function<File, String>
|
||||
* @uiDefault FileChooser.shortcuts.iconFunction Function<File, Icon>
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
public class FlatFileChooserUI
|
||||
extends MetalFileChooserUI
|
||||
{
|
||||
private final FlatFileView fileView = new FlatFileView();
|
||||
private FlatShortcutsPanel shortcutsPanel;
|
||||
|
||||
public static ComponentUI createUI( JComponent c ) {
|
||||
return new FlatFileChooserUI( (JFileChooser) c );
|
||||
@@ -153,6 +176,25 @@ public class FlatFileChooserUI
|
||||
super.installComponents( fc );
|
||||
|
||||
patchUI( fc );
|
||||
|
||||
if( !UIManager.getBoolean( "FileChooser.noPlacesBar" ) ) { // same as in Windows L&F
|
||||
FlatShortcutsPanel panel = createShortcutsPanel( fc );
|
||||
if( panel.getComponentCount() > 0 ) {
|
||||
shortcutsPanel = panel;
|
||||
fc.add( shortcutsPanel, BorderLayout.LINE_START );
|
||||
fc.addPropertyChangeListener( shortcutsPanel );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uninstallComponents( JFileChooser fc ) {
|
||||
super.uninstallComponents( fc );
|
||||
|
||||
if( shortcutsPanel != null ) {
|
||||
fc.removePropertyChangeListener( shortcutsPanel );
|
||||
shortcutsPanel = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void patchUI( JFileChooser fc ) {
|
||||
@@ -192,6 +234,25 @@ public class FlatFileChooserUI
|
||||
} catch( ArrayIndexOutOfBoundsException ex ) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
// put north, center and south components into a new panel so that
|
||||
// the shortcuts panel (at west) gets full height
|
||||
LayoutManager layout = fc.getLayout();
|
||||
if( layout instanceof BorderLayout ) {
|
||||
BorderLayout borderLayout = (BorderLayout) layout;
|
||||
borderLayout.setHgap( 8 );
|
||||
|
||||
Component north = borderLayout.getLayoutComponent( BorderLayout.NORTH );
|
||||
Component center = borderLayout.getLayoutComponent( BorderLayout.CENTER );
|
||||
Component south = borderLayout.getLayoutComponent( BorderLayout.SOUTH );
|
||||
if( north != null && center != null && south != null ) {
|
||||
JPanel p = new JPanel( new BorderLayout( 0, 11 ) );
|
||||
p.add( north, BorderLayout.NORTH );
|
||||
p.add( center, BorderLayout.CENTER );
|
||||
p.add( south, BorderLayout.SOUTH );
|
||||
fc.add( p, BorderLayout.CENTER );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -250,9 +311,19 @@ public class FlatFileChooserUI
|
||||
return p;
|
||||
}
|
||||
|
||||
/** @since 2.3 */
|
||||
protected FlatShortcutsPanel createShortcutsPanel( JFileChooser fc ) {
|
||||
return new FlatShortcutsPanel( fc );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize( JComponent c ) {
|
||||
return UIScale.scale( super.getPreferredSize( c ) );
|
||||
Dimension prefSize = super.getPreferredSize( c );
|
||||
Dimension minSize = getMinimumSize( c );
|
||||
int shortcutsPanelWidth = (shortcutsPanel != null) ? shortcutsPanel.getPreferredSize().width : 0;
|
||||
return new Dimension(
|
||||
Math.max( prefSize.width, minSize.width + shortcutsPanelWidth ),
|
||||
Math.max( prefSize.height, minSize.height ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -316,4 +387,234 @@ public class FlatFileChooserUI
|
||||
return icon;
|
||||
}
|
||||
}
|
||||
|
||||
//---- class FlatShortcutsPanel -------------------------------------------
|
||||
|
||||
/** @since 2.3 */
|
||||
public static class FlatShortcutsPanel
|
||||
extends JToolBar
|
||||
implements PropertyChangeListener
|
||||
{
|
||||
private final JFileChooser fc;
|
||||
|
||||
private final Dimension buttonSize;
|
||||
private final Dimension iconSize;
|
||||
private final Function<File[], File[]> filesFunction;
|
||||
private final Function<File, String> displayNameFunction;
|
||||
private final Function<File, Icon> iconFunction;
|
||||
|
||||
protected final File[] files;
|
||||
protected final JToggleButton[] buttons;
|
||||
protected final ButtonGroup buttonGroup;
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
public FlatShortcutsPanel( JFileChooser fc ) {
|
||||
super( JToolBar.VERTICAL );
|
||||
this.fc = fc;
|
||||
setFloatable( false );
|
||||
|
||||
buttonSize = UIScale.scale( getUIDimension( "FileChooser.shortcuts.buttonSize", 84, 64 ) );
|
||||
iconSize = getUIDimension( "FileChooser.shortcuts.iconSize", 32, 32 );
|
||||
|
||||
filesFunction = (Function<File[], File[]>) UIManager.get( "FileChooser.shortcuts.filesFunction" );
|
||||
displayNameFunction = (Function<File, String>) UIManager.get( "FileChooser.shortcuts.displayNameFunction" );
|
||||
iconFunction = (Function<File, Icon>) UIManager.get( "FileChooser.shortcuts.iconFunction" );
|
||||
|
||||
FileSystemView fsv = fc.getFileSystemView();
|
||||
File[] files = getChooserShortcutPanelFiles( fsv );
|
||||
if( filesFunction != null )
|
||||
files = filesFunction.apply( files );
|
||||
this.files = files;
|
||||
|
||||
// create toolbar buttons
|
||||
buttons = new JToggleButton[files.length];
|
||||
buttonGroup = new ButtonGroup();
|
||||
for( int i = 0; i < files.length; i++ ) {
|
||||
// wrap drive path
|
||||
if( fsv.isFileSystemRoot( files[i] ) )
|
||||
files[i] = fsv.createFileObject( files[i].getAbsolutePath() );
|
||||
|
||||
File file = files[i];
|
||||
String name = getDisplayName( fsv, file );
|
||||
Icon icon = getIcon( fsv, file );
|
||||
|
||||
// remove path from name
|
||||
int lastSepIndex = name.lastIndexOf( File.separatorChar );
|
||||
if( lastSepIndex >= 0 && lastSepIndex < name.length() - 1 )
|
||||
name = name.substring( lastSepIndex + 1 );
|
||||
|
||||
// scale icon (if necessary)
|
||||
if( icon instanceof ImageIcon )
|
||||
icon = new ScaledImageIcon( (ImageIcon) icon, iconSize.width, iconSize.height );
|
||||
else if( icon != null )
|
||||
icon = new ShortcutIcon( icon, iconSize.width, iconSize.height );
|
||||
|
||||
// create button
|
||||
JToggleButton button = createButton( name, icon );
|
||||
button.addActionListener( e -> {
|
||||
fc.setCurrentDirectory( file );
|
||||
} );
|
||||
|
||||
add( button );
|
||||
buttonGroup.add( button );
|
||||
buttons[i] = button;
|
||||
}
|
||||
|
||||
directoryChanged( fc.getCurrentDirectory() );
|
||||
}
|
||||
|
||||
private Dimension getUIDimension( String key, int defaultWidth, int defaultHeight ) {
|
||||
Dimension size = UIManager.getDimension( key );
|
||||
if( size == null )
|
||||
size = new Dimension( defaultWidth, defaultHeight );
|
||||
return size;
|
||||
}
|
||||
|
||||
protected JToggleButton createButton( String name, Icon icon ) {
|
||||
JToggleButton button = new JToggleButton( name, icon );
|
||||
button.setVerticalTextPosition( SwingConstants.BOTTOM );
|
||||
button.setHorizontalTextPosition( SwingConstants.CENTER );
|
||||
button.setAlignmentX( Component.CENTER_ALIGNMENT );
|
||||
button.setIconTextGap( 0 );
|
||||
button.setPreferredSize( buttonSize );
|
||||
button.setMaximumSize( buttonSize );
|
||||
return button;
|
||||
}
|
||||
|
||||
protected File[] getChooserShortcutPanelFiles( FileSystemView fsv ) {
|
||||
try {
|
||||
if( SystemInfo.isJava_12_orLater ) {
|
||||
Method m = fsv.getClass().getMethod( "getChooserShortcutPanelFiles" );
|
||||
File[] files = (File[]) m.invoke( fsv );
|
||||
|
||||
// on macOS and Linux, files consists only of the user home directory
|
||||
if( files.length == 1 && files[0].equals( new File( System.getProperty( "user.home" ) ) ) )
|
||||
files = new File[0];
|
||||
|
||||
return files;
|
||||
} else if( SystemInfo.isWindows ) {
|
||||
Class<?> cls = Class.forName( "sun.awt.shell.ShellFolder" );
|
||||
Method m = cls.getMethod( "get", String.class );
|
||||
return (File[]) m.invoke( null, "fileChooserShortcutPanelFolders" );
|
||||
}
|
||||
} catch( IllegalAccessException ex ) {
|
||||
// do not log because access may be denied via VM option '--illegal-access=deny'
|
||||
} catch( Exception ex ) {
|
||||
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||
}
|
||||
|
||||
// fallback
|
||||
return new File[0];
|
||||
}
|
||||
|
||||
protected String getDisplayName( FileSystemView fsv, File file ) {
|
||||
if( displayNameFunction != null ) {
|
||||
String name = displayNameFunction.apply( file );
|
||||
if( name != null )
|
||||
return name;
|
||||
}
|
||||
|
||||
return fsv.getSystemDisplayName( file );
|
||||
}
|
||||
|
||||
protected Icon getIcon( FileSystemView fsv, File file ) {
|
||||
if( iconFunction != null ) {
|
||||
Icon icon = iconFunction.apply( file );
|
||||
if( icon != null )
|
||||
return icon;
|
||||
}
|
||||
|
||||
// Java 17+ supports getting larger system icons
|
||||
try {
|
||||
if( SystemInfo.isJava_17_orLater ) {
|
||||
Method m = fsv.getClass().getMethod( "getSystemIcon", File.class, int.class, int.class );
|
||||
return (Icon) m.invoke( fsv, file, iconSize.width, iconSize.height );
|
||||
} else if( iconSize.width > 16 || iconSize.height > 16 ) {
|
||||
Class<?> cls = Class.forName( "sun.awt.shell.ShellFolder" );
|
||||
if( cls.isInstance( file ) ) {
|
||||
Method m = file.getClass().getMethod( "getIcon", boolean.class );
|
||||
m.setAccessible( true );
|
||||
Image image = (Image) m.invoke( file, true );
|
||||
if( image != null )
|
||||
return new ImageIcon( image );
|
||||
}
|
||||
}
|
||||
} catch( IllegalAccessException ex ) {
|
||||
// do not log because access may be denied via VM option '--illegal-access=deny'
|
||||
} catch( Exception ex ) {
|
||||
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||
}
|
||||
|
||||
// get system icon in default size 16x16
|
||||
return fsv.getSystemIcon( file );
|
||||
}
|
||||
|
||||
protected void directoryChanged( File file ) {
|
||||
if( file != null ) {
|
||||
String absolutePath = file.getAbsolutePath();
|
||||
for( int i = 0; i < files.length; i++ ) {
|
||||
// also compare path because otherwise selecting "Documents"
|
||||
// in "Look in" combobox would not select "Documents" shortcut item
|
||||
if( files[i].equals( file ) || files[i].getAbsolutePath().equals( absolutePath ) ) {
|
||||
buttons[i].setSelected( true );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buttonGroup.clearSelection();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChange( PropertyChangeEvent e ) {
|
||||
switch( e.getPropertyName() ) {
|
||||
case JFileChooser.DIRECTORY_CHANGED_PROPERTY:
|
||||
directoryChanged( fc.getCurrentDirectory() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---- class ShortcutIcon -------------------------------------------------
|
||||
|
||||
private static class ShortcutIcon
|
||||
implements Icon
|
||||
{
|
||||
private final Icon icon;
|
||||
private final int iconWidth;
|
||||
private final int iconHeight;
|
||||
|
||||
ShortcutIcon( Icon icon, int iconWidth, int iconHeight ) {
|
||||
this.icon = icon;
|
||||
this.iconWidth = iconWidth;
|
||||
this.iconHeight = iconHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintIcon( Component c, Graphics g, int x, int y ) {
|
||||
Graphics2D g2 = (Graphics2D) g.create();
|
||||
try {
|
||||
// set rendering hint for the case that the icon is a bitmap (not used for vector icons)
|
||||
g2.setRenderingHint( RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC );
|
||||
|
||||
double scale = (double) getIconWidth() / (double) icon.getIconWidth();
|
||||
g2.translate( x, y );
|
||||
g2.scale( scale, scale );
|
||||
|
||||
icon.paintIcon( c, g2, 0, 0 );
|
||||
} finally {
|
||||
g2.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconWidth() {
|
||||
return UIScale.scale( iconWidth );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconHeight() {
|
||||
return UIScale.scale( iconHeight );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,10 @@ package com.formdev.flatlaf.ui;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Container;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Insets;
|
||||
import java.awt.LayoutManager;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
@@ -27,6 +29,7 @@ import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.ActionMap;
|
||||
import javax.swing.BoxLayout;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuBar;
|
||||
@@ -40,11 +43,13 @@ import javax.swing.plaf.ActionMapUIResource;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.UIResource;
|
||||
import javax.swing.plaf.basic.BasicMenuBarUI;
|
||||
import javax.swing.plaf.basic.DefaultMenuLayout;
|
||||
import com.formdev.flatlaf.FlatLaf;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
|
||||
import com.formdev.flatlaf.util.LoggingFacade;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
|
||||
/**
|
||||
* Provides the Flat LaF UI delegate for {@link javax.swing.JMenuBar}.
|
||||
@@ -100,6 +105,10 @@ public class FlatMenuBarUI
|
||||
super.installDefaults();
|
||||
|
||||
LookAndFeel.installProperty( menuBar, "opaque", false );
|
||||
|
||||
LayoutManager layout = menuBar.getLayout();
|
||||
if( layout == null || layout instanceof UIResource )
|
||||
menuBar.setLayout( new FlatMenuBarLayout( menuBar ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -221,6 +230,130 @@ public class FlatMenuBarUI
|
||||
rootPane.getWindowDecorationStyle() != JRootPane.NONE;
|
||||
}
|
||||
|
||||
//---- class FlatMenuBarLayout --------------------------------------------
|
||||
|
||||
/**
|
||||
* @since 2.4
|
||||
*/
|
||||
protected static class FlatMenuBarLayout
|
||||
extends DefaultMenuLayout
|
||||
{
|
||||
public FlatMenuBarLayout( Container target ) {
|
||||
super( target, BoxLayout.LINE_AXIS );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void layoutContainer( Container target ) {
|
||||
super.layoutContainer( target );
|
||||
|
||||
|
||||
// The only purpose of the code below is to make sure that a horizontal glue,
|
||||
// which can be used to move window and displays the window title in embedded menu bar,
|
||||
// is always visible within the menu bar bounds and has a minimum width.
|
||||
// If this is not the case, the horizontal glue is made larger and
|
||||
// components that are on the left side of the glue are made smaller.
|
||||
|
||||
|
||||
// get root pane and check whether this menu bar is the root pane menu bar
|
||||
JRootPane rootPane = SwingUtilities.getRootPane( target );
|
||||
if( rootPane == null || rootPane.getJMenuBar() != target )
|
||||
return;
|
||||
|
||||
// get title pane and check whether menu bar is embedded
|
||||
FlatTitlePane titlePane = FlatRootPaneUI.getTitlePane( rootPane );
|
||||
if( titlePane == null || !titlePane.isMenuBarEmbedded() )
|
||||
return;
|
||||
|
||||
// check whether there is a horizontal glue (used for window title in embedded menu bar)
|
||||
// and check minimum width of horizontal glue
|
||||
Component horizontalGlue = titlePane.findHorizontalGlue( (JMenuBar) target );
|
||||
int minTitleWidth = UIScale.scale( titlePane.titleMinimumWidth );
|
||||
if( horizontalGlue != null && horizontalGlue.getWidth() < minTitleWidth ) {
|
||||
// get index of glue component
|
||||
int glueIndex = -1;
|
||||
Component[] components = target.getComponents();
|
||||
for( int i = components.length - 1; i >= 0; i-- ) {
|
||||
if( components[i] == horizontalGlue ) {
|
||||
glueIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( glueIndex < 0 )
|
||||
return; // should never happen
|
||||
|
||||
if( target.getComponentOrientation().isLeftToRight() ) {
|
||||
// left-to-right
|
||||
|
||||
// make horizontal glue wider (minimum title width)
|
||||
int offset = minTitleWidth - horizontalGlue.getWidth();
|
||||
horizontalGlue.setSize( minTitleWidth, horizontalGlue.getHeight() );
|
||||
|
||||
// check whether glue is fully visible
|
||||
int minGlueX = target.getWidth() - target.getInsets().right - minTitleWidth;
|
||||
if( minGlueX < horizontalGlue.getX() ) {
|
||||
// move glue to the left to make it fully visible
|
||||
offset -= (horizontalGlue.getX() - minGlueX);
|
||||
horizontalGlue.setLocation( minGlueX, horizontalGlue.getY() );
|
||||
|
||||
// shrink and move components that are on the left side of the glue
|
||||
for( int i = glueIndex - 1; i >= 0; i-- ) {
|
||||
Component c = components[i];
|
||||
if( c.getX() > minGlueX ) {
|
||||
// move component and set width to zero
|
||||
c.setBounds( minGlueX, c.getY(), 0, c.getHeight() );
|
||||
} else {
|
||||
// reduce size of component
|
||||
c.setSize( minGlueX - c.getX(), c.getHeight() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// move components that are on the right side of the glue
|
||||
for( int i = glueIndex + 1; i < components.length; i++ ) {
|
||||
Component c = components[i];
|
||||
c.setLocation( c.getX() + offset, c.getY() );
|
||||
}
|
||||
} else {
|
||||
// right-to-left
|
||||
|
||||
// make horizontal glue wider (minimum title width)
|
||||
int offset = minTitleWidth - horizontalGlue.getWidth();
|
||||
horizontalGlue.setBounds( horizontalGlue.getX() - offset, horizontalGlue.getY(),
|
||||
minTitleWidth, horizontalGlue.getHeight() );
|
||||
|
||||
// check whether glue is fully visible
|
||||
int minGlueX = target.getInsets().left;
|
||||
if( minGlueX > horizontalGlue.getX() ) {
|
||||
// move glue to the right to make it fully visible
|
||||
offset -= (horizontalGlue.getX() - minGlueX);
|
||||
horizontalGlue.setLocation( minGlueX, horizontalGlue.getY() );
|
||||
|
||||
// shrink and move components that are on the right side of the glue
|
||||
int x = horizontalGlue.getX() + horizontalGlue.getWidth();
|
||||
for( int i = glueIndex - 1; i >= 0; i-- ) {
|
||||
Component c = components[i];
|
||||
if( c.getX() + c.getWidth() < x ) {
|
||||
// move component and set width to zero
|
||||
c.setBounds( x, c.getY(), 0, c.getHeight() );
|
||||
} else {
|
||||
// move component and reduce size
|
||||
c.setBounds( x, c.getY(), c.getWidth() - (x - c.getX()), c.getHeight() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// move components that are on the left side of the glue
|
||||
for( int i = glueIndex + 1; i < components.length; i++ ) {
|
||||
Component c = components[i];
|
||||
c.setLocation( c.getX() - offset, c.getY() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---- class TakeFocus ----------------------------------------------------
|
||||
|
||||
/**
|
||||
|
||||
@@ -446,6 +446,19 @@ debug*/
|
||||
protected static void paintHTMLText( Graphics g, JMenuItem menuItem,
|
||||
Rectangle textRect, View htmlView, Color selectionForeground )
|
||||
{
|
||||
// On Windows, using Segoe UI font, Java 15 or older and scaling greater than 1,
|
||||
// the width of the HTML view may be initially too small (because component
|
||||
// is not connected to a GraphicsConfiguration when getPreferredSize() is invoked).
|
||||
// Since Java 16, this seems to be fixed somehow by doing popup menu layout twice.
|
||||
//
|
||||
// If using a too small width for htmlView.paint(), the view would rearrange
|
||||
// its children and wrap them to two lines. To avoid this, use view preferred X span
|
||||
// for painting. Core Lafs actually do the same in class MenuItemLayoutHelper.
|
||||
//
|
||||
// Example HTML text that causes the problem: "<html>some <b>HTML</b> <i>text</i></html>"
|
||||
textRect = new Rectangle( textRect );
|
||||
textRect.width = (int) htmlView.getPreferredSpan( View.X_AXIS );
|
||||
|
||||
if( isArmedOrSelected( menuItem ) && selectionForeground != null )
|
||||
g = new GraphicsProxyWithTextColor( (Graphics2D) g, selectionForeground );
|
||||
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Copyright 2022 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.ui;
|
||||
|
||||
import java.io.File;
|
||||
import com.formdev.flatlaf.FlatSystemProperties;
|
||||
import com.formdev.flatlaf.util.LoggingFacade;
|
||||
import com.formdev.flatlaf.util.NativeLibrary;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
|
||||
/**
|
||||
* Helper class to load FlatLaf native library (.dll, .so or .dylib),
|
||||
* if available for current operating system and CPU architecture.
|
||||
*
|
||||
* @author Karl Tauber
|
||||
* @since 2.3
|
||||
*/
|
||||
class FlatNativeLibrary
|
||||
{
|
||||
private static NativeLibrary nativeLibrary;
|
||||
|
||||
/**
|
||||
* Loads native library (if available) and returns whether loaded successfully.
|
||||
* Returns {@code false} if no native library is available.
|
||||
*/
|
||||
static synchronized boolean isLoaded() {
|
||||
initialize();
|
||||
return (nativeLibrary != null) ? nativeLibrary.isLoaded() : false;
|
||||
}
|
||||
|
||||
private static void initialize() {
|
||||
if( nativeLibrary != null )
|
||||
return;
|
||||
|
||||
String libraryName;
|
||||
if( SystemInfo.isWindows_10_orLater && (SystemInfo.isX86 || SystemInfo.isX86_64) ) {
|
||||
// Windows: requires Windows 10 (x86 or x86_64)
|
||||
|
||||
libraryName = "flatlaf-windows-x86";
|
||||
if( SystemInfo.isX86_64 )
|
||||
libraryName += "_64";
|
||||
|
||||
// load jawt native library
|
||||
loadJAWT();
|
||||
} else
|
||||
return; // no native library available for current OS or CPU architecture
|
||||
|
||||
// load native library
|
||||
nativeLibrary = createNativeLibrary( libraryName );
|
||||
}
|
||||
|
||||
private static NativeLibrary createNativeLibrary( String libraryName ) {
|
||||
String libraryPath = System.getProperty( FlatSystemProperties.NATIVE_LIBRARY_PATH );
|
||||
if( libraryPath != null ) {
|
||||
File libraryFile = new File( libraryPath, System.mapLibraryName( libraryName ) );
|
||||
if( libraryFile.exists() )
|
||||
return new NativeLibrary( libraryFile, true );
|
||||
else
|
||||
LoggingFacade.INSTANCE.logSevere( "Did not find external library " + libraryFile + ", using extracted library instead", null );
|
||||
}
|
||||
|
||||
return new NativeLibrary( "com/formdev/flatlaf/natives/" + libraryName, null, true );
|
||||
}
|
||||
|
||||
private static void loadJAWT() {
|
||||
if( SystemInfo.isJava_9_orLater )
|
||||
return;
|
||||
|
||||
// In Java 8, load jawt.dll (part of JRE) explicitly because it
|
||||
// is not found when running application with <jdk>/bin/java.exe.
|
||||
// When using <jdk>/jre/bin/java.exe, it is found.
|
||||
// jawt.dll is located in <jdk>/jre/bin/.
|
||||
// Java 9 and later do not have this problem.
|
||||
try {
|
||||
System.loadLibrary( "jawt" );
|
||||
} catch( UnsatisfiedLinkError ex ) {
|
||||
// log error only if native library jawt.dll not already loaded
|
||||
String message = ex.getMessage();
|
||||
if( message == null || !message.contains( "already loaded in another classloader" ) )
|
||||
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||
} catch( Exception ex ) {
|
||||
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,11 +42,13 @@ import com.formdev.flatlaf.util.SystemInfo;
|
||||
public class FlatNativeWindowBorder
|
||||
{
|
||||
// can use window decorations if:
|
||||
// - on Windows 10
|
||||
// - on Windows 10 or later
|
||||
// - not if system property "sun.java2d.opengl" is true on Windows 10
|
||||
// - not when running in JetBrains Projector, Webswing or WinPE
|
||||
// - not disabled via system property
|
||||
private static final boolean canUseWindowDecorations =
|
||||
SystemInfo.isWindows_10_orLater &&
|
||||
(SystemInfo.isWindows_11_orLater || !FlatSystemProperties.getBoolean( "sun.java2d.opengl", false )) &&
|
||||
!SystemInfo.isProjector &&
|
||||
!SystemInfo.isWebswing &&
|
||||
!SystemInfo.isWinPE &&
|
||||
|
||||
@@ -130,7 +130,7 @@ public class FlatPopupMenuUI
|
||||
|
||||
LayoutManager layout = popupMenu.getLayout();
|
||||
if( layout == null || layout instanceof UIResource )
|
||||
popupMenu.setLayout( new FlatMenuLayout( popupMenu, BoxLayout.Y_AXIS ) );
|
||||
popupMenu.setLayout( new FlatPopupMenuLayout( popupMenu, BoxLayout.Y_AXIS ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -230,12 +230,15 @@ public class FlatPopupMenuUI
|
||||
return screenBounds.height - screenInsets.top - screenInsets.bottom;
|
||||
}
|
||||
|
||||
//---- class FlatMenuLayout -----------------------------------------------
|
||||
//---- class FlatPopupMenuLayout ------------------------------------------
|
||||
|
||||
protected static class FlatMenuLayout
|
||||
/**
|
||||
* @since 2.4
|
||||
*/
|
||||
protected static class FlatPopupMenuLayout
|
||||
extends DefaultMenuLayout
|
||||
{
|
||||
public FlatMenuLayout( Container target, int axis ) {
|
||||
public FlatPopupMenuLayout( Container target, int axis ) {
|
||||
super( target, axis );
|
||||
}
|
||||
|
||||
|
||||
@@ -364,6 +364,12 @@ public class FlatRootPaneUI
|
||||
((FlatRootPaneUI)ui).titlePane.isMenuBarEmbedded();
|
||||
}
|
||||
|
||||
/** @since 2.4 */
|
||||
protected static FlatTitlePane getTitlePane( JRootPane rootPane ) {
|
||||
RootPaneUI ui = rootPane.getUI();
|
||||
return ui instanceof FlatRootPaneUI ? ((FlatRootPaneUI)ui).titlePane : null;
|
||||
}
|
||||
|
||||
//---- class FlatRootLayout -----------------------------------------------
|
||||
|
||||
protected class FlatRootLayout
|
||||
|
||||
@@ -34,6 +34,7 @@ import javax.swing.UIManager;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.basic.BasicSplitPaneDivider;
|
||||
import javax.swing.plaf.basic.BasicSplitPaneUI;
|
||||
import com.formdev.flatlaf.FlatClientProperties;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
|
||||
@@ -52,6 +53,13 @@ import com.formdev.flatlaf.util.UIScale;
|
||||
* @uiDefault SplitPaneDivider.border Border
|
||||
* @uiDefault SplitPaneDivider.draggingColor Color only used if continuousLayout is false
|
||||
*
|
||||
* <!-- BasicSplitPaneDivider -->
|
||||
*
|
||||
* @uiDefault SplitPane.oneTouchButtonSize int
|
||||
* @uiDefault SplitPane.oneTouchButtonOffset int
|
||||
* @uiDefault SplitPane.centerOneTouchButtons boolean
|
||||
* @uiDefault SplitPane.supportsOneTouchButtons boolean optional; default is true
|
||||
*
|
||||
* <!-- JSplitPane -->
|
||||
*
|
||||
* @uiDefault SplitPane.continuousLayout boolean
|
||||
@@ -235,7 +243,7 @@ public class FlatSplitPaneUI
|
||||
switch( e.getPropertyName() ) {
|
||||
case JSplitPane.DIVIDER_LOCATION_PROPERTY:
|
||||
// necessary to show/hide one-touch buttons on expand/collapse
|
||||
revalidate();
|
||||
doLayout();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -345,7 +353,7 @@ public class FlatSplitPaneUI
|
||||
if( leftButton == null || rightButton == null || !splitPane.isOneTouchExpandable() )
|
||||
return;
|
||||
|
||||
// increase side of buttons, which makes them easier to hit by the user
|
||||
// increase size of buttons, which makes them easier to hit by the user
|
||||
// and avoids cut arrows at small divider sizes
|
||||
int extraSize = UIScale.scale( 4 );
|
||||
if( orientation == JSplitPane.VERTICAL_SPLIT ) {
|
||||
@@ -360,10 +368,19 @@ public class FlatSplitPaneUI
|
||||
|
||||
// hide buttons if not applicable
|
||||
boolean leftCollapsed = isLeftCollapsed();
|
||||
if( leftCollapsed )
|
||||
boolean rightCollapsed = isRightCollapsed();
|
||||
if( leftCollapsed || rightCollapsed ) {
|
||||
leftButton.setVisible( !leftCollapsed );
|
||||
rightButton.setVisible( !rightCollapsed );
|
||||
} else {
|
||||
Object expandableSide = splitPane.getClientProperty( FlatClientProperties.SPLIT_PANE_EXPANDABLE_SIDE );
|
||||
leftButton.setVisible( expandableSide == null || !FlatClientProperties.SPLIT_PANE_EXPANDABLE_SIDE_LEFT.equals( expandableSide ) );
|
||||
rightButton.setVisible( expandableSide == null || !FlatClientProperties.SPLIT_PANE_EXPANDABLE_SIDE_RIGHT.equals( expandableSide ) );
|
||||
}
|
||||
|
||||
// move right button if left button is hidden
|
||||
if( !leftButton.isVisible() )
|
||||
rightButton.setLocation( leftButton.getLocation() );
|
||||
leftButton.setVisible( !leftCollapsed );
|
||||
rightButton.setVisible( !isRightCollapsed() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.IntConsumer;
|
||||
import java.util.function.Predicate;
|
||||
import javax.accessibility.Accessible;
|
||||
import javax.accessibility.AccessibleContext;
|
||||
import javax.swing.Action;
|
||||
@@ -82,10 +83,12 @@ import javax.swing.event.ChangeListener;
|
||||
import javax.swing.event.PopupMenuEvent;
|
||||
import javax.swing.event.PopupMenuListener;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.TabbedPaneUI;
|
||||
import javax.swing.plaf.UIResource;
|
||||
import javax.swing.plaf.basic.BasicTabbedPaneUI;
|
||||
import javax.swing.text.JTextComponent;
|
||||
import javax.swing.text.View;
|
||||
import com.formdev.flatlaf.FlatClientProperties;
|
||||
import com.formdev.flatlaf.FlatLaf;
|
||||
import com.formdev.flatlaf.icons.FlatTabbedPaneCloseIcon;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
|
||||
@@ -127,6 +130,7 @@ import com.formdev.flatlaf.util.UIScale;
|
||||
* @uiDefault TabbedPane.selectedBackground Color optional
|
||||
* @uiDefault TabbedPane.selectedForeground Color
|
||||
* @uiDefault TabbedPane.underlineColor Color
|
||||
* @uiDefault TabbedPane.inactiveUnderlineColor Color
|
||||
* @uiDefault TabbedPane.disabledUnderlineColor Color
|
||||
* @uiDefault TabbedPane.hoverColor Color
|
||||
* @uiDefault TabbedPane.focusColor Color
|
||||
@@ -198,6 +202,7 @@ public class FlatTabbedPaneUI
|
||||
@Styleable protected Color selectedBackground;
|
||||
@Styleable protected Color selectedForeground;
|
||||
@Styleable protected Color underlineColor;
|
||||
/** @since 2.2 */ @Styleable protected Color inactiveUnderlineColor;
|
||||
@Styleable protected Color disabledUnderlineColor;
|
||||
@Styleable protected Color hoverColor;
|
||||
@Styleable protected Color focusColor;
|
||||
@@ -288,6 +293,7 @@ public class FlatTabbedPaneUI
|
||||
|
||||
super.installUI( c );
|
||||
|
||||
FlatSelectedTabRepainter.install();
|
||||
installStyle();
|
||||
}
|
||||
|
||||
@@ -318,6 +324,7 @@ public class FlatTabbedPaneUI
|
||||
selectedBackground = UIManager.getColor( "TabbedPane.selectedBackground" );
|
||||
selectedForeground = UIManager.getColor( "TabbedPane.selectedForeground" );
|
||||
underlineColor = UIManager.getColor( "TabbedPane.underlineColor" );
|
||||
inactiveUnderlineColor = FlatUIUtils.getUIColor( "TabbedPane.inactiveUnderlineColor", underlineColor );
|
||||
disabledUnderlineColor = UIManager.getColor( "TabbedPane.disabledUnderlineColor" );
|
||||
hoverColor = UIManager.getColor( "TabbedPane.hoverColor" );
|
||||
focusColor = UIManager.getColor( "TabbedPane.focusColor" );
|
||||
@@ -385,6 +392,7 @@ public class FlatTabbedPaneUI
|
||||
selectedBackground = null;
|
||||
selectedForeground = null;
|
||||
underlineColor = null;
|
||||
inactiveUnderlineColor = null;
|
||||
disabledUnderlineColor = null;
|
||||
hoverColor = null;
|
||||
focusColor = null;
|
||||
@@ -733,7 +741,6 @@ public class FlatTabbedPaneUI
|
||||
|
||||
// increase size of repaint region to include part of content border
|
||||
if( contentSeparatorHeight > 0 &&
|
||||
getTabType() == TAB_TYPE_CARD &&
|
||||
clientPropertyBoolean( tabPane, TABBED_PANE_SHOW_CONTENT_SEPARATOR, true ) )
|
||||
{
|
||||
int sh = scale( contentSeparatorHeight );
|
||||
@@ -1205,7 +1212,9 @@ public class FlatTabbedPaneUI
|
||||
}
|
||||
|
||||
protected void paintTabSelection( Graphics g, int tabPlacement, int x, int y, int w, int h ) {
|
||||
g.setColor( tabPane.isEnabled() ? underlineColor : disabledUnderlineColor );
|
||||
g.setColor( tabPane.isEnabled()
|
||||
? (isTabbedPaneOrChildFocused() ? underlineColor : inactiveUnderlineColor)
|
||||
: disabledUnderlineColor );
|
||||
|
||||
// paint underline selection
|
||||
boolean atBottom = (getTabType() != TAB_TYPE_CARD);
|
||||
@@ -1236,6 +1245,23 @@ public class FlatTabbedPaneUI
|
||||
}
|
||||
}
|
||||
|
||||
/** @since 2.2 */
|
||||
@SuppressWarnings( "unchecked" )
|
||||
protected boolean isTabbedPaneOrChildFocused() {
|
||||
KeyboardFocusManager keyboardFocusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
|
||||
|
||||
Object value = tabPane.getClientProperty( FlatClientProperties.COMPONENT_FOCUS_OWNER );
|
||||
if( value instanceof Predicate ) {
|
||||
return ((Predicate<JComponent>)value).test( tabPane ) &&
|
||||
FlatUIUtils.isInActiveWindow( tabPane, keyboardFocusManager.getActiveWindow() );
|
||||
}
|
||||
|
||||
Component focusOwner = keyboardFocusManager.getPermanentFocusOwner();
|
||||
return focusOwner != null &&
|
||||
SwingUtilities.isDescendingFrom( focusOwner, tabPane ) &&
|
||||
FlatUIUtils.isInActiveWindow( focusOwner, keyboardFocusManager.getActiveWindow() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually does nearly the same as super.paintContentBorder() but
|
||||
* - not using UIManager.getColor("TabbedPane.contentAreaColor") to be GUI builder friendly
|
||||
@@ -3341,4 +3367,77 @@ public class FlatTabbedPaneUI
|
||||
delegate.actionPerformed( e );
|
||||
}
|
||||
}
|
||||
|
||||
//---- class FlatSelectedTabRepainter -------------------------------------
|
||||
|
||||
private static class FlatSelectedTabRepainter
|
||||
implements PropertyChangeListener//, Runnable
|
||||
{
|
||||
private static FlatSelectedTabRepainter instance;
|
||||
|
||||
private KeyboardFocusManager keyboardFocusManager;
|
||||
|
||||
static void install() {
|
||||
synchronized( FlatSelectedTabRepainter.class ) {
|
||||
if( instance != null )
|
||||
return;
|
||||
|
||||
instance = new FlatSelectedTabRepainter();
|
||||
}
|
||||
}
|
||||
|
||||
FlatSelectedTabRepainter() {
|
||||
keyboardFocusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
|
||||
keyboardFocusManager.addPropertyChangeListener( this );
|
||||
}
|
||||
|
||||
private void uninstall() {
|
||||
synchronized( FlatSelectedTabRepainter.class ) {
|
||||
if( instance == null )
|
||||
return;
|
||||
|
||||
keyboardFocusManager.removePropertyChangeListener( this );
|
||||
keyboardFocusManager = null;
|
||||
instance = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChange( PropertyChangeEvent e ) {
|
||||
// uninstall if no longer using FlatLaf
|
||||
if( !(UIManager.getLookAndFeel() instanceof FlatLaf) ) {
|
||||
uninstall();
|
||||
return;
|
||||
}
|
||||
|
||||
switch( e.getPropertyName() ) {
|
||||
case "permanentFocusOwner":
|
||||
Object oldValue = e.getOldValue();
|
||||
Object newValue = e.getNewValue();
|
||||
if( oldValue instanceof Component )
|
||||
repaintSelectedTabs( (Component) oldValue );
|
||||
if( newValue instanceof Component )
|
||||
repaintSelectedTabs( (Component) newValue );
|
||||
break;
|
||||
|
||||
case "activeWindow":
|
||||
repaintSelectedTabs( keyboardFocusManager.getPermanentFocusOwner() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void repaintSelectedTabs( Component c ) {
|
||||
if( c instanceof JTabbedPane )
|
||||
repaintSelectedTab( (JTabbedPane) c );
|
||||
|
||||
while( (c = SwingUtilities.getAncestorOfClass( JTabbedPane.class, c )) != null )
|
||||
repaintSelectedTab( (JTabbedPane) c );
|
||||
}
|
||||
|
||||
private void repaintSelectedTab( JTabbedPane tabbedPane ) {
|
||||
TabbedPaneUI ui = tabbedPane.getUI();
|
||||
if( ui instanceof FlatTabbedPaneUI )
|
||||
((FlatTabbedPaneUI) ui).repaintTab( tabbedPane.getSelectedIndex() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,9 @@ import javax.swing.event.MouseInputListener;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.UIResource;
|
||||
import javax.swing.plaf.basic.BasicTableHeaderUI;
|
||||
import javax.swing.table.JTableHeader;
|
||||
import javax.swing.table.TableCellRenderer;
|
||||
import javax.swing.table.TableColumn;
|
||||
import javax.swing.table.TableColumnModel;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
|
||||
@@ -195,6 +197,8 @@ public class FlatTableHeaderUI
|
||||
|
||||
@Override
|
||||
public void paint( Graphics g, JComponent c ) {
|
||||
fixDraggedAndResizingColumns( header );
|
||||
|
||||
TableColumnModel columnModel = header.getColumnModel();
|
||||
if( columnModel.getColumnCount() <= 0 )
|
||||
return;
|
||||
@@ -269,6 +273,32 @@ public class FlatTableHeaderUI
|
||||
return size;
|
||||
}
|
||||
|
||||
static void fixDraggedAndResizingColumns( JTableHeader header ) {
|
||||
if( header == null )
|
||||
return;
|
||||
|
||||
// Dragged column may be outdated in the case that the table structure
|
||||
// was changed from a table header popup menu action. In this case
|
||||
// the paint methods in BasicTableHeaderUI and BasicTableUI would throw exceptions.
|
||||
TableColumn draggedColumn = header.getDraggedColumn();
|
||||
if( draggedColumn != null && !isValidColumn( header.getColumnModel(), draggedColumn ) )
|
||||
header.setDraggedColumn( null );
|
||||
|
||||
// also clear outdated resizing column (although this seems not cause exceptions)
|
||||
TableColumn resizingColumn = header.getResizingColumn();
|
||||
if( resizingColumn != null && !isValidColumn( header.getColumnModel(), resizingColumn ) )
|
||||
header.setResizingColumn( null );
|
||||
}
|
||||
|
||||
private static boolean isValidColumn( TableColumnModel cm, TableColumn column ) {
|
||||
int count = cm.getColumnCount();
|
||||
for( int i = 0; i < count; i++ ) {
|
||||
if( cm.getColumn( i ) == column )
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//---- class FlatTableCellHeaderRenderer ----------------------------------
|
||||
|
||||
/**
|
||||
|
||||
@@ -80,6 +80,7 @@ import com.formdev.flatlaf.util.UIScale;
|
||||
* @uiDefault Table.intercellSpacing Dimension
|
||||
* @uiDefault Table.selectionInactiveBackground Color
|
||||
* @uiDefault Table.selectionInactiveForeground Color
|
||||
* @uiDefault Table.paintOutsideAlternateRows boolean
|
||||
*
|
||||
* <!-- FlatTableCellBorder -->
|
||||
*
|
||||
@@ -95,7 +96,7 @@ import com.formdev.flatlaf.util.UIScale;
|
||||
*/
|
||||
public class FlatTableUI
|
||||
extends BasicTableUI
|
||||
implements StyleableUI
|
||||
implements StyleableUI, FlatViewportUI.ViewportPainter
|
||||
{
|
||||
protected boolean showHorizontalLines;
|
||||
protected boolean showVerticalLines;
|
||||
@@ -313,6 +314,8 @@ public class FlatTableUI
|
||||
|
||||
@Override
|
||||
public void paint( Graphics g, JComponent c ) {
|
||||
FlatTableHeaderUI.fixDraggedAndResizingColumns( table.getTableHeader() );
|
||||
|
||||
boolean horizontalLines = table.getShowHorizontalLines();
|
||||
boolean verticalLines = table.getShowVerticalLines();
|
||||
if( horizontalLines || verticalLines ) {
|
||||
@@ -421,4 +424,38 @@ public class FlatTableUI
|
||||
? (viewport != rowHeader)
|
||||
: (viewport == rowHeader || rowHeader == null);
|
||||
}
|
||||
|
||||
/** @since 2.3 */
|
||||
@Override
|
||||
public void paintViewport( Graphics g, JComponent c, JViewport viewport ) {
|
||||
int viewportWidth = viewport.getWidth();
|
||||
int viewportHeight = viewport.getHeight();
|
||||
|
||||
// fill viewport background in same color as table background
|
||||
if( viewport.isOpaque() ) {
|
||||
g.setColor( table.getBackground() );
|
||||
g.fillRect( 0, 0, viewportWidth, viewportHeight );
|
||||
}
|
||||
|
||||
// paint alternating empty rows
|
||||
boolean paintOutside = UIManager.getBoolean( "Table.paintOutsideAlternateRows" );
|
||||
Color alternateColor;
|
||||
if( paintOutside && (alternateColor = UIManager.getColor( "Table.alternateRowColor" )) != null ) {
|
||||
g.setColor( alternateColor );
|
||||
|
||||
int rowCount = table.getRowCount();
|
||||
|
||||
// paint alternating empty rows below the table
|
||||
int tableHeight = table.getHeight();
|
||||
if( tableHeight < viewportHeight ) {
|
||||
int tableWidth = table.getWidth();
|
||||
int rowHeight = table.getRowHeight();
|
||||
|
||||
for( int y = tableHeight, row = rowCount; y < viewportHeight; y += rowHeight, row++ ) {
|
||||
if( row % 2 != 0 )
|
||||
g.fillRect( 0, y, tableWidth, rowHeight );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.awt.Container;
|
||||
import java.awt.Dialog;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.FontMetrics;
|
||||
import java.awt.Frame;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
@@ -50,13 +51,13 @@ import javax.accessibility.AccessibleContext;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JMenuBar;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JRootPane;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.border.AbstractBorder;
|
||||
@@ -83,10 +84,14 @@ import com.formdev.flatlaf.util.UIScale;
|
||||
* @uiDefault TitlePane.iconMargins Insets
|
||||
* @uiDefault TitlePane.titleMargins Insets
|
||||
* @uiDefault TitlePane.menuBarEmbedded boolean
|
||||
* @uiDefault TitlePane.titleMinimumWidth int
|
||||
* @uiDefault TitlePane.buttonMinimumWidth int
|
||||
* @uiDefault TitlePane.buttonMaximizedHeight int
|
||||
* @uiDefault TitlePane.centerTitle boolean
|
||||
* @uiDefault TitlePane.centerTitleIfMenuBarEmbedded boolean
|
||||
* @uiDefault TitlePane.showIconBesideTitle boolean
|
||||
* @uiDefault TitlePane.menuBarTitleGap int
|
||||
* @uiDefault TitlePane.menuBarResizeHeight int
|
||||
* @uiDefault TitlePane.closeIcon Icon
|
||||
* @uiDefault TitlePane.iconifyIcon Icon
|
||||
* @uiDefault TitlePane.maximizeIcon Icon
|
||||
@@ -107,10 +112,15 @@ public class FlatTitlePane
|
||||
/** @since 2 */ protected final boolean showIcon = FlatUIUtils.getUIBoolean( "TitlePane.showIcon", true );
|
||||
/** @since 2 */ protected final int noIconLeftGap = FlatUIUtils.getUIInt( "TitlePane.noIconLeftGap", 8 );
|
||||
protected final Dimension iconSize = UIManager.getDimension( "TitlePane.iconSize" );
|
||||
/** @since 2.4 */ protected final int titleMinimumWidth = FlatUIUtils.getUIInt( "TitlePane.titleMinimumWidth", 60 );
|
||||
/** @since 2.4 */ protected final int buttonMinimumWidth = FlatUIUtils.getUIInt( "TitlePane.buttonMinimumWidth", 30 );
|
||||
protected final int buttonMaximizedHeight = UIManager.getInt( "TitlePane.buttonMaximizedHeight" );
|
||||
protected final boolean centerTitle = UIManager.getBoolean( "TitlePane.centerTitle" );
|
||||
protected final boolean centerTitleIfMenuBarEmbedded = FlatUIUtils.getUIBoolean( "TitlePane.centerTitleIfMenuBarEmbedded", true );
|
||||
protected final int menuBarTitleGap = FlatUIUtils.getUIInt( "TitlePane.menuBarTitleGap", 20 );
|
||||
/** @since 2.4 */ protected final boolean showIconBesideTitle = UIManager.getBoolean( "TitlePane.showIconBesideTitle" );
|
||||
protected final int menuBarTitleGap = FlatUIUtils.getUIInt( "TitlePane.menuBarTitleGap", 40 );
|
||||
/** @since 2.4 */ protected final int menuBarTitleMinimumGap = FlatUIUtils.getUIInt( "TitlePane.menuBarTitleMinimumGap", 12 );
|
||||
/** @since 2.4 */ protected final int menuBarResizeHeight = FlatUIUtils.getUIInt( "TitlePane.menuBarResizeHeight", 4 );
|
||||
|
||||
protected final JRootPane rootPane;
|
||||
|
||||
@@ -142,6 +152,8 @@ public class FlatTitlePane
|
||||
|
||||
// necessary for closing window with double-click on icon
|
||||
iconLabel.addMouseListener( handler );
|
||||
|
||||
applyComponentOrientation( rootPane.getComponentOrientation() );
|
||||
}
|
||||
|
||||
protected FlatTitlePaneBorder createTitlePaneBorder() {
|
||||
@@ -163,7 +175,6 @@ public class FlatTitlePane
|
||||
};
|
||||
iconLabel.setBorder( new FlatEmptyBorder( UIManager.getInsets( "TitlePane.iconMargins" ) ) );
|
||||
titleLabel.setBorder( new FlatEmptyBorder( UIManager.getInsets( "TitlePane.titleMargins" ) ) );
|
||||
titleLabel.setHorizontalAlignment( SwingConstants.CENTER );
|
||||
|
||||
leftPanel.setLayout( new BoxLayout( leftPanel, BoxLayout.LINE_AXIS ) );
|
||||
leftPanel.setOpaque( false );
|
||||
@@ -183,18 +194,52 @@ public class FlatTitlePane
|
||||
setLayout( new BorderLayout() {
|
||||
@Override
|
||||
public void layoutContainer( Container target ) {
|
||||
super.layoutContainer( target );
|
||||
|
||||
// make left panel (with embedded menu bar) smaller if horizontal space is rare
|
||||
// to avoid that embedded menu bar overlaps button bar
|
||||
// compute available bounds
|
||||
Insets insets = target.getInsets();
|
||||
int width = target.getWidth() - insets.left - insets.right;
|
||||
if( leftPanel.getWidth() + buttonPanel.getWidth() > width ) {
|
||||
int oldWidth = leftPanel.getWidth();
|
||||
int newWidth = Math.max( width - buttonPanel.getWidth(), 0 );
|
||||
leftPanel.setSize( newWidth, leftPanel.getHeight() );
|
||||
if( !getComponentOrientation().isLeftToRight() )
|
||||
leftPanel.setLocation( leftPanel.getX() + (oldWidth - newWidth), leftPanel.getY() );
|
||||
int x = insets.left;
|
||||
int y = insets.top;
|
||||
int w = target.getWidth() - insets.left - insets.right;
|
||||
int h = target.getHeight() - insets.top - insets.bottom;
|
||||
|
||||
// compute widths
|
||||
int leftWidth = leftPanel.getPreferredSize().width;
|
||||
int buttonsWidth = buttonPanel.getPreferredSize().width;
|
||||
int titleWidth = w - leftWidth - buttonsWidth;
|
||||
int minTitleWidth = UIScale.scale( titleMinimumWidth );
|
||||
|
||||
// increase minimum width if icon is show besides the title
|
||||
Icon icon = titleLabel.getIcon();
|
||||
if( icon != null ) {
|
||||
Insets iconInsets = iconLabel.getInsets();
|
||||
int iconTextGap = titleLabel.getComponentOrientation().isLeftToRight() ? iconInsets.right : iconInsets.left;
|
||||
minTitleWidth += icon.getIconWidth() + iconTextGap;
|
||||
}
|
||||
|
||||
// if title is too small, reduce width of buttons
|
||||
if( titleWidth < minTitleWidth ) {
|
||||
buttonsWidth = Math.max( buttonsWidth - (minTitleWidth - titleWidth), buttonPanel.getMinimumSize().width );
|
||||
titleWidth = w - leftWidth - buttonsWidth;
|
||||
}
|
||||
|
||||
// if title is still too small, reduce width of left panel (icon and embedded menu bar)
|
||||
if( titleWidth < minTitleWidth ) {
|
||||
int minLeftWidth = iconLabel.isVisible()
|
||||
? iconLabel.getWidth() - iconLabel.getInsets().right
|
||||
: UIScale.scale( noIconLeftGap );
|
||||
leftWidth = Math.max( leftWidth - (minTitleWidth - titleWidth), minLeftWidth );
|
||||
titleWidth = w - leftWidth - buttonsWidth;
|
||||
}
|
||||
|
||||
if( target.getComponentOrientation().isLeftToRight() ) {
|
||||
// left-to-right
|
||||
leftPanel.setBounds( x, y, leftWidth, h );
|
||||
titleLabel.setBounds( x + leftWidth, y, titleWidth, h );
|
||||
buttonPanel.setBounds( x + leftWidth + titleWidth, y, buttonsWidth, h );
|
||||
} else {
|
||||
// right-to-left
|
||||
buttonPanel.setBounds( x, y, buttonsWidth, h );
|
||||
titleLabel.setBounds( x + buttonsWidth, y, titleWidth, h );
|
||||
leftPanel.setBounds( x + buttonsWidth + titleWidth, y, leftWidth, h );
|
||||
}
|
||||
|
||||
// If menu bar is embedded and contains a horizontal glue component,
|
||||
@@ -233,10 +278,7 @@ public class FlatTitlePane
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
Dimension size = super.getPreferredSize();
|
||||
if( buttonMaximizedHeight > 0 &&
|
||||
window instanceof Frame &&
|
||||
(((Frame)window).getExtendedState() & Frame.MAXIMIZED_BOTH) != 0 )
|
||||
{
|
||||
if( buttonMaximizedHeight > 0 && isWindowMaximized() && !hasVisibleEmbeddedMenuBar( rootPane.getJMenuBar() ) ) {
|
||||
// make title pane height smaller when frame is maximized
|
||||
size = new Dimension( size.width, Math.min( size.height, UIScale.scale( buttonMaximizedHeight ) ) );
|
||||
}
|
||||
@@ -259,7 +301,13 @@ public class FlatTitlePane
|
||||
}
|
||||
|
||||
protected JButton createButton( String iconKey, String accessibleName, ActionListener action ) {
|
||||
JButton button = new JButton( UIManager.getIcon( iconKey ) );
|
||||
JButton button = new JButton( UIManager.getIcon( iconKey ) ) {
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
// allow the button to shrink if space is rare
|
||||
return new Dimension( UIScale.scale( buttonMinimumWidth ), super.getMinimumSize().height );
|
||||
}
|
||||
};
|
||||
button.setFocusable( false );
|
||||
button.setContentAreaFilled( false );
|
||||
button.setBorder( BorderFactory.createEmptyBorder() );
|
||||
@@ -356,11 +404,12 @@ public class FlatTitlePane
|
||||
boolean hasIcon = (images != null && !images.isEmpty());
|
||||
|
||||
// set icon
|
||||
iconLabel.setIcon( hasIcon ? new FlatTitlePaneIcon( images, iconSize ) : null );
|
||||
iconLabel.setIcon( hasIcon && !showIconBesideTitle ? new FlatTitlePaneIcon( images, iconSize ) : null );
|
||||
titleLabel.setIcon( hasIcon && showIconBesideTitle ? new FlatTitlePaneIcon( images, iconSize ) : null );
|
||||
|
||||
// show/hide icon
|
||||
iconLabel.setVisible( hasIcon );
|
||||
leftPanel.setBorder( hasIcon ? null : FlatUIUtils.nonUIResource( new FlatEmptyBorder( 0, noIconLeftGap, 0, 0 ) ) );
|
||||
iconLabel.setVisible( hasIcon && !showIconBesideTitle );
|
||||
leftPanel.setBorder( hasIcon && !showIconBesideTitle ? null : FlatUIUtils.nonUIResource( new FlatEmptyBorder( 0, noIconLeftGap, 0, 0 ) ) );
|
||||
|
||||
updateNativeTitleBarHeightAndHitTestSpotsLater();
|
||||
}
|
||||
@@ -567,6 +616,11 @@ debug*/
|
||||
frame.setExtendedState( frame.getExtendedState() | Frame.ICONIFIED );
|
||||
}
|
||||
|
||||
/** @since 2.4 */
|
||||
protected boolean isWindowMaximized() {
|
||||
return window instanceof Frame && (((Frame)window).getExtendedState() & Frame.MAXIMIZED_BOTH) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maximizes the window.
|
||||
*/
|
||||
@@ -729,7 +783,7 @@ debug*/
|
||||
List<Rectangle> hitTestSpots = new ArrayList<>();
|
||||
Rectangle appIconBounds = null;
|
||||
|
||||
if( iconLabel.isVisible() ) {
|
||||
if( !showIconBesideTitle && iconLabel.isVisible() ) {
|
||||
// compute real icon size (without insets; 1px larger for easier hitting)
|
||||
Point location = SwingUtilities.convertPoint( iconLabel, 0, 0, window );
|
||||
Insets iconInsets = iconLabel.getInsets();
|
||||
@@ -741,9 +795,7 @@ debug*/
|
||||
|
||||
// if frame is maximized, increase icon bounds to upper-left corner
|
||||
// of window to allow closing window via double-click in upper-left corner
|
||||
if( window instanceof Frame &&
|
||||
(((Frame)window).getExtendedState() & Frame.MAXIMIZED_BOTH) != 0 )
|
||||
{
|
||||
if( isWindowMaximized() ) {
|
||||
iconBounds.height += iconBounds.y;
|
||||
iconBounds.y = 0;
|
||||
|
||||
@@ -758,6 +810,38 @@ debug*/
|
||||
hitTestSpots.add( iconBounds );
|
||||
else
|
||||
appIconBounds = iconBounds;
|
||||
} else if( showIconBesideTitle && titleLabel.getIcon() != null && titleLabel.getUI() instanceof FlatTitleLabelUI ) {
|
||||
FlatTitleLabelUI ui = (FlatTitleLabelUI) titleLabel.getUI();
|
||||
|
||||
// compute real icon bounds
|
||||
Insets insets = titleLabel.getInsets();
|
||||
Rectangle viewR = new Rectangle( insets.left, insets.top,
|
||||
titleLabel.getWidth() - insets.left - insets.right,
|
||||
titleLabel.getHeight() - insets.top - insets.bottom );
|
||||
Rectangle iconR = new Rectangle();
|
||||
Rectangle textR = new Rectangle();
|
||||
ui.layoutCL( titleLabel, titleLabel.getFontMetrics( titleLabel.getFont() ),
|
||||
titleLabel.getText(), titleLabel.getIcon(),
|
||||
viewR, iconR, textR );
|
||||
|
||||
// Windows shows the window system menu only in the upper-left corner
|
||||
if( iconR.x == 0 ) {
|
||||
// convert icon location to window coordinates
|
||||
Point location = SwingUtilities.convertPoint( titleLabel, 0, 0, window );
|
||||
iconR.x += location.x;
|
||||
iconR.y += location.y;
|
||||
|
||||
// make icon bounds 1px larger for easier hitting
|
||||
iconR.x -= 1;
|
||||
iconR.y -= 1;
|
||||
iconR.width += 2;
|
||||
iconR.height += 2;
|
||||
|
||||
if( hasJBRCustomDecoration() )
|
||||
hitTestSpots.add( iconR );
|
||||
else
|
||||
appIconBounds = iconR;
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle r = getNativeHitTestSpot( buttonPanel );
|
||||
@@ -768,6 +852,15 @@ debug*/
|
||||
if( hasVisibleEmbeddedMenuBar( menuBar ) ) {
|
||||
r = getNativeHitTestSpot( menuBar );
|
||||
if( r != null ) {
|
||||
// if frame is resizable and not maximized, make menu bar hit test spot smaller at top
|
||||
// to have a small area above the menu bar to resize the window
|
||||
if( window instanceof Frame && ((Frame)window).isResizable() && !isWindowMaximized() ) {
|
||||
// limit to 8, because Windows does not use a larger height
|
||||
int resizeHeight = UIScale.scale( Math.min( menuBarResizeHeight, 8 ) );
|
||||
r.y += resizeHeight;
|
||||
r.height -= resizeHeight;
|
||||
}
|
||||
|
||||
Component horizontalGlue = findHorizontalGlue( menuBar );
|
||||
if( horizontalGlue != null ) {
|
||||
// If menu bar is embedded and contains a horizontal glue component,
|
||||
@@ -854,7 +947,7 @@ debug*/
|
||||
} else if( borderColor != null && (rootPane.getJMenuBar() == null || !rootPane.getJMenuBar().isVisible()) )
|
||||
insets.bottom += UIScale.scale( 1 );
|
||||
|
||||
if( !SystemInfo.isWindows_11_orLater && hasNativeCustomDecoration() && !isWindowMaximized( c ) )
|
||||
if( !SystemInfo.isWindows_11_orLater && hasNativeCustomDecoration() && !isWindowMaximized() )
|
||||
insets = FlatUIUtils.addInsets( insets, WindowTopBorder.getInstance().getBorderInsets() );
|
||||
|
||||
return insets;
|
||||
@@ -873,7 +966,7 @@ debug*/
|
||||
FlatUIUtils.paintFilledRectangle( g, borderColor, x, y + height - lineHeight, width, lineHeight );
|
||||
}
|
||||
|
||||
if( !SystemInfo.isWindows_11_orLater && hasNativeCustomDecoration() && !isWindowMaximized( c ) )
|
||||
if( !SystemInfo.isWindows_11_orLater && hasNativeCustomDecoration() && !isWindowMaximized() )
|
||||
WindowTopBorder.getInstance().paintBorder( c, g, x, y, width, height );
|
||||
}
|
||||
|
||||
@@ -881,10 +974,6 @@ debug*/
|
||||
JMenuBar menuBar = rootPane.getJMenuBar();
|
||||
return hasVisibleEmbeddedMenuBar( menuBar ) ? menuBar.getBorder() : null;
|
||||
}
|
||||
|
||||
protected boolean isWindowMaximized( Component c ) {
|
||||
return window instanceof Frame && (((Frame) window).getExtendedState() & Frame.MAXIMIZED_BOTH) != 0;
|
||||
}
|
||||
}
|
||||
|
||||
//---- class FlatTitleLabelUI ---------------------------------------------
|
||||
@@ -898,32 +987,101 @@ debug*/
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintEnabledText( JLabel l, Graphics g, String s, int textX, int textY ) {
|
||||
boolean hasEmbeddedMenuBar = hasVisibleEmbeddedMenuBar( rootPane.getJMenuBar() );
|
||||
int labelWidth = l.getWidth();
|
||||
int textWidth = labelWidth - (textX * 2);
|
||||
int gap = UIScale.scale( menuBarTitleGap );
|
||||
protected String layoutCL( JLabel label, FontMetrics fontMetrics, String text, Icon icon,
|
||||
Rectangle viewR, Rectangle iconR, Rectangle textR )
|
||||
{
|
||||
JMenuBar menuBar = rootPane.getJMenuBar();
|
||||
boolean hasEmbeddedMenuBar = hasVisibleEmbeddedMenuBar( menuBar );
|
||||
boolean hasEmbeddedLeadingMenus = hasEmbeddedMenuBar && hasLeadingMenus( menuBar );
|
||||
boolean leftToRight = getComponentOrientation().isLeftToRight();
|
||||
|
||||
// The passed in textX coordinate is always to horizontally center the text within the label bounds.
|
||||
// Modify textX so that the text is painted either centered within the window bounds or leading aligned.
|
||||
boolean center = hasEmbeddedMenuBar ? centerTitleIfMenuBarEmbedded : centerTitle;
|
||||
if( center ) {
|
||||
// If window is wide enough, center title within window bounds.
|
||||
// Otherwise, leave it centered within free space (label bounds).
|
||||
int centeredTextX = ((l.getParent().getWidth() - textWidth) / 2) - l.getX();
|
||||
if( centeredTextX >= gap && centeredTextX + textWidth <= labelWidth - gap )
|
||||
textX = centeredTextX;
|
||||
} else {
|
||||
// leading aligned
|
||||
boolean leftToRight = getComponentOrientation().isLeftToRight();
|
||||
Insets insets = l.getInsets();
|
||||
int leadingInset = hasEmbeddedMenuBar ? gap : (leftToRight ? insets.left : insets.right);
|
||||
int leadingTextX = leftToRight ? leadingInset : labelWidth - leadingInset - textWidth;
|
||||
if( leftToRight ? leadingTextX < textX : leadingTextX > textX )
|
||||
textX = leadingTextX;
|
||||
if( hasEmbeddedMenuBar ) {
|
||||
int minGap = UIScale.scale( menuBarTitleMinimumGap );
|
||||
|
||||
// apply minimum leading gap (between embedded menu bar and title)
|
||||
if( hasEmbeddedLeadingMenus ) {
|
||||
if( leftToRight )
|
||||
viewR.x += minGap;
|
||||
viewR.width -= minGap;
|
||||
}
|
||||
|
||||
// apply minimum trailing gap (between title and right aligned components of embedded menu bar)
|
||||
Component horizontalGlue = findHorizontalGlue( menuBar );
|
||||
if( horizontalGlue != null && menuBar.getComponent( menuBar.getComponentCount() - 1 ) != horizontalGlue ) {
|
||||
if( !leftToRight )
|
||||
viewR.x += minGap;
|
||||
viewR.width -= minGap;
|
||||
}
|
||||
}
|
||||
|
||||
super.paintEnabledText( l, g, s, textX, textY );
|
||||
// compute icon width and gap (if icon is show besides the title)
|
||||
int iconTextGap = 0;
|
||||
int iconWidthAndGap = 0;
|
||||
if( icon != null ) {
|
||||
Insets iconInsets = iconLabel.getInsets();
|
||||
iconTextGap = leftToRight ? iconInsets.right : iconInsets.left;
|
||||
iconWidthAndGap = icon.getIconWidth() + iconTextGap;
|
||||
}
|
||||
|
||||
// layout title and icon (if show besides the title)
|
||||
String clippedText = SwingUtilities.layoutCompoundLabel( label, fontMetrics, text, icon,
|
||||
label.getVerticalAlignment(), label.getHorizontalAlignment(),
|
||||
label.getVerticalTextPosition(), label.getHorizontalTextPosition(),
|
||||
viewR, iconR, textR,
|
||||
iconTextGap );
|
||||
|
||||
// compute text X location
|
||||
if( !clippedText.equals( text ) ) {
|
||||
// if text is clipped, align to left (or right)
|
||||
textR.x = leftToRight
|
||||
? viewR.x + iconWidthAndGap
|
||||
: viewR.x + viewR.width - iconWidthAndGap - textR.width;
|
||||
} else {
|
||||
int leadingGap = hasEmbeddedLeadingMenus ? UIScale.scale( menuBarTitleGap - menuBarTitleMinimumGap ) : 0;
|
||||
|
||||
boolean center = hasEmbeddedLeadingMenus ? centerTitleIfMenuBarEmbedded : centerTitle;
|
||||
if( center ) {
|
||||
// If window is wide enough, center title within window bounds.
|
||||
// Otherwise, center within free space (label bounds).
|
||||
Container parent = label.getParent();
|
||||
int centeredTextX = (parent != null) ? ((parent.getWidth() - textR.width - iconWidthAndGap) / 2) + iconWidthAndGap - label.getX() : -1;
|
||||
textR.x = (centeredTextX >= viewR.x + leadingGap && centeredTextX + textR.width <= viewR.x + viewR.width - leadingGap)
|
||||
? centeredTextX
|
||||
: viewR.x + ((viewR.width - textR.width - iconWidthAndGap) / 2) + iconWidthAndGap;
|
||||
} else {
|
||||
// leading aligned with leading gap, which is reduced if space is rare
|
||||
textR.x = leftToRight
|
||||
? Math.min( viewR.x + leadingGap + iconWidthAndGap, viewR.x + viewR.width - textR.width )
|
||||
: Math.max( viewR.x + viewR.width - leadingGap - iconWidthAndGap - textR.width, viewR.x );
|
||||
}
|
||||
}
|
||||
|
||||
// compute icon X location (relative to text X location)
|
||||
if( icon != null ) {
|
||||
iconR.x = leftToRight
|
||||
? textR.x - iconWidthAndGap
|
||||
: textR.x + textR.width + iconTextGap;
|
||||
}
|
||||
|
||||
return clippedText;
|
||||
}
|
||||
|
||||
private boolean hasLeadingMenus( JMenuBar menuBar ) {
|
||||
// check whether menu bar is empty
|
||||
if( menuBar.getComponentCount() == 0 || menuBar.getWidth() == 0 )
|
||||
return false;
|
||||
|
||||
// check whether menu bar has a leading glue component
|
||||
// (no menus/components at left side)
|
||||
Component horizontalGlue = findHorizontalGlue( menuBar );
|
||||
if( horizontalGlue != null ) {
|
||||
boolean leftToRight = getComponentOrientation().isLeftToRight();
|
||||
if( (leftToRight && horizontalGlue.getX() == 0) ||
|
||||
(!leftToRight && horizontalGlue.getX() + horizontalGlue.getWidth() == menuBar.getWidth()) )
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1016,6 +1174,9 @@ debug*/
|
||||
if( window == null )
|
||||
return; // should newer occur
|
||||
|
||||
if( !SwingUtilities.isLeftMouseButton( e ) )
|
||||
return;
|
||||
|
||||
dragOffset = SwingUtilities.convertPoint( FlatTitlePane.this, e.getPoint(), window );
|
||||
}
|
||||
|
||||
@@ -1030,6 +1191,9 @@ debug*/
|
||||
if( window == null )
|
||||
return; // should newer occur
|
||||
|
||||
if( !SwingUtilities.isLeftMouseButton( e ) )
|
||||
return;
|
||||
|
||||
if( hasNativeCustomDecoration() )
|
||||
return; // do nothing if having native window border
|
||||
|
||||
|
||||
@@ -22,10 +22,7 @@ import java.awt.Component;
|
||||
import java.awt.Graphics;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.util.Map;
|
||||
import javax.swing.AbstractButton;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JToggleButton;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.*;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
|
||||
@@ -51,15 +48,29 @@ import com.formdev.flatlaf.util.UIScale;
|
||||
* @uiDefault ToggleButton.iconTextGap int
|
||||
* @uiDefault ToggleButton.startBackground Color optional; if set, a gradient paint is used and ToggleButton.background is ignored
|
||||
* @uiDefault ToggleButton.endBackground Color optional; if set, a gradient paint is used
|
||||
* @uiDefault ToggleButton.pressedBackground Color
|
||||
* @uiDefault ToggleButton.focusedBackground Color optional
|
||||
* @uiDefault ToggleButton.focusedForeground Color optional
|
||||
* @uiDefault ToggleButton.hoverBackground Color optional
|
||||
* @uiDefault ToggleButton.hoverForeground Color optional
|
||||
* @uiDefault ToggleButton.pressedBackground Color optional
|
||||
* @uiDefault ToggleButton.pressedForeground Color optional
|
||||
* @uiDefault ToggleButton.selectedBackground Color
|
||||
* @uiDefault ToggleButton.selectedForeground Color
|
||||
* @uiDefault ToggleButton.disabledBackground Color optional
|
||||
* @uiDefault ToggleButton.disabledText Color
|
||||
* @uiDefault ToggleButton.disabledSelectedBackground Color
|
||||
* @uiDefault ToggleButton.disabledSelectedForeground Color optional
|
||||
* @uiDefault Button.paintShadow boolean default is false
|
||||
* @uiDefault Button.shadowWidth int default is 2
|
||||
* @uiDefault Button.shadowColor Color optional
|
||||
* @uiDefault ToggleButton.toolbar.hoverBackground Color
|
||||
* @uiDefault ToggleButton.toolbar.hoverForeground Color optional
|
||||
* @uiDefault ToggleButton.toolbar.pressedBackground Color
|
||||
* @uiDefault ToggleButton.toolbar.pressedForeground Color optional
|
||||
* @uiDefault ToggleButton.toolbar.selectedBackground Color
|
||||
* @uiDefault ToggleButton.toolbar.selectedForeground Color optional
|
||||
* @uiDefault ToggleButton.toolbar.disabledSelectedBackground Color optional
|
||||
* @uiDefault ToggleButton.toolbar.disabledSelectedForeground Color optional
|
||||
*
|
||||
* <!-- FlatToggleButtonUI -->
|
||||
*
|
||||
@@ -67,8 +78,11 @@ import com.formdev.flatlaf.util.UIScale;
|
||||
* @uiDefault ToggleButton.tab.underlineColor Color
|
||||
* @uiDefault ToggleButton.tab.disabledUnderlineColor Color
|
||||
* @uiDefault ToggleButton.tab.selectedBackground Color optional
|
||||
* @uiDefault ToggleButton.tab.selectedForeground Color optional
|
||||
* @uiDefault ToggleButton.tab.hoverBackground Color
|
||||
* @uiDefault ToggleButton.tab.hoverForeground Color optional
|
||||
* @uiDefault ToggleButton.tab.focusBackground Color
|
||||
* @uiDefault ToggleButton.tab.focusForeground Color optional
|
||||
*
|
||||
*
|
||||
* @author Karl Tauber
|
||||
@@ -80,8 +94,11 @@ public class FlatToggleButtonUI
|
||||
@Styleable(dot=true) protected Color tabUnderlineColor;
|
||||
@Styleable(dot=true) protected Color tabDisabledUnderlineColor;
|
||||
@Styleable(dot=true) protected Color tabSelectedBackground;
|
||||
/** @since 2.3 */ @Styleable(dot=true) protected Color tabSelectedForeground;
|
||||
@Styleable(dot=true) protected Color tabHoverBackground;
|
||||
/** @since 2.3 */ @Styleable(dot=true) protected Color tabHoverForeground;
|
||||
@Styleable(dot=true) protected Color tabFocusBackground;
|
||||
/** @since 2.3 */ @Styleable(dot=true) protected Color tabFocusForeground;
|
||||
|
||||
private boolean defaults_initialized = false;
|
||||
|
||||
@@ -114,8 +131,11 @@ public class FlatToggleButtonUI
|
||||
tabUnderlineColor = UIManager.getColor( "ToggleButton.tab.underlineColor" );
|
||||
tabDisabledUnderlineColor = UIManager.getColor( "ToggleButton.tab.disabledUnderlineColor" );
|
||||
tabSelectedBackground = UIManager.getColor( "ToggleButton.tab.selectedBackground" );
|
||||
tabSelectedForeground = UIManager.getColor( "ToggleButton.tab.selectedForeground" );
|
||||
tabHoverBackground = UIManager.getColor( "ToggleButton.tab.hoverBackground" );
|
||||
tabHoverForeground = UIManager.getColor( "ToggleButton.tab.hoverForeground" );
|
||||
tabFocusBackground = UIManager.getColor( "ToggleButton.tab.focusBackground" );
|
||||
tabFocusForeground = UIManager.getColor( "ToggleButton.tab.focusForeground" );
|
||||
|
||||
defaults_initialized = true;
|
||||
}
|
||||
@@ -142,6 +162,7 @@ public class FlatToggleButtonUI
|
||||
b.repaint();
|
||||
break;
|
||||
|
||||
case TAB_BUTTON_UNDERLINE_PLACEMENT:
|
||||
case TAB_BUTTON_UNDERLINE_HEIGHT:
|
||||
case TAB_BUTTON_UNDERLINE_COLOR:
|
||||
case TAB_BUTTON_SELECTED_BACKGROUND:
|
||||
@@ -196,13 +217,42 @@ public class FlatToggleButtonUI
|
||||
|
||||
// paint underline if selected
|
||||
if( selected ) {
|
||||
int underlineHeight = UIScale.scale( clientPropertyInt( c, TAB_BUTTON_UNDERLINE_HEIGHT, tabUnderlineHeight ) );
|
||||
int underlineThickness = UIScale.scale( clientPropertyInt( c, TAB_BUTTON_UNDERLINE_HEIGHT, tabUnderlineHeight ) );
|
||||
g.setColor( c.isEnabled()
|
||||
? clientPropertyColor( c, TAB_BUTTON_UNDERLINE_COLOR, tabUnderlineColor )
|
||||
: tabDisabledUnderlineColor );
|
||||
g.fillRect( 0, height - underlineHeight, width, underlineHeight );
|
||||
int placement = clientPropertyInt( c, TAB_BUTTON_UNDERLINE_PLACEMENT, SwingConstants.BOTTOM );
|
||||
switch (placement) {
|
||||
case SwingConstants.TOP:
|
||||
g.fillRect( 0, 0, width, underlineThickness );
|
||||
break;
|
||||
case SwingConstants.LEFT:
|
||||
g.fillRect( 0, 0, underlineThickness, height );
|
||||
break;
|
||||
case SwingConstants.RIGHT:
|
||||
g.fillRect( width - underlineThickness, 0, underlineThickness, height );
|
||||
break;
|
||||
case SwingConstants.BOTTOM:
|
||||
default:
|
||||
g.fillRect( 0, height - underlineThickness, width, underlineThickness );
|
||||
}
|
||||
}
|
||||
} else
|
||||
super.paintBackground( g, c );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Color getForeground( JComponent c ) {
|
||||
if( isTabButton( c ) ) {
|
||||
if( !c.isEnabled() )
|
||||
return disabledText;
|
||||
|
||||
if( tabSelectedForeground != null && ((AbstractButton)c).isSelected() )
|
||||
return tabSelectedForeground;
|
||||
|
||||
return buttonStateColor( c, c.getForeground(), disabledText,
|
||||
tabFocusForeground, tabHoverForeground, null );
|
||||
} else
|
||||
return super.getForeground( c );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,11 +256,15 @@ public class FlatToolBarUI
|
||||
default: return;
|
||||
}
|
||||
|
||||
for( int i = focusedCompIndex + add; i != focusedCompIndex; i += add ) {
|
||||
int i = focusedCompIndex;
|
||||
for(;;) {
|
||||
i += add;
|
||||
if( i < 0 )
|
||||
i = count - 1;
|
||||
else if( i >= count )
|
||||
i = 0;
|
||||
if( i == focusedCompIndex )
|
||||
break;
|
||||
|
||||
Component c = toolBar.getComponentAtIndex( i );
|
||||
if( canBeFocusOwner( c ) ) {
|
||||
|
||||
@@ -245,7 +245,7 @@ public class FlatUIUtils
|
||||
isInActiveWindow( c, keyboardFocusManager.getActiveWindow() );
|
||||
}
|
||||
|
||||
private static boolean isInActiveWindow( Component c, Window activeWindow ) {
|
||||
static boolean isInActiveWindow( Component c, Window activeWindow ) {
|
||||
Window window = SwingUtilities.windowForComponent( c );
|
||||
return window == activeWindow ||
|
||||
(window != null && window.getType() == Window.Type.POPUP && window.getOwner() == activeWindow);
|
||||
|
||||
@@ -18,8 +18,8 @@ package com.formdev.flatlaf.ui;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Graphics;
|
||||
import java.lang.reflect.Method;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.JViewport;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.basic.BasicViewportUI;
|
||||
@@ -43,15 +43,28 @@ public class FlatViewportUI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update( Graphics g, JComponent c ) {
|
||||
Component view = ((JViewport)c).getView();
|
||||
if( c.isOpaque() && view instanceof JTable ) {
|
||||
// paint viewport background in same color as table background
|
||||
g.setColor( view.getBackground() );
|
||||
g.fillRect( 0, 0, c.getWidth(), c.getHeight() );
|
||||
public void paint( Graphics g, JComponent c ) {
|
||||
super.paint( g, c );
|
||||
|
||||
paint( g, c );
|
||||
} else
|
||||
super.update( g, c );
|
||||
Component view = ((JViewport)c).getView();
|
||||
if( view instanceof JComponent ) {
|
||||
try {
|
||||
Method m = view.getClass().getMethod( "getUI" );
|
||||
Object ui = m.invoke( view );
|
||||
if( ui instanceof ViewportPainter )
|
||||
((ViewportPainter)ui).paintViewport( g, (JComponent) view, (JViewport) c );
|
||||
} catch( Exception ex ) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---- interface ViewportPainter ------------------------------------------
|
||||
|
||||
/**
|
||||
* @since 2.3
|
||||
*/
|
||||
public interface ViewportPainter {
|
||||
void paintViewport( Graphics g, JComponent c, JViewport viewport );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ import javax.swing.JComponent;
|
||||
import javax.swing.JInternalFrame;
|
||||
import javax.swing.JLayeredPane;
|
||||
import javax.swing.JRootPane;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.UIManager;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -521,7 +522,7 @@ debug*/
|
||||
|
||||
@Override
|
||||
public void mousePressed( MouseEvent e ) {
|
||||
if( !isWindowResizable() )
|
||||
if( !SwingUtilities.isLeftMouseButton( e ) || !isWindowResizable() )
|
||||
return;
|
||||
|
||||
int xOnScreen = e.getXOnScreen();
|
||||
@@ -550,7 +551,7 @@ debug*/
|
||||
|
||||
@Override
|
||||
public void mouseReleased( MouseEvent e ) {
|
||||
if( !isWindowResizable() )
|
||||
if( !SwingUtilities.isLeftMouseButton( e ) || !isWindowResizable() )
|
||||
return;
|
||||
|
||||
dragLeftOffset = dragRightOffset = dragTopOffset = dragBottomOffset = 0;
|
||||
@@ -576,7 +577,7 @@ debug*/
|
||||
|
||||
@Override
|
||||
public void mouseDragged( MouseEvent e ) {
|
||||
if( !isWindowResizable() )
|
||||
if( !SwingUtilities.isLeftMouseButton( e ) || !isWindowResizable() )
|
||||
return;
|
||||
|
||||
int xOnScreen = e.getXOnScreen();
|
||||
|
||||
@@ -27,7 +27,6 @@ import java.awt.Window;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.io.File;
|
||||
import java.util.Collections;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.List;
|
||||
@@ -38,9 +37,7 @@ import javax.swing.Timer;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import javax.swing.event.EventListenerList;
|
||||
import com.formdev.flatlaf.FlatSystemProperties;
|
||||
import com.formdev.flatlaf.util.LoggingFacade;
|
||||
import com.formdev.flatlaf.util.NativeLibrary;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
|
||||
//
|
||||
@@ -84,7 +81,6 @@ class FlatWindowsNativeWindowBorder
|
||||
private Color colorizationColor;
|
||||
private int colorizationColorBalance;
|
||||
|
||||
private static NativeLibrary nativeLibrary;
|
||||
private static FlatWindowsNativeWindowBorder instance;
|
||||
|
||||
static FlatNativeWindowBorder.Provider getInstance() {
|
||||
@@ -96,31 +92,8 @@ class FlatWindowsNativeWindowBorder
|
||||
if( !SystemInfo.isX86 && !SystemInfo.isX86_64 )
|
||||
return null;
|
||||
|
||||
// load native library
|
||||
if( nativeLibrary == null ) {
|
||||
if( !SystemInfo.isJava_9_orLater ) {
|
||||
// In Java 8, load jawt.dll (part of JRE) explicitly because it
|
||||
// is not found when running application with <jdk>/bin/java.exe.
|
||||
// When using <jdk>/jre/bin/java.exe, it is found.
|
||||
// jawt.dll is located in <jdk>/jre/bin/.
|
||||
// Java 9 and later does not have this problem.
|
||||
try {
|
||||
System.loadLibrary( "jawt" );
|
||||
} catch( UnsatisfiedLinkError ex ) {
|
||||
// log error only if native library jawt.dll not already loaded
|
||||
String message = ex.getMessage();
|
||||
if( message == null || !message.contains( "already loaded in another classloader" ) )
|
||||
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||
} catch( Exception ex ) {
|
||||
LoggingFacade.INSTANCE.logSevere( null, ex );
|
||||
}
|
||||
}
|
||||
|
||||
nativeLibrary = createNativeLibrary();
|
||||
}
|
||||
|
||||
// check whether native library was successfully loaded
|
||||
if( !nativeLibrary.isLoaded() )
|
||||
if( !FlatNativeLibrary.isLoaded() )
|
||||
return null;
|
||||
|
||||
// create new instance
|
||||
@@ -129,23 +102,6 @@ class FlatWindowsNativeWindowBorder
|
||||
return instance;
|
||||
}
|
||||
|
||||
private static NativeLibrary createNativeLibrary() {
|
||||
String libraryName = "flatlaf-windows-x86";
|
||||
if( SystemInfo.isX86_64 )
|
||||
libraryName += "_64";
|
||||
|
||||
String libraryPath = System.getProperty( FlatSystemProperties.NATIVE_LIBRARY_PATH );
|
||||
if( libraryPath != null ) {
|
||||
File libraryFile = new File( libraryPath, libraryName + ".dll" );
|
||||
if( libraryFile.exists() )
|
||||
return new NativeLibrary( libraryFile, true );
|
||||
else
|
||||
LoggingFacade.INSTANCE.logSevere( "Did not find external library " + libraryFile + ", using extracted library instead", null );
|
||||
}
|
||||
|
||||
return new NativeLibrary( "com/formdev/flatlaf/natives/" + libraryName, null, true );
|
||||
}
|
||||
|
||||
private FlatWindowsNativeWindowBorder() {
|
||||
}
|
||||
|
||||
|
||||
@@ -195,11 +195,13 @@ public class JBRCustomDecorations
|
||||
{
|
||||
private static JBRWindowTopBorder instance;
|
||||
|
||||
private final Color defaultActiveBorder = new Color( 0x707070 );
|
||||
private final Color activeLightColor = new Color( 0x707070 );
|
||||
private final Color activeDarkColor = new Color( 0x2D2E2F );
|
||||
private final Color inactiveLightColor = new Color( 0xaaaaaa );
|
||||
private final Color inactiveDarkColor = new Color( 0x494A4B );
|
||||
|
||||
private boolean colorizationAffectsBorders;
|
||||
private Color activeColor = defaultActiveBorder;
|
||||
private Color activeColor;
|
||||
|
||||
static JBRWindowTopBorder getInstance() {
|
||||
if( instance == null )
|
||||
@@ -250,7 +252,7 @@ public class JBRCustomDecorations
|
||||
|
||||
private Color calculateActiveBorderColor() {
|
||||
if( !colorizationAffectsBorders )
|
||||
return defaultActiveBorder;
|
||||
return null;
|
||||
|
||||
Color colorizationColor = getColorizationColor();
|
||||
if( colorizationColor != null ) {
|
||||
@@ -285,15 +287,11 @@ public class JBRCustomDecorations
|
||||
public void paintBorder( Component c, Graphics g, int x, int y, int width, int height ) {
|
||||
Window window = SwingUtilities.windowForComponent( c );
|
||||
boolean active = window != null && window.isActive();
|
||||
boolean dark = FlatLaf.isLafDark();
|
||||
|
||||
// paint top border
|
||||
// - in light themes
|
||||
// - in dark themes only for active windows if colorization affects borders
|
||||
boolean paintTopBorder = !FlatLaf.isLafDark() || (active && colorizationAffectsBorders);
|
||||
if( !paintTopBorder )
|
||||
return;
|
||||
|
||||
g.setColor( active ? activeColor : inactiveLightColor );
|
||||
g.setColor( active
|
||||
? (activeColor != null ? activeColor : (dark ? activeDarkColor : activeLightColor))
|
||||
: (dark ? inactiveDarkColor : inactiveLightColor) );
|
||||
HiDPIUtils.paintAtScale1x( (Graphics2D) g, x, y, width, height, this::paintImpl );
|
||||
}
|
||||
|
||||
|
||||
@@ -143,8 +143,8 @@ public class MigLayoutVisualPadding
|
||||
//---- class FlatMigInsets ------------------------------------------------
|
||||
|
||||
/**
|
||||
* Marker class to identify our visual paddings and leaf paddings,
|
||||
* which were set from outside, untouched.
|
||||
* Marker class to identify our visual paddings and leave paddings
|
||||
* set from outside untouched.
|
||||
*/
|
||||
private static class FlatMigInsets
|
||||
extends Insets
|
||||
|
||||
@@ -48,30 +48,55 @@ public class HiDPIUtils
|
||||
*/
|
||||
public static void paintAtScale1x( Graphics2D g, int x, int y, int width, int height, Painter painter ) {
|
||||
// save original transform
|
||||
AffineTransform transform = g.getTransform();
|
||||
AffineTransform t = g.getTransform();
|
||||
|
||||
// get scale X/Y and shear X/Y
|
||||
double scaleX = t.getScaleX();
|
||||
double scaleY = t.getScaleY();
|
||||
double shearX = t.getShearX();
|
||||
double shearY = t.getShearY();
|
||||
|
||||
// check whether rotated
|
||||
// (also check for negative scale X/Y because shear X/Y are zero for 180 degrees rotation)
|
||||
boolean rotated = (shearX != 0 || shearY != 0 || scaleX <= 0 || scaleY <= 0);
|
||||
if( rotated ) {
|
||||
// resulting scale X/Y values are always positive
|
||||
scaleX = Math.hypot( scaleX, shearX );
|
||||
scaleY = Math.hypot( scaleY, shearY );
|
||||
} else {
|
||||
// make scale X/Y positive
|
||||
scaleX = Math.abs( scaleX );
|
||||
scaleY = Math.abs( scaleY );
|
||||
}
|
||||
|
||||
// check whether scaled
|
||||
if( transform.getScaleX() == 1 && transform.getScaleY() == 1 ) {
|
||||
if( scaleX == 1 && scaleY == 1 ) {
|
||||
painter.paint( g, x, y, width, height, 1 );
|
||||
return;
|
||||
}
|
||||
|
||||
// scale rectangle
|
||||
Rectangle2D.Double scaledRect = scale( transform, x, y, width, height );
|
||||
Rectangle2D.Double scaledRect = scale( scaleX, scaleY, t, x, y, width, height );
|
||||
|
||||
try {
|
||||
// unscale to factor 1.0 and move origin (to whole numbers)
|
||||
g.setTransform( new AffineTransform( 1, 0, 0, 1,
|
||||
Math.floor( scaledRect.x ), Math.floor( scaledRect.y ) ) );
|
||||
// unscale to factor 1.0, keep rotation and move origin (to whole numbers)
|
||||
AffineTransform t1x;
|
||||
if( rotated ) {
|
||||
t1x = new AffineTransform( t.getScaleX(), t.getShearY(), t.getShearX(), t.getScaleY(),
|
||||
Math.floor( scaledRect.x ), Math.floor( scaledRect.y ) );
|
||||
t1x.scale( 1. / scaleX, 1. / scaleY );
|
||||
} else
|
||||
t1x = new AffineTransform( 1, 0, 0, 1, Math.floor( scaledRect.x ), Math.floor( scaledRect.y ) );
|
||||
g.setTransform( t1x );
|
||||
|
||||
int swidth = (int) scaledRect.width;
|
||||
int sheight = (int) scaledRect.height;
|
||||
|
||||
// paint
|
||||
painter.paint( g, 0, 0, swidth, sheight, transform.getScaleX() );
|
||||
painter.paint( g, 0, 0, swidth, sheight, scaleX );
|
||||
} finally {
|
||||
// restore original transform
|
||||
g.setTransform( transform );
|
||||
g.setTransform( t );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,20 +105,16 @@ public class HiDPIUtils
|
||||
* sun.java2d.pipe.PixelToParallelogramConverter.fillRectangle(),
|
||||
* which is used by Graphics.fillRect().
|
||||
*/
|
||||
private static Rectangle2D.Double scale( AffineTransform transform, int x, int y, int width, int height ) {
|
||||
double dx1 = transform.getScaleX();
|
||||
double dy2 = transform.getScaleY();
|
||||
double px = x * dx1 + transform.getTranslateX();
|
||||
double py = y * dy2 + transform.getTranslateY();
|
||||
dx1 *= width;
|
||||
dy2 *= height;
|
||||
private static Rectangle2D.Double scale( double scaleX, double scaleY, AffineTransform t, int x, int y, int width, int height ) {
|
||||
double px = (x * scaleX) + t.getTranslateX();
|
||||
double py = (y * scaleY) + t.getTranslateY();
|
||||
|
||||
double newx = normalize( px );
|
||||
double newy = normalize( py );
|
||||
dx1 = normalize( px + dx1 ) - newx;
|
||||
dy2 = normalize( py + dy2 ) - newy;
|
||||
double newX = normalize( px );
|
||||
double newY = normalize( py );
|
||||
double newWidth = normalize( px + (width * scaleX) ) - newX;
|
||||
double newHeight = normalize( py + (height * scaleY) ) - newY;
|
||||
|
||||
return new Rectangle2D.Double( newx, newy, dx1, dy2 );
|
||||
return new Rectangle2D.Double( newX, newY, newWidth, newHeight );
|
||||
}
|
||||
|
||||
private static double normalize( double value ) {
|
||||
|
||||
@@ -143,16 +143,19 @@ public class NativeLibrary
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add prefix and suffix to library name.
|
||||
* <ul>
|
||||
* <li>Windows: libraryName + ".dll"
|
||||
* <li>macOS: "lib" + libraryName + ".dylib"
|
||||
* <li>Linux: "lib" + libraryName + ".so"
|
||||
* </ul>
|
||||
*/
|
||||
private static String decorateLibraryName( String libraryName ) {
|
||||
if( SystemInfo.isWindows )
|
||||
return libraryName.concat( ".dll" );
|
||||
|
||||
String suffix = SystemInfo.isMacOS ? ".dylib" : ".so";
|
||||
|
||||
int sep = libraryName.lastIndexOf( '/' );
|
||||
return (sep >= 0)
|
||||
? libraryName.substring( 0, sep + 1 ) + "lib" + libraryName.substring( sep + 1 ) + suffix
|
||||
: "lib" + libraryName + suffix;
|
||||
? libraryName.substring( 0, sep + 1 ) + System.mapLibraryName( libraryName.substring( sep + 1 ) )
|
||||
: System.mapLibraryName( libraryName );
|
||||
}
|
||||
|
||||
private static void log( String msg, Throwable thrown ) {
|
||||
|
||||
@@ -50,6 +50,7 @@ public class SystemInfo
|
||||
public static final long javaVersion;
|
||||
public static final boolean isJava_9_orLater;
|
||||
public static final boolean isJava_11_orLater;
|
||||
/** @since 2.3 */ public static final boolean isJava_12_orLater;
|
||||
public static final boolean isJava_15_orLater;
|
||||
/** @since 2 */ public static final boolean isJava_17_orLater;
|
||||
/** @since 2 */ public static final boolean isJava_18_orLater;
|
||||
@@ -66,6 +67,9 @@ public class SystemInfo
|
||||
/** @since 1.1.2 */ public static final boolean isWebswing;
|
||||
/** @since 1.1.1 */ public static final boolean isWinPE;
|
||||
|
||||
// features
|
||||
/** @since 2.3 */ public static final boolean isMacFullWindowContentSupported;
|
||||
|
||||
static {
|
||||
// platforms
|
||||
String osName = System.getProperty( "os.name" ).toLowerCase( Locale.ENGLISH );
|
||||
@@ -92,6 +96,7 @@ public class SystemInfo
|
||||
javaVersion = scanVersion( System.getProperty( "java.version" ) );
|
||||
isJava_9_orLater = (javaVersion >= toVersion( 9, 0, 0, 0 ));
|
||||
isJava_11_orLater = (javaVersion >= toVersion( 11, 0, 0, 0 ));
|
||||
isJava_12_orLater = (javaVersion >= toVersion( 12, 0, 0, 0 ));
|
||||
isJava_15_orLater = (javaVersion >= toVersion( 15, 0, 0, 0 ));
|
||||
isJava_17_orLater = (javaVersion >= toVersion( 17, 0, 0, 0 ));
|
||||
isJava_18_orLater = (javaVersion >= toVersion( 18, 0, 0, 0 ));
|
||||
@@ -108,6 +113,12 @@ public class SystemInfo
|
||||
isProjector = Boolean.getBoolean( "org.jetbrains.projector.server.enable" );
|
||||
isWebswing = (System.getProperty( "webswing.rootDir" ) != null);
|
||||
isWinPE = isWindows && "X:\\Windows\\System32".equalsIgnoreCase( System.getProperty( "user.dir" ) );
|
||||
|
||||
// features
|
||||
// available since Java 12; backported to Java 11.0.8 and 8u292
|
||||
isMacFullWindowContentSupported =
|
||||
javaVersion >= toVersion( 11, 0, 8, 0 ) ||
|
||||
(javaVersion >= toVersion( 1, 8, 0, 292 ) && !isJava_9_orLater);
|
||||
}
|
||||
|
||||
public static long scanVersion( String version ) {
|
||||
|
||||
@@ -306,6 +306,7 @@ SplitPaneDivider.draggingColor = $Component.borderColor
|
||||
#---- TabbedPane ----
|
||||
|
||||
TabbedPane.underlineColor = @accentUnderlineColor
|
||||
TabbedPane.inactiveUnderlineColor = mix(@accentUnderlineColor,$TabbedPane.background,60%)
|
||||
TabbedPane.disabledUnderlineColor = lighten(@background,23%)
|
||||
TabbedPane.hoverColor = darken($TabbedPane.background,5%,derived noAutoInverse)
|
||||
TabbedPane.focusColor = mix(@selectionBackground,$TabbedPane.background,25%)
|
||||
@@ -324,7 +325,7 @@ TabbedPane.closePressedForeground = $TabbedPane.closeHoverForeground
|
||||
|
||||
#---- Table ----
|
||||
|
||||
Table.gridColor = lighten($Table.background,5%)
|
||||
Table.gridColor = lighten($Table.background,8%)
|
||||
|
||||
|
||||
#---- TableHeader ----
|
||||
|
||||
@@ -64,7 +64,7 @@ light.font = +0
|
||||
semibold.font = +0
|
||||
|
||||
# monospaced
|
||||
[win]monospaced.font = Consolas, "Courier New", Monospaced
|
||||
[win]monospaced.font = Monospaced
|
||||
[mac]monospaced.font = Menlo, Monospaced
|
||||
[linux]monospaced.font = "Liberation Mono", "Ubuntu Mono", Monospaced
|
||||
monospaced.font = Monospaced
|
||||
@@ -332,6 +332,7 @@ FileView.fileIcon = com.formdev.flatlaf.icons.FlatFileViewFileIcon
|
||||
FileView.computerIcon = com.formdev.flatlaf.icons.FlatFileViewComputerIcon
|
||||
FileView.hardDriveIcon = com.formdev.flatlaf.icons.FlatFileViewHardDriveIcon
|
||||
FileView.floppyDriveIcon = com.formdev.flatlaf.icons.FlatFileViewFloppyDriveIcon
|
||||
FileView.fullRowSelection = true
|
||||
|
||||
|
||||
#---- FormattedTextField ----
|
||||
@@ -788,11 +789,16 @@ TitlePane.noIconLeftGap = 8
|
||||
TitlePane.iconSize = 16,16
|
||||
TitlePane.iconMargins = 3,8,3,8
|
||||
TitlePane.titleMargins = 3,0,3,0
|
||||
TitlePane.titleMinimumWidth = 60
|
||||
TitlePane.buttonSize = 44,30
|
||||
TitlePane.buttonMinimumWidth = 30
|
||||
TitlePane.buttonMaximizedHeight = 22
|
||||
TitlePane.centerTitle = false
|
||||
TitlePane.centerTitleIfMenuBarEmbedded = true
|
||||
TitlePane.menuBarTitleGap = 20
|
||||
TitlePane.showIconBesideTitle = false
|
||||
TitlePane.menuBarTitleGap = 40
|
||||
TitlePane.menuBarTitleMinimumGap = 12
|
||||
TitlePane.menuBarResizeHeight = 4
|
||||
TitlePane.closeIcon = com.formdev.flatlaf.icons.FlatWindowCloseIcon
|
||||
TitlePane.iconifyIcon = com.formdev.flatlaf.icons.FlatWindowIconifyIcon
|
||||
TitlePane.maximizeIcon = com.formdev.flatlaf.icons.FlatWindowMaximizeIcon
|
||||
@@ -828,6 +834,7 @@ ToggleButton.tab.underlineHeight = 2
|
||||
ToggleButton.tab.underlineColor = $TabbedPane.underlineColor
|
||||
ToggleButton.tab.disabledUnderlineColor = $TabbedPane.disabledUnderlineColor
|
||||
ToggleButton.tab.selectedBackground = $?TabbedPane.selectedBackground
|
||||
ToggleButton.tab.selectedForeground = $?TabbedPane.selectedForeground
|
||||
ToggleButton.tab.hoverBackground = $TabbedPane.hoverColor
|
||||
ToggleButton.tab.focusBackground = $TabbedPane.focusColor
|
||||
|
||||
|
||||
@@ -313,6 +313,7 @@ SplitPaneDivider.draggingColor = $Component.borderColor
|
||||
#---- TabbedPane ----
|
||||
|
||||
TabbedPane.underlineColor = @accentUnderlineColor
|
||||
TabbedPane.inactiveUnderlineColor = mix(@accentUnderlineColor,$TabbedPane.background,50%)
|
||||
TabbedPane.disabledUnderlineColor = darken(@background,28%)
|
||||
TabbedPane.hoverColor = darken($TabbedPane.background,7%,derived)
|
||||
TabbedPane.focusColor = mix(@selectionBackground,$TabbedPane.background,10%)
|
||||
@@ -331,7 +332,7 @@ TabbedPane.closePressedForeground = $TabbedPane.closeHoverForeground
|
||||
|
||||
#---- Table ----
|
||||
|
||||
Table.gridColor = darken($Table.background,5%)
|
||||
Table.gridColor = darken($Table.background,8%)
|
||||
|
||||
|
||||
#---- TableHeader ----
|
||||
|
||||
@@ -67,6 +67,11 @@ Button.default.hoverBorderColor = null
|
||||
[dark]CheckBoxMenuItem.icon.checkmarkColor=#fff9
|
||||
|
||||
|
||||
#---- Component ----
|
||||
|
||||
Component.accentColor = lazy(ProgressBar.foreground)
|
||||
|
||||
|
||||
#---- HelpButton ----
|
||||
|
||||
HelpButton.hoverBorderColor = null
|
||||
@@ -77,6 +82,13 @@ HelpButton.hoverBorderColor = null
|
||||
Slider.focusedColor = fade($Component.focusColor,40%,derived)
|
||||
|
||||
|
||||
#---- TabbedPane ----
|
||||
|
||||
# colors from JBUI.CurrentTheme.DefaultTabs.inactiveUnderlineColor()
|
||||
[light]TabbedPane.inactiveUnderlineColor = #9ca7b8
|
||||
[dark]TabbedPane.inactiveUnderlineColor = #747a80
|
||||
|
||||
|
||||
#---- ToggleButton ----
|
||||
|
||||
ToggleButton.startBackground = $ToggleButton.background
|
||||
@@ -121,6 +133,7 @@ ToggleButton.endBackground = $ToggleButton.background
|
||||
[Arc_Theme_Dark_-_Orange]ProgressBar.selectionBackground = #ddd
|
||||
[Arc_Theme_Dark_-_Orange]ProgressBar.selectionForeground = #fff
|
||||
|
||||
[Cobalt_2]Component.accentColor = lazy(Component.focusColor)
|
||||
[Cobalt_2]CheckBox.icon.background = #002946
|
||||
[Cobalt_2]CheckBox.icon.checkmarkColor = #002946
|
||||
[Cobalt_2]MenuItem.checkBackground = @ijMenuCheckBackgroundL10
|
||||
@@ -129,31 +142,39 @@ ToggleButton.endBackground = $ToggleButton.background
|
||||
[Cyan_light]MenuItem.checkBackground = @ijMenuCheckBackgroundL20
|
||||
[Cyan_light]MenuItem.underlineSelectionCheckBackground = @ijMenuCheckBackgroundL20
|
||||
|
||||
[Dark_Flat_Theme]Component.accentColor = lazy(List.selectionBackground)
|
||||
[Dark_Flat_Theme]TableHeader.background = #3B3B3B
|
||||
|
||||
[Dark_purple]Slider.focusedColor = fade($Component.focusColor,70%,derived)
|
||||
|
||||
[Dracula---Zihan_Ma]Component.accentColor = lazy(Component.focusColor)
|
||||
[Dracula---Zihan_Ma]ProgressBar.selectionBackground = #fff
|
||||
[Dracula---Zihan_Ma]ProgressBar.selectionForeground = #fff
|
||||
|
||||
[Gradianto_Dark_Fuchsia]MenuItem.checkBackground = @ijMenuCheckBackgroundL10
|
||||
[Gradianto_Dark_Fuchsia]MenuItem.underlineSelectionCheckBackground = @ijMenuCheckBackgroundL10
|
||||
|
||||
[Gruvbox_Dark_Hard]Component.accentColor = lazy(TabbedPane.underlineColor)
|
||||
[Gruvbox_Dark_Hard]ToggleButton.selectedBackground = $ToggleButton.selectedBackground
|
||||
[Gruvbox_Dark_Hard]ToggleButton.toolbar.selectedBackground = $ToggleButton.toolbar.selectedBackground
|
||||
|
||||
[Gruvbox_Dark_Medium]Component.accentColor = lazy(TabbedPane.underlineColor)
|
||||
[Gruvbox_Dark_Medium]ToggleButton.selectedBackground = $ToggleButton.selectedBackground
|
||||
[Gruvbox_Dark_Medium]ToggleButton.toolbar.selectedBackground = $ToggleButton.toolbar.selectedBackground
|
||||
|
||||
[Gruvbox_Dark_Soft]Component.accentColor = lazy(TabbedPane.underlineColor)
|
||||
[Gruvbox_Dark_Soft]MenuItem.checkBackground = @ijMenuCheckBackgroundL10
|
||||
[Gruvbox_Dark_Soft]MenuItem.underlineSelectionCheckBackground = @ijMenuCheckBackgroundL10
|
||||
[Gruvbox_Dark_Soft]ToggleButton.selectedBackground = $ToggleButton.selectedBackground
|
||||
[Gruvbox_Dark_Soft]ToggleButton.toolbar.selectedBackground = $ToggleButton.toolbar.selectedBackground
|
||||
|
||||
[Hiberbee_Dark]TabbedPane.focusColor = #5A5A5A
|
||||
[Hiberbee_Dark]TabbedPane.selectedBackground = #434241
|
||||
[Hiberbee_Dark]TabbedPane.selectedForeground = #70D7FF
|
||||
[Hiberbee_Dark]ToggleButton.selectedBackground = $ToggleButton.selectedBackground
|
||||
[Hiberbee_Dark]ToggleButton.toolbar.selectedBackground = $ToggleButton.toolbar.selectedBackground
|
||||
|
||||
[High_contrast]Component.accentColor = lazy(Component.focusColor)
|
||||
[High_contrast]ToggleButton.selectedBackground = #fff
|
||||
[High_contrast]ToggleButton.selectedForeground = #000
|
||||
[High_contrast]ToggleButton.disabledSelectedBackground = #444
|
||||
@@ -164,6 +185,7 @@ ToggleButton.endBackground = $ToggleButton.background
|
||||
toolbar.selectedBackground: #fff
|
||||
[High_contrast][style]ToggleButton.inTextField = $[High_contrast][style]Button.inTextField
|
||||
|
||||
[Light_Flat]Component.accentColor = lazy(TabbedPane.underlineColor)
|
||||
[Light_Flat]TableHeader.background = #E5E5E9
|
||||
|
||||
[Monocai]MenuItem.checkBackground = @ijMenuCheckBackgroundL10
|
||||
@@ -179,6 +201,8 @@ ToggleButton.endBackground = $ToggleButton.background
|
||||
[Monocai]RadioButtonMenuItem.acceleratorForeground = @Monocai.acceleratorForeground
|
||||
[Monocai]RadioButtonMenuItem.acceleratorSelectionForeground = @Monocai.acceleratorSelectionForeground
|
||||
|
||||
[Monokai_Pro]TitledBorder.titleColor = @foreground
|
||||
|
||||
[Nord]MenuItem.checkBackground = @ijMenuCheckBackgroundL10
|
||||
[Nord]MenuItem.underlineSelectionCheckBackground = @ijMenuCheckBackgroundL10
|
||||
|
||||
@@ -186,8 +210,12 @@ ToggleButton.endBackground = $ToggleButton.background
|
||||
[One_Dark]MenuItem.underlineSelectionCheckBackground = @ijMenuCheckBackgroundL10
|
||||
[One_Dark]Slider.focusedColor = fade(#568af2,40%)
|
||||
|
||||
[Solarized_Dark---4lex4]Component.accentColor = lazy(TabbedPane.underlineColor)
|
||||
[Solarized_Dark---4lex4]Slider.focusedColor = fade($Component.focusColor,80%,derived)
|
||||
|
||||
[Solarized_Light---4lex4]Component.accentColor = lazy(TabbedPane.underlineColor)
|
||||
|
||||
[vuesion-theme]Component.accentColor = lazy(Button.default.endBackground)
|
||||
[vuesion-theme]MenuItem.checkBackground = @ijMenuCheckBackgroundL10
|
||||
[vuesion-theme]MenuItem.underlineSelectionCheckBackground = @ijMenuCheckBackgroundL10
|
||||
[vuesion-theme]Slider.trackValueColor = #ececee
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,65 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
#---- FileChooser ----
|
||||
|
||||
#fields
|
||||
FileChooser.lookInLabel.textAndMnemonic = Buscar &en:
|
||||
FileChooser.saveInLabelText = Guardar en:
|
||||
FileChooser.fileNameLabel.textAndMnemonic = &Nombre de fichero:
|
||||
FileChooser.folderNameLabel.textAndMnemonic = &Nombre de carpeta:
|
||||
FileChooser.filesOfTypeLabel.textAndMnemonic = Ficheros de &Tipo:
|
||||
|
||||
# toolbar
|
||||
FileChooser.upFolderToolTipText = Subir un nivel
|
||||
FileChooser.upFolderAccessibleName = Subir
|
||||
FileChooser.homeFolderToolTipText = Inicio
|
||||
FileChooser.homeFolderAccessibleName = Inicio
|
||||
FileChooser.newFolderToolTipText = Crear nueva carpeta
|
||||
FileChooser.newFolderAccessibleName = Nueva carpeta
|
||||
FileChooser.listViewButtonToolTipText = Lista
|
||||
FileChooser.listViewButtonAccessibleName = Lista
|
||||
FileChooser.detailsViewButtonToolTipText = Detalles
|
||||
FileChooser.detailsViewButtonAccessibleName = Detalles
|
||||
|
||||
# details table header
|
||||
FileChooser.fileNameHeaderText = Nombre
|
||||
FileChooser.fileSizeHeaderText = Tama\u00F1o
|
||||
FileChooser.fileTypeHeaderText = Tipo
|
||||
FileChooser.fileDateHeaderText = Modificado
|
||||
FileChooser.fileAttrHeaderText = Atributos
|
||||
|
||||
# popup menu
|
||||
FileChooser.viewMenuLabelText = Ver
|
||||
FileChooser.refreshActionLabelText = Refrescar
|
||||
FileChooser.newFolderActionLabelText = Nueva carpeta
|
||||
FileChooser.listViewActionLabelText = Lista
|
||||
FileChooser.detailsViewActionLabelText = Detalles
|
||||
|
||||
|
||||
#---- SplitPaneDivider ----
|
||||
|
||||
SplitPaneDivider.collapseLeftToolTipText = Contraer Panel Izquierdo
|
||||
SplitPaneDivider.collapseRightToolTipText = Contraer panel Derecho
|
||||
SplitPaneDivider.collapseTopToolTipText = Contraer panel Superior
|
||||
SplitPaneDivider.collapseBottomToolTipText = Contraer Panel Inferior
|
||||
SplitPaneDivider.expandLeftToolTipText = Expandir Panel Izquierdo
|
||||
SplitPaneDivider.expandRightToolTipText = Expandir Panel Derecho
|
||||
SplitPaneDivider.expandTopToolTipText = Expandir Panel Superior
|
||||
SplitPaneDivider.expandBottomToolTipText = Expandir Panel Inferior
|
||||
|
||||
|
||||
#---- TabbedPane ----
|
||||
|
||||
TabbedPane.moreTabsButtonToolTipText = Mostrar Pesta\u00F1as Ocultas
|
||||
@@ -96,19 +96,26 @@ public class TestFlatStyleableInfo
|
||||
"minimumWidth", int.class,
|
||||
|
||||
"focusedBackground", Color.class,
|
||||
"focusedForeground", Color.class,
|
||||
"hoverBackground", Color.class,
|
||||
"hoverForeground", Color.class,
|
||||
"pressedBackground", Color.class,
|
||||
"pressedForeground", Color.class,
|
||||
"selectedBackground", Color.class,
|
||||
"selectedForeground", Color.class,
|
||||
"disabledBackground", Color.class,
|
||||
"disabledText", Color.class,
|
||||
"disabledSelectedBackground", Color.class,
|
||||
"disabledSelectedForeground", Color.class,
|
||||
|
||||
"default.background", Color.class,
|
||||
"default.foreground", Color.class,
|
||||
"default.focusedBackground", Color.class,
|
||||
"default.focusedForeground", Color.class,
|
||||
"default.hoverBackground", Color.class,
|
||||
"default.hoverForeground", Color.class,
|
||||
"default.pressedBackground", Color.class,
|
||||
"default.pressedForeground", Color.class,
|
||||
"default.boldText", boolean.class,
|
||||
|
||||
"paintShadow", boolean.class,
|
||||
@@ -118,8 +125,13 @@ public class TestFlatStyleableInfo
|
||||
|
||||
"toolbar.spacingInsets", Insets.class,
|
||||
"toolbar.hoverBackground", Color.class,
|
||||
"toolbar.hoverForeground", Color.class,
|
||||
"toolbar.pressedBackground", Color.class,
|
||||
"toolbar.pressedForeground", Color.class,
|
||||
"toolbar.selectedBackground", Color.class,
|
||||
"toolbar.selectedForeground", Color.class,
|
||||
"toolbar.disabledSelectedBackground", Color.class,
|
||||
"toolbar.disabledSelectedForeground", Color.class,
|
||||
|
||||
"buttonType", String.class,
|
||||
"squareSize", boolean.class,
|
||||
@@ -693,6 +705,7 @@ public class TestFlatStyleableInfo
|
||||
"selectedBackground", Color.class,
|
||||
"selectedForeground", Color.class,
|
||||
"underlineColor", Color.class,
|
||||
"inactiveUnderlineColor", Color.class,
|
||||
"disabledUnderlineColor", Color.class,
|
||||
"hoverColor", Color.class,
|
||||
"focusColor", Color.class,
|
||||
@@ -862,8 +875,11 @@ public class TestFlatStyleableInfo
|
||||
"tab.underlineColor", Color.class,
|
||||
"tab.disabledUnderlineColor", Color.class,
|
||||
"tab.selectedBackground", Color.class,
|
||||
"tab.selectedForeground", Color.class,
|
||||
"tab.hoverBackground", Color.class,
|
||||
"tab.focusBackground", Color.class
|
||||
"tab.hoverForeground", Color.class,
|
||||
"tab.focusBackground", Color.class,
|
||||
"tab.focusForeground", Color.class
|
||||
);
|
||||
|
||||
// FlatToggleButtonUI extends FlatButtonUI
|
||||
|
||||
@@ -221,19 +221,26 @@ public class TestFlatStyling
|
||||
ui.applyStyle( b, "minimumWidth: 100" );
|
||||
|
||||
ui.applyStyle( b, "focusedBackground: #fff" );
|
||||
ui.applyStyle( b, "focusedForeground: #fff" );
|
||||
ui.applyStyle( b, "hoverBackground: #fff" );
|
||||
ui.applyStyle( b, "hoverForeground: #fff" );
|
||||
ui.applyStyle( b, "pressedBackground: #fff" );
|
||||
ui.applyStyle( b, "pressedForeground: #fff" );
|
||||
ui.applyStyle( b, "selectedBackground: #fff" );
|
||||
ui.applyStyle( b, "selectedForeground: #fff" );
|
||||
ui.applyStyle( b, "disabledBackground: #fff" );
|
||||
ui.applyStyle( b, "disabledText: #fff" );
|
||||
ui.applyStyle( b, "disabledSelectedBackground: #fff" );
|
||||
ui.applyStyle( b, "disabledSelectedForeground: #fff" );
|
||||
|
||||
ui.applyStyle( b, "default.background: #fff" );
|
||||
ui.applyStyle( b, "default.foreground: #fff" );
|
||||
ui.applyStyle( b, "default.focusedBackground: #fff" );
|
||||
ui.applyStyle( b, "default.focusedForeground: #fff" );
|
||||
ui.applyStyle( b, "default.hoverBackground: #fff" );
|
||||
ui.applyStyle( b, "default.hoverForeground: #fff" );
|
||||
ui.applyStyle( b, "default.pressedBackground: #fff" );
|
||||
ui.applyStyle( b, "default.pressedForeground: #fff" );
|
||||
ui.applyStyle( b, "default.boldText: true" );
|
||||
|
||||
ui.applyStyle( b, "paintShadow: true" );
|
||||
@@ -243,8 +250,13 @@ public class TestFlatStyling
|
||||
|
||||
ui.applyStyle( b, "toolbar.spacingInsets: 1,2,3,4" );
|
||||
ui.applyStyle( b, "toolbar.hoverBackground: #fff" );
|
||||
ui.applyStyle( b, "toolbar.hoverForeground: #fff" );
|
||||
ui.applyStyle( b, "toolbar.pressedBackground: #fff" );
|
||||
ui.applyStyle( b, "toolbar.pressedForeground: #fff" );
|
||||
ui.applyStyle( b, "toolbar.selectedBackground: #fff" );
|
||||
ui.applyStyle( b, "toolbar.selectedForeground: #fff" );
|
||||
ui.applyStyle( b, "toolbar.disabledSelectedBackground: #fff" );
|
||||
ui.applyStyle( b, "toolbar.disabledSelectedForeground: #fff" );
|
||||
|
||||
ui.applyStyle( b, "buttonType: help" );
|
||||
ui.applyStyle( b, "squareSize: true" );
|
||||
@@ -862,6 +874,7 @@ public class TestFlatStyling
|
||||
ui.applyStyle( "selectedBackground: #fff" );
|
||||
ui.applyStyle( "selectedForeground: #fff" );
|
||||
ui.applyStyle( "underlineColor: #fff" );
|
||||
ui.applyStyle( "inactiveUnderlineColor: #fff" );
|
||||
ui.applyStyle( "disabledUnderlineColor: #fff" );
|
||||
ui.applyStyle( "hoverColor: #fff" );
|
||||
ui.applyStyle( "focusColor: #fff" );
|
||||
@@ -1072,8 +1085,11 @@ public class TestFlatStyling
|
||||
ui.applyStyle( b, "tab.underlineColor: #fff" );
|
||||
ui.applyStyle( b, "tab.disabledUnderlineColor: #fff" );
|
||||
ui.applyStyle( b, "tab.selectedBackground: #fff" );
|
||||
ui.applyStyle( b, "tab.selectedForeground: #fff" );
|
||||
ui.applyStyle( b, "tab.hoverBackground: #fff" );
|
||||
ui.applyStyle( b, "tab.hoverForeground: #fff" );
|
||||
ui.applyStyle( b, "tab.focusBackground: #fff" );
|
||||
ui.applyStyle( b, "tab.focusForeground: #fff" );
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -38,8 +38,8 @@ import com.formdev.flatlaf.FlatLightLaf;
|
||||
import com.formdev.flatlaf.demo.HintManager.Hint;
|
||||
import com.formdev.flatlaf.demo.extras.*;
|
||||
import com.formdev.flatlaf.demo.intellijthemes.*;
|
||||
import com.formdev.flatlaf.extras.FlatDesktop;
|
||||
import com.formdev.flatlaf.extras.FlatAnimatedLafChange;
|
||||
import com.formdev.flatlaf.extras.FlatDesktop;
|
||||
import com.formdev.flatlaf.extras.FlatSVGIcon;
|
||||
import com.formdev.flatlaf.extras.FlatUIDefaultsInspector;
|
||||
import com.formdev.flatlaf.extras.components.FlatButton;
|
||||
@@ -82,13 +82,33 @@ class DemoFrame
|
||||
if( tabIndex >= 0 && tabIndex < tabbedPane.getTabCount() && tabIndex != tabbedPane.getSelectedIndex() )
|
||||
tabbedPane.setSelectedIndex( tabIndex );
|
||||
|
||||
// hide some menu items on macOS
|
||||
// macOS (see https://www.formdev.com/flatlaf/macos/)
|
||||
if( SystemInfo.isMacOS ) {
|
||||
// hide menu items that are in macOS application menu
|
||||
exitMenuItem.setVisible( false );
|
||||
aboutMenuItem.setVisible( false );
|
||||
|
||||
// do not use HTML text on macOS
|
||||
// do not use HTML text in menu items because this is not supported in macOS screen menu
|
||||
htmlMenuItem.setText( "some text" );
|
||||
|
||||
if( SystemInfo.isMacFullWindowContentSupported ) {
|
||||
// expand window content into window title bar and make title bar transparent
|
||||
getRootPane().putClientProperty( "apple.awt.fullWindowContent", true );
|
||||
getRootPane().putClientProperty( "apple.awt.transparentTitleBar", true );
|
||||
|
||||
// hide window title
|
||||
if( SystemInfo.isJava_17_orLater )
|
||||
getRootPane().putClientProperty( "apple.awt.windowTitleVisible", false );
|
||||
else
|
||||
setTitle( null );
|
||||
|
||||
// add gap to left side of toolbar
|
||||
toolBar.add( Box.createHorizontalStrut( 70 ), 0 );
|
||||
}
|
||||
|
||||
// enable full screen mode for this window (for Java 8 - 10; not necessary for Java 11+)
|
||||
if( !SystemInfo.isJava_11_orLater )
|
||||
getRootPane().putClientProperty( "apple.awt.fullscreenable", true );
|
||||
}
|
||||
|
||||
// integrate into macOS screen menu
|
||||
@@ -322,8 +342,8 @@ class DemoFrame
|
||||
// add font families
|
||||
fontMenu.addSeparator();
|
||||
ArrayList<String> families = new ArrayList<>( Arrays.asList(
|
||||
"Arial", "Cantarell", "Comic Sans MS", "Courier New", "DejaVu Sans",
|
||||
"Dialog", "Liberation Sans", "Monospaced", "Noto Sans", "Roboto",
|
||||
"Arial", "Cantarell", "Comic Sans MS", "DejaVu Sans",
|
||||
"Dialog", "Liberation Sans", "Noto Sans", "Roboto",
|
||||
"SansSerif", "Segoe UI", "Serif", "Tahoma", "Ubuntu", "Verdana" ) );
|
||||
if( !families.contains( currentFamily ) )
|
||||
families.add( currentFamily );
|
||||
@@ -433,9 +453,9 @@ class DemoFrame
|
||||
lafClass == FlatIntelliJLaf.class ||
|
||||
lafClass == FlatDarculaLaf.class;
|
||||
|
||||
accentColorLabel.setEnabled( isAccentColorSupported );
|
||||
accentColorLabel.setVisible( isAccentColorSupported );
|
||||
for( int i = 0; i < accentColorButtons.length; i++ )
|
||||
accentColorButtons[i].setEnabled( isAccentColorSupported );
|
||||
accentColorButtons[i].setVisible( isAccentColorSupported );
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
|
||||
@@ -36,7 +36,7 @@ public class FlatLafDemo
|
||||
static boolean screenshotsMode = Boolean.parseBoolean( System.getProperty( "flatlaf.demo.screenshotsMode" ) );
|
||||
|
||||
public static void main( String[] args ) {
|
||||
// macOS
|
||||
// macOS (see https://www.formdev.com/flatlaf/macos/)
|
||||
if( SystemInfo.isMacOS ) {
|
||||
// enable screen menu bar
|
||||
// (moves menu bar from JFrame window to top of screen)
|
||||
@@ -51,6 +51,7 @@ public class FlatLafDemo
|
||||
// - "system": use current macOS appearance (light or dark)
|
||||
// - "NSAppearanceNameAqua": use light appearance
|
||||
// - "NSAppearanceNameDarkAqua": use dark appearance
|
||||
// (needs to be set on main thread; setting it on AWT thread does not work)
|
||||
System.setProperty( "apple.awt.application.appearance", "system" );
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class IJThemesClassGenerator
|
||||
markdownTable.append( "-----|------\n" );
|
||||
|
||||
for( IJThemeInfo ti : themesManager.bundledThemes ) {
|
||||
if( ti.sourceCodeUrl == null || ti.sourceCodePath == null )
|
||||
if( ti.sourceCodeUrl == null )
|
||||
continue;
|
||||
|
||||
generateClass( ti, toPath, allInfos, markdownTable );
|
||||
@@ -77,7 +77,7 @@ public class IJThemesClassGenerator
|
||||
themeName += " (Material)";
|
||||
|
||||
StringBuilder buf = new StringBuilder();
|
||||
for( String n : name.split( " " ) ) {
|
||||
for( String n : name.split( "[ \\-]" ) ) {
|
||||
if( n.length() == 0 || n.equals( "-" ) )
|
||||
continue;
|
||||
|
||||
|
||||
@@ -178,6 +178,13 @@
|
||||
"sourceCodeUrl": "https://github.com/bmikaili/intellij-monocai-theme",
|
||||
"sourceCodePath": "blob/master/resources/Monocai.theme.json"
|
||||
},
|
||||
"Monokai_Pro.default.theme.json": {
|
||||
"name": "Monokai Pro",
|
||||
"dark": true,
|
||||
"license": "MIT",
|
||||
"licenseFile": "Monokai_Pro.LICENSE.txt",
|
||||
"sourceCodeUrl": "https://github.com/subtheme-dev/monokai-pro"
|
||||
},
|
||||
"nord.theme.json": {
|
||||
"name": "Nord",
|
||||
"dark": true,
|
||||
@@ -225,6 +232,14 @@
|
||||
"sourceCodeUrl": "https://github.com/vuesion/intellij-theme",
|
||||
"sourceCodePath": "blob/master/resources/META-INF/vuesion_theme.theme.json"
|
||||
},
|
||||
"Xcode-Dark.theme.json": {
|
||||
"name": "Xcode-Dark",
|
||||
"dark": true,
|
||||
"license": "MIT",
|
||||
"licenseFile": "Xcode-Dark.LICENSE.txt",
|
||||
"sourceCodeUrl": "https://github.com/antelle/intellij-xcode-dark-theme",
|
||||
"sourceCodePath": "blob/master/resources/Xcode-Dark.theme.json"
|
||||
},
|
||||
|
||||
"material-theme-ui-lite/Arc Dark.theme.json": {
|
||||
"name": "Material Theme UI Lite / Arc Dark",
|
||||
|
||||
@@ -65,6 +65,7 @@ import javax.swing.plaf.UIResource;
|
||||
import javax.swing.text.JTextComponent;
|
||||
import com.formdev.flatlaf.FlatClientProperties;
|
||||
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||
import com.formdev.flatlaf.ui.MigLayoutVisualPadding;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
|
||||
@@ -113,6 +114,7 @@ public class FlatInspector
|
||||
private int inspectParentLevel;
|
||||
private boolean wasModifierKeyPressed;
|
||||
private boolean showClassHierarchy;
|
||||
private long lastWhen;
|
||||
|
||||
private JComponent highlightFigure;
|
||||
private Popup popup;
|
||||
@@ -131,8 +133,22 @@ public class FlatInspector
|
||||
(((KeyEvent)e).getModifiersEx() & KEY_MODIFIERS_MASK) == (keyStroke.getModifiers() & KEY_MODIFIERS_MASK) )
|
||||
{
|
||||
Window activeWindow = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();
|
||||
if( activeWindow instanceof RootPaneContainer ) {
|
||||
JRootPane rootPane = ((RootPaneContainer)activeWindow).getRootPane();
|
||||
RootPaneContainer rootPaneContainer = null;
|
||||
if( activeWindow instanceof RootPaneContainer )
|
||||
rootPaneContainer = (RootPaneContainer) activeWindow;
|
||||
else {
|
||||
// search for root pain container in children
|
||||
// (e.g. for Swing embedded into SWT)
|
||||
for( Component child : activeWindow.getComponents() ) {
|
||||
if( child instanceof RootPaneContainer ) {
|
||||
rootPaneContainer = (RootPaneContainer) child;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( rootPaneContainer != null ) {
|
||||
JRootPane rootPane = rootPaneContainer.getRootPane();
|
||||
FlatInspector inspector = (FlatInspector) rootPane.getClientProperty( FlatInspector.class );
|
||||
if( inspector == null ) {
|
||||
inspector = new FlatInspector( rootPane );
|
||||
@@ -172,6 +188,11 @@ public class FlatInspector
|
||||
if( keyCode == KeyEvent.VK_CONTROL || keyCode == KeyEvent.VK_SHIFT || keyCode == KeyEvent.VK_ALT )
|
||||
wasModifierKeyPressed = true;
|
||||
} else if( id == KeyEvent.KEY_RELEASED && wasModifierKeyPressed ) {
|
||||
// ignore duplicate events (for Swing embedded into SWT)
|
||||
if( (keyEvent.getWhen() - lastWhen) <= 5 )
|
||||
return;
|
||||
lastWhen = keyEvent.getWhen();
|
||||
|
||||
if( keyCode == KeyEvent.VK_CONTROL ) {
|
||||
inspectParentLevel++;
|
||||
int parentLevel = inspect( lastX, lastY );
|
||||
@@ -464,6 +485,15 @@ public class FlatInspector
|
||||
if( margin != null )
|
||||
appendRow( buf, "Margin", toString( margin ) );
|
||||
|
||||
if( c instanceof JComponent ) {
|
||||
Object value = ((JComponent)c).getClientProperty( MigLayoutVisualPadding.VISUAL_PADDING_PROPERTY );
|
||||
Insets visualPadding = (value instanceof int[])
|
||||
? new Insets( ((int[])value)[0], ((int[])value)[1], ((int[])value)[2], ((int[])value)[3] )
|
||||
: (value instanceof Insets ? (Insets) value : null);
|
||||
if( visualPadding != null )
|
||||
appendRow( buf, "Mig visual padding", toString( visualPadding ) );
|
||||
}
|
||||
|
||||
Dimension prefSize = c.getPreferredSize();
|
||||
Dimension minSize = c.getMinimumSize();
|
||||
Dimension maxSize = c.getMaximumSize();
|
||||
|
||||
@@ -18,7 +18,7 @@ package com.formdev.flatlaf.extras.components;
|
||||
|
||||
import static com.formdev.flatlaf.FlatClientProperties.*;
|
||||
import java.awt.Color;
|
||||
import javax.swing.JToggleButton;
|
||||
import javax.swing.*;
|
||||
import com.formdev.flatlaf.extras.components.FlatButton.ButtonType;
|
||||
|
||||
/**
|
||||
@@ -116,16 +116,37 @@ public class FlatToggleButton
|
||||
putClientProperty( OUTLINE, outline );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns placement of underline if toggle button type is {@link ButtonType#tab}.
|
||||
* If underline placement is not specified, returns {@link #BOTTOM} as the default
|
||||
* value.
|
||||
*
|
||||
* @since 2.3
|
||||
*/
|
||||
public int getTabUnderlinePlacement() {
|
||||
return getClientPropertyInt( TAB_BUTTON_UNDERLINE_PLACEMENT, BOTTOM );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns height of underline if toggle button type is {@link ButtonType#tab}.
|
||||
* Specifies placement of underline if toggle button type is {@link ButtonType#tab}.
|
||||
*
|
||||
* @param placement One of the following constants defined in SwingConstants:
|
||||
* {@link #TOP}, {@link #LEFT}, {@link #BOTTOM}, or {@link #RIGHT}.
|
||||
* @since 2.3
|
||||
*/
|
||||
public void setTabUnderlinePlacement( int placement ) {
|
||||
putClientProperty( TAB_BUTTON_UNDERLINE_PLACEMENT, (placement >= 0) ? placement : null );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns thickness of underline if toggle button type is {@link ButtonType#tab}.
|
||||
*/
|
||||
public int getTabUnderlineHeight() {
|
||||
return getClientPropertyInt( TAB_BUTTON_UNDERLINE_HEIGHT, "ToggleButton.tab.underlineHeight" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies height of underline if toggle button type is {@link ButtonType#tab}.
|
||||
* Specifies thickness of underline if toggle button type is {@link ButtonType#tab}.
|
||||
*/
|
||||
public void setTabUnderlineHeight( int tabUnderlineHeight ) {
|
||||
putClientProperty( TAB_BUTTON_UNDERLINE_HEIGHT, (tabUnderlineHeight >= 0) ? tabUnderlineHeight : null );
|
||||
|
||||
@@ -65,12 +65,14 @@ Name | Class
|
||||
[Light Flat](https://github.com/nerzhulart/LightFlatTheme) | `com.formdev.flatlaf.intellijthemes.FlatLightFlatIJTheme`
|
||||
[Material Design Dark](https://github.com/xinkunZ/NotReallyMDTheme) | `com.formdev.flatlaf.intellijthemes.FlatMaterialDesignDarkIJTheme`
|
||||
[Monocai](https://github.com/bmikaili/intellij-monocai-theme) | `com.formdev.flatlaf.intellijthemes.FlatMonocaiIJTheme`
|
||||
[Monokai Pro](https://github.com/subtheme-dev/monokai-pro) | `com.formdev.flatlaf.intellijthemes.FlatMonokaiProIJTheme`
|
||||
[Nord](https://github.com/arcticicestudio/nord-jetbrains) | `com.formdev.flatlaf.intellijthemes.FlatNordIJTheme`
|
||||
[One Dark](https://github.com/one-dark/jetbrains-one-dark-theme) | `com.formdev.flatlaf.intellijthemes.FlatOneDarkIJTheme`
|
||||
[Solarized Dark](https://github.com/4lex4/intellij-platform-solarized) | `com.formdev.flatlaf.intellijthemes.FlatSolarizedDarkIJTheme`
|
||||
[Solarized Light](https://github.com/4lex4/intellij-platform-solarized) | `com.formdev.flatlaf.intellijthemes.FlatSolarizedLightIJTheme`
|
||||
[Spacegray](https://github.com/mturlo/intellij-spacegray) | `com.formdev.flatlaf.intellijthemes.FlatSpacegrayIJTheme`
|
||||
[Vuesion](https://github.com/vuesion/intellij-theme) | `com.formdev.flatlaf.intellijthemes.FlatVuesionIJTheme`
|
||||
[Xcode-Dark](https://github.com/antelle/intellij-xcode-dark-theme) | `com.formdev.flatlaf.intellijthemes.FlatXcodeDarkIJTheme`
|
||||
|
||||
Material Theme UI Lite:
|
||||
|
||||
|
||||
@@ -52,12 +52,14 @@ public class FlatAllIJThemes
|
||||
new FlatIJLookAndFeelInfo( "Light Flat", "com.formdev.flatlaf.intellijthemes.FlatLightFlatIJTheme", false ),
|
||||
new FlatIJLookAndFeelInfo( "Material Design Dark", "com.formdev.flatlaf.intellijthemes.FlatMaterialDesignDarkIJTheme", true ),
|
||||
new FlatIJLookAndFeelInfo( "Monocai", "com.formdev.flatlaf.intellijthemes.FlatMonocaiIJTheme", true ),
|
||||
new FlatIJLookAndFeelInfo( "Monokai Pro", "com.formdev.flatlaf.intellijthemes.FlatMonokaiProIJTheme", true ),
|
||||
new FlatIJLookAndFeelInfo( "Nord", "com.formdev.flatlaf.intellijthemes.FlatNordIJTheme", true ),
|
||||
new FlatIJLookAndFeelInfo( "One Dark", "com.formdev.flatlaf.intellijthemes.FlatOneDarkIJTheme", true ),
|
||||
new FlatIJLookAndFeelInfo( "Solarized Dark", "com.formdev.flatlaf.intellijthemes.FlatSolarizedDarkIJTheme", true ),
|
||||
new FlatIJLookAndFeelInfo( "Solarized Light", "com.formdev.flatlaf.intellijthemes.FlatSolarizedLightIJTheme", false ),
|
||||
new FlatIJLookAndFeelInfo( "Spacegray", "com.formdev.flatlaf.intellijthemes.FlatSpacegrayIJTheme", true ),
|
||||
new FlatIJLookAndFeelInfo( "Vuesion", "com.formdev.flatlaf.intellijthemes.FlatVuesionIJTheme", true ),
|
||||
new FlatIJLookAndFeelInfo( "Xcode-Dark", "com.formdev.flatlaf.intellijthemes.FlatXcodeDarkIJTheme", true ),
|
||||
new FlatIJLookAndFeelInfo( "Arc Dark (Material)", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatArcDarkIJTheme", true ),
|
||||
new FlatIJLookAndFeelInfo( "Arc Dark Contrast (Material)", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatArcDarkContrastIJTheme", true ),
|
||||
new FlatIJLookAndFeelInfo( "Atom One Dark (Material)", "com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatAtomOneDarkIJTheme", true ),
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright 2020 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.intellijthemes;
|
||||
|
||||
//
|
||||
// DO NOT MODIFY
|
||||
// Generated with com.formdev.flatlaf.demo.intellijthemes.IJThemesClassGenerator
|
||||
//
|
||||
|
||||
import com.formdev.flatlaf.IntelliJTheme;
|
||||
|
||||
/**
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
public class FlatMonokaiProIJTheme
|
||||
extends IntelliJTheme.ThemeLaf
|
||||
{
|
||||
public static final String NAME = "Monokai Pro";
|
||||
|
||||
public static boolean setup() {
|
||||
try {
|
||||
return setup( new FlatMonokaiProIJTheme() );
|
||||
} catch( RuntimeException ex ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void installLafInfo() {
|
||||
installLafInfo( NAME, FlatMonokaiProIJTheme.class );
|
||||
}
|
||||
|
||||
public FlatMonokaiProIJTheme() {
|
||||
super( Utils.loadTheme( "Monokai_Pro.default.theme.json" ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return NAME;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright 2020 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.intellijthemes;
|
||||
|
||||
//
|
||||
// DO NOT MODIFY
|
||||
// Generated with com.formdev.flatlaf.demo.intellijthemes.IJThemesClassGenerator
|
||||
//
|
||||
|
||||
import com.formdev.flatlaf.IntelliJTheme;
|
||||
|
||||
/**
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
public class FlatXcodeDarkIJTheme
|
||||
extends IntelliJTheme.ThemeLaf
|
||||
{
|
||||
public static final String NAME = "Xcode-Dark";
|
||||
|
||||
public static boolean setup() {
|
||||
try {
|
||||
return setup( new FlatXcodeDarkIJTheme() );
|
||||
} catch( RuntimeException ex ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void installLafInfo() {
|
||||
installLafInfo( NAME, FlatXcodeDarkIJTheme.class );
|
||||
}
|
||||
|
||||
public FlatXcodeDarkIJTheme() {
|
||||
super( Utils.loadTheme( "Xcode-Dark.theme.json" ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return NAME;
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,11 @@
|
||||
"secondaryForeground": "#7ac2cc"
|
||||
},
|
||||
|
||||
"List.background": "#eef0f4",
|
||||
"List": {
|
||||
"background": "#eef0f4",
|
||||
"hoverBackground": "#dae6eb",
|
||||
"hoverInactiveBackground": "#dae6eb"
|
||||
},
|
||||
|
||||
"Notification": {
|
||||
"MoreButton.innerBorderColor": "#bec5cd",
|
||||
@@ -143,6 +147,12 @@
|
||||
}
|
||||
},
|
||||
|
||||
"NotificationsToolwindow": {
|
||||
"newNotification.background": "#dae6ebB3",
|
||||
"newNotification.hoverBackground": "#dae6eb",
|
||||
"Notification.hoverBackground": "#dae6eb"
|
||||
},
|
||||
|
||||
"PasswordField.background": "#FFFFFF",
|
||||
|
||||
"Plugins": {
|
||||
@@ -151,7 +161,8 @@
|
||||
"SectionHeader.foreground": "#808080",
|
||||
"SectionHeader.background": "#edeef2",
|
||||
"Tab.selectedBackground": "#cacccf",
|
||||
"Tab.hoverBackground": "#cacccf"
|
||||
"Tab.hoverBackground": "#cacccf",
|
||||
"hoverBackground": "#e6eef2"
|
||||
},
|
||||
|
||||
"Popup": {
|
||||
@@ -249,7 +260,12 @@
|
||||
}
|
||||
},
|
||||
|
||||
"Tree.background": "#eef0f4",
|
||||
"Tree": {
|
||||
"background": "#eef0f4",
|
||||
"hoverBackground": "#dae6eb",
|
||||
"hoverInactiveBackground": "#dae6eb",
|
||||
"hash": "#d0d5db"
|
||||
},
|
||||
|
||||
"WelcomeScreen": {
|
||||
"Details.background": "#eef0f4",
|
||||
|
||||
@@ -120,7 +120,8 @@
|
||||
"DefaultTabs": {
|
||||
"underlineColor": "#9649cc",
|
||||
"inactiveUnderlineColor": "#877399",
|
||||
"hoverBackground": "#dfb3ff1a"
|
||||
"hoverBackground": "#dfb3ff1a",
|
||||
"borderColor": "#1a1721"
|
||||
},
|
||||
|
||||
"DragAndDrop": {
|
||||
@@ -168,6 +169,11 @@
|
||||
"visitedForeground": "#7094FF"
|
||||
},
|
||||
|
||||
"List": {
|
||||
"hoverBackground": "#00000033",
|
||||
"hoverInactiveBackground": "#00000033"
|
||||
},
|
||||
|
||||
"MenuBar.borderColor": "#1a1721",
|
||||
|
||||
"NavBar.borderColor": "#1a1721",
|
||||
@@ -197,6 +203,12 @@
|
||||
}
|
||||
},
|
||||
|
||||
"NotificationsToolwindow": {
|
||||
"newNotification.background": "#3D3952B3",
|
||||
"newNotification.hoverBackground": "#3D3952",
|
||||
"Notification.hoverBackground": "#3D3952"
|
||||
},
|
||||
|
||||
"MemoryIndicator": {
|
||||
"allocatedBackground": "#352140",
|
||||
"usedBackground": "#533473"
|
||||
@@ -211,6 +223,8 @@
|
||||
},
|
||||
|
||||
"Plugins": {
|
||||
"hoverBackground": "#00000022",
|
||||
|
||||
"Tab": {
|
||||
"selectedForeground": "#D0D0D9",
|
||||
"selectedBackground": "#593f73",
|
||||
@@ -284,6 +298,13 @@
|
||||
|
||||
"SearchOption.selectedBackground": "#424885",
|
||||
|
||||
"SegmentedButton": {
|
||||
"selectedButtonColor": "#45405C",
|
||||
"focusedSelectedButtonColor": "#693687",
|
||||
"selectedStartBorderColor": "#4E4C63",
|
||||
"selectedEndBorderColor": "#4E4C63"
|
||||
},
|
||||
|
||||
"SpeedSearch": {
|
||||
"foreground": "#D0D0D9",
|
||||
"borderColor": "#69418c",
|
||||
@@ -310,7 +331,8 @@
|
||||
|
||||
"Table": {
|
||||
"stripeColor": "#323242",
|
||||
"hoverBackground": "#00000028"
|
||||
"hoverBackground": "#00000028",
|
||||
"gridColor": "#1a1721"
|
||||
},
|
||||
|
||||
"TextArea": {
|
||||
@@ -360,7 +382,12 @@
|
||||
}
|
||||
},
|
||||
|
||||
"Tree.rowHeight": 20,
|
||||
"Tree": {
|
||||
"rowHeight": 20,
|
||||
"hash": "#4E4C63",
|
||||
"hoverBackground": "#00000033",
|
||||
"hoverInactiveBackground": "#00000033"
|
||||
},
|
||||
|
||||
"ValidationTooltip": {
|
||||
"errorBackground": "#802d43",
|
||||
|
||||
@@ -38,6 +38,26 @@
|
||||
"pressedBackground": "hoverBackground",
|
||||
"pressedBorderColor": "hoverBackground"
|
||||
},
|
||||
"Bookmark": {
|
||||
"iconBackground": "accentColor",
|
||||
"Mnemonic": {
|
||||
"iconForeground": "primaryForeground",
|
||||
"iconBackground": "#8d6b81",
|
||||
"iconBorderColor": "accentColor"
|
||||
}
|
||||
},
|
||||
"BookmarkMnemonicAssigned": {
|
||||
"foreground": "primaryForeground",
|
||||
"background": "#786299",
|
||||
"borderColor": "secondaryAccentColor"
|
||||
},
|
||||
"BookmarkMnemonicAvailable": {
|
||||
},
|
||||
"BookmarkMnemonicCurrent": {
|
||||
"foreground": "primaryForeground",
|
||||
"background": "#8d6b81",
|
||||
"borderColor": "accentColor"
|
||||
},
|
||||
"Button": {
|
||||
"foreground": "primaryForeground",
|
||||
"startBorderColor": "selectionBackground",
|
||||
@@ -90,7 +110,7 @@
|
||||
"inactiveWarningFocusColor": "#f1fa8c"
|
||||
},
|
||||
"DragAndDrop": {
|
||||
"areaBorderColor": "selectionBackground"
|
||||
"borderColor": "selectionBackground"
|
||||
},
|
||||
"Editor": {
|
||||
"background": "secondaryBackground",
|
||||
|
||||
@@ -111,6 +111,11 @@
|
||||
"secondaryForeground": "#77a8d9"
|
||||
},
|
||||
|
||||
"List": {
|
||||
"hoverBackground": "#00000010",
|
||||
"hoverInactiveBackground": "#00000010"
|
||||
},
|
||||
|
||||
"Notification": {
|
||||
"background": "#f7f8fa",
|
||||
"borderColor": "#D4D6D9",
|
||||
@@ -131,6 +136,12 @@
|
||||
}
|
||||
},
|
||||
|
||||
"NotificationsToolwindow": {
|
||||
"newNotification.background": "#dae9f7B3",
|
||||
"newNotification.hoverBackground": "#00000009",
|
||||
"Notification.hoverBackground": "#00000009"
|
||||
},
|
||||
|
||||
"PasswordField.background": "#FFFFFF",
|
||||
|
||||
"Plugins": {
|
||||
@@ -140,7 +151,7 @@
|
||||
"Tab.selectedBackground": "#D5D6D7",
|
||||
"Tab.hoverBackground": "#D5D6D7",
|
||||
"lightSelectionBackground": "#E9EFF7",
|
||||
"hoverBackground": "#f7faff"
|
||||
"hoverBackground": "#F8F8F8"
|
||||
},
|
||||
|
||||
"Popup": {
|
||||
@@ -225,7 +236,11 @@
|
||||
}
|
||||
},
|
||||
|
||||
"Tree.rowHeight": 22,
|
||||
"Tree": {
|
||||
"rowHeight": 22,
|
||||
"hoverBackground": "#00000010",
|
||||
"hoverInactiveBackground": "#00000010"
|
||||
},
|
||||
|
||||
"VersionControl": {
|
||||
"Log.Commit.currentBranchBackground": "#e6f0f2",
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,684 @@
|
||||
{
|
||||
"name": "Monokai Pro",
|
||||
"dark": true,
|
||||
"author": "Subtheme",
|
||||
"editorScheme": "/schemes/default.xml",
|
||||
"ui": {
|
||||
"*": {
|
||||
"acceleratorSelectionForeground": "#ffd866",
|
||||
"background": "#2d2a2e",
|
||||
"borderColor": "#363337",
|
||||
"disabledBackground": "#221f22",
|
||||
"disabledForeground": "#5b595c",
|
||||
"disabledText": "#5b595c",
|
||||
"focusColor": "#5b595c",
|
||||
"focusedBorderColor": "#ffd866",
|
||||
"foreground": "#fcfcfa",
|
||||
"inactiveBackground": "#221f22",
|
||||
"inactiveForeground": "#939293",
|
||||
"infoForeground": "#939293",
|
||||
"selectionBackground": "#403e41",
|
||||
"selectionBackgroundInactive": "#403e41",
|
||||
"selectionForeground": "#ffd866",
|
||||
"selectionInactiveBackground": "#403e41",
|
||||
"selectionInactiveForeground": "#ffd866",
|
||||
"separatorColor": "#2d2a2e"
|
||||
},
|
||||
"ActionButton": {
|
||||
"hoverBackground": "#363337",
|
||||
"hoverBorderColor": "#363337",
|
||||
"pressedBackground": "#363337",
|
||||
"pressedBorderColor": "#363337"
|
||||
},
|
||||
"Borders": {
|
||||
"ContrastBorderColor": "#363337",
|
||||
"color": "#363337"
|
||||
},
|
||||
"Button": {
|
||||
"arc": 0,
|
||||
"background": "#403e41",
|
||||
"default": {
|
||||
"endBackground": "#403e41",
|
||||
"endBorderColor": "#403e41",
|
||||
"foreground": "#ffd866",
|
||||
"focusColor": "#ffd866",
|
||||
"focusedBorderColor": "#403e41",
|
||||
"shadowColor": "#403e41",
|
||||
"startBackground": "#403e41",
|
||||
"startBorderColor": "#403e41"
|
||||
},
|
||||
"disabledBorderColor": "#403e41",
|
||||
"disabledText": "#5b595c",
|
||||
"endBackground": "#403e41",
|
||||
"endBorderColor": "#403e41",
|
||||
"focusedBorderColor": "#403e41",
|
||||
"foreground": "#fcfcfa",
|
||||
"shadowColor": "#403e41",
|
||||
"shadowWidth": 0,
|
||||
"startBackground": "#403e41",
|
||||
"startBorderColor": "#403e41"
|
||||
},
|
||||
"CheckBox": {
|
||||
"background": "#2d2a2e",
|
||||
"disabledText": "#5b595c",
|
||||
"foreground": "#fcfcfa",
|
||||
"select": "#ffd866"
|
||||
},
|
||||
"CheckBoxMenuItem": {
|
||||
"acceleratorForeground": "#939293",
|
||||
"acceleratorSelectionForeground": "#939293",
|
||||
"background": "#2d2a2e",
|
||||
"disabledBackground": "#2d2a2e",
|
||||
"disabledForeground": "#5b595c",
|
||||
"foreground": "#fcfcfa",
|
||||
"selectionBackground": "#403e41",
|
||||
"selectionForeground": "#ffd866"
|
||||
},
|
||||
"ColorChooser": {
|
||||
"background": "#2d2a2e",
|
||||
"foreground": "#fcfcfa",
|
||||
"swatchesDefaultRecentColor": "#fcfcfa"
|
||||
},
|
||||
"ComboBoxButton": {
|
||||
"background": "#363337"
|
||||
},
|
||||
"ComboBox": {
|
||||
"ArrowButton": {
|
||||
"background": "#403e41",
|
||||
"disabledIconColor": "#5b595c",
|
||||
"iconColor": "#fcfcfa",
|
||||
"nonEditableBackground": "#2d2a2e"
|
||||
},
|
||||
"background": "#363337",
|
||||
"disabledBackground": "#221f22",
|
||||
"disabledForeground": "#5b595c",
|
||||
"foreground": "#fcfcfa",
|
||||
"modifiedItemForeground": "#ffd866",
|
||||
"nonEditableBackground": "#363337",
|
||||
"selectionBackground": "#2d2a2e",
|
||||
"selectionForeground": "#ffd866"
|
||||
},
|
||||
"ComboPopup": {
|
||||
"border": "#2d2a2e"
|
||||
},
|
||||
"CompletionPopup": {
|
||||
"foreground": "#fcfcfa",
|
||||
"matchForeground": "#ffd866",
|
||||
"selectionInactiveBackground": "#2d2a2e",
|
||||
"selectionBackground": "#2d2a2e"
|
||||
},
|
||||
"Component": {
|
||||
"arc": 4,
|
||||
"borderColor": "#363337",
|
||||
"disabledBorderColor": "#363337",
|
||||
"focusColor": "#ffd866",
|
||||
"focusedBorderColor": "#ffd866",
|
||||
"hoverIconColor": "#ffd866",
|
||||
"infoForeground": "#939293",
|
||||
"iconColor": "#fcfcfa"
|
||||
},
|
||||
"Counter": {
|
||||
"background": "#ffd866",
|
||||
"foreground": "#19181a"
|
||||
},
|
||||
"Debugger": {
|
||||
"Variables": {
|
||||
"collectingDataForeground": "#939293",
|
||||
"changedValueForeground": "#ffd866",
|
||||
"errorMessageForeground": "#ff6188",
|
||||
"evaluatingExpressionForeground": "#939293",
|
||||
"exceptionForeground": "#78dce8",
|
||||
"modifyingValueForeground": "#ffd866",
|
||||
"valueForeground": "#ffd866"
|
||||
}
|
||||
},
|
||||
"DebuggerTabs": {
|
||||
"underlinedTabBackground": "#5b595c"
|
||||
},
|
||||
"DebuggerPopup": {
|
||||
"borderColor": "#5b595c"
|
||||
},
|
||||
"DefaultTabs": {
|
||||
"background": "#2d2a2e",
|
||||
"borderColor": "#2d2a2e",
|
||||
"hoverBackground": "#363337",
|
||||
"inactiveUnderlineColor": "#ffd866",
|
||||
"underlineColor": "#ffd866",
|
||||
"underlinedTabBackground": "#2d2a2e",
|
||||
"underlineHeight": 2
|
||||
},
|
||||
"DragAndDrop": {
|
||||
"areaBackground": "#2d2a2e",
|
||||
"areaBorderColor": "#2d2a2e",
|
||||
"areaForeground": "#fcfcfa"
|
||||
},
|
||||
"Editor": {
|
||||
"background": "#221f22",
|
||||
"foreground": "#fcfcfa",
|
||||
"shortcutForeground": "#939293"
|
||||
},
|
||||
"EditorPane": {
|
||||
"background": "#221f22",
|
||||
"caretForeground": "#ffd866",
|
||||
"foreground": "#fcfcfa",
|
||||
"inactiveBackground": "#2d2a2e",
|
||||
"inactiveForeground": "#5b595c",
|
||||
"selectionBackground": "#403e41",
|
||||
"selectionForeground": "#ffd866"
|
||||
},
|
||||
"EditorTabs": {
|
||||
"borderColor": "#363337",
|
||||
"inactiveUnderlineColor": "#ffd866",
|
||||
"underlineColor": "#ffd866",
|
||||
"underlinedTabBackground": "#363337",
|
||||
"underlinedTabForeground": "#c1c0c0"
|
||||
},
|
||||
"FileColor": {
|
||||
"Yellow": "00000000"
|
||||
},
|
||||
"FormattedTextField": {
|
||||
"background": "#363337",
|
||||
"caretForeground": "#ffd866",
|
||||
"foreground": "#fcfcfa",
|
||||
"inactiveBackground": "#403e41",
|
||||
"inactiveForeground": "#5b595c",
|
||||
"selectionForeground": "#ffd866",
|
||||
"selectionBackground": "#403e41"
|
||||
},
|
||||
"Group": {
|
||||
"disabledSeparatorColor": "#2d2a2e",
|
||||
"separatorColor": "#2d2a2e"
|
||||
},
|
||||
"GutterTooltip": {
|
||||
"infoForeground": "#fcfcfa",
|
||||
"lineSeparatorColor": "#2d2a2e"
|
||||
},
|
||||
"HelpTooltip": {
|
||||
"borderColor": "#2d2a2e",
|
||||
"infoForeground": "#939293"
|
||||
},
|
||||
"InformationHint": {
|
||||
"borderColor": "#2d2a2e"
|
||||
},
|
||||
"InplaceRefactoringPopup": {
|
||||
"borderColor": "#2d2a2e"
|
||||
},
|
||||
"Label": {
|
||||
"background": "#2d2a2e",
|
||||
"disabledForeground": "#5b595c",
|
||||
"disabledText": "#5b595c",
|
||||
"foreground": "#939293",
|
||||
"infoForeground": "#939293",
|
||||
"selectedForeground": "#ffd866"
|
||||
},
|
||||
"Link": {
|
||||
"activeForeground": "#ffd866",
|
||||
"hoverForeground": "#ffd866",
|
||||
"pressedForeground": "#ffd866",
|
||||
"secondaryForeground": "#939293",
|
||||
"visitedForeground": "#ffd866"
|
||||
},
|
||||
"List": {
|
||||
"background": "#221f22",
|
||||
"foreground": "#fcfcfa",
|
||||
"selectionBackground": "#363337",
|
||||
"selectionForeground": "#ffd866",
|
||||
"selectionInactiveBackground": "#363337",
|
||||
"selectionInactiveForeground": "#ffd866"
|
||||
},
|
||||
"MemoryIndicator": {
|
||||
"allocatedBackground": "#403e41",
|
||||
"usedBackground": "#5b595c"
|
||||
},
|
||||
"Menu": {
|
||||
"acceleratorForeground": "#939293",
|
||||
"acceleratorSelectionForeground": "#fcfcfa",
|
||||
"background": "#2d2a2e",
|
||||
"borderColor": "#363337",
|
||||
"disabledBackground": "#403e41",
|
||||
"disabledForeground": "#5b595c",
|
||||
"foreground": "#fcfcfa",
|
||||
"separatorColor": "#2d2a2e",
|
||||
"selectionForeground": "#ffd866"
|
||||
},
|
||||
"MenuBar": {
|
||||
"borderColor": "#363337",
|
||||
"disabledBackground": "#2d2a2e",
|
||||
"disabledForeground": "#5b595c",
|
||||
"foreground": "#fcfcfa",
|
||||
"highlight": "#2d2a2e",
|
||||
"selectionBackground": "#403e41",
|
||||
"selectionForeground": "#ffd866",
|
||||
"shadow": "#221f22"
|
||||
},
|
||||
"MenuItem": {
|
||||
"acceleratorForeground": "#939293",
|
||||
"background": "#2d2a2e",
|
||||
"disabledBackground": "#2d2a2e",
|
||||
"disabledForeground": "#5b595c",
|
||||
"foreground": "#fcfcfa",
|
||||
"selectionBackground": "#403e41",
|
||||
"selectionForeground": "#ffd866"
|
||||
},
|
||||
"NavBar": {
|
||||
"borderColor": "#363337"
|
||||
},
|
||||
"Notification": {
|
||||
"background": "#363337",
|
||||
"borderColor": "#221f22",
|
||||
"errorBackground": "#221f22",
|
||||
"errorBorderColor": "#221f22",
|
||||
"foreground": "#fcfcfa",
|
||||
"MoreButton": {
|
||||
"background": "#403e41",
|
||||
"foreground": "#fcfcfa",
|
||||
"innerBorderColor": "#363337"
|
||||
},
|
||||
"ToolWindow": {
|
||||
"errorBackground": "#363337",
|
||||
"errorBorderColor": "#363337",
|
||||
"informativeBackground": "#363337",
|
||||
"informativeBorderColor": "#363337",
|
||||
"warningBackground": "#363337",
|
||||
"warningBorderColor": "#363337"
|
||||
}
|
||||
},
|
||||
"OptionPane": {
|
||||
"background": "#2d2a2e",
|
||||
"foreground": "#fcfcfa",
|
||||
"messageForeground": "#fcfcfa"
|
||||
},
|
||||
"Panel": {
|
||||
"background": "#2d2a2e",
|
||||
"foreground": "#939293"
|
||||
},
|
||||
"ParameterInfo": {
|
||||
"background": "#403e41",
|
||||
"borderColor": "#363337",
|
||||
"currentOverloadBackground": "#403e41",
|
||||
"currentParameterForeground": "#ffd866",
|
||||
"disabledForeground": "#5b595c",
|
||||
"foreground": "#fcfcfa",
|
||||
"infoForeground": "#939293",
|
||||
"lineSeparatorColor": "#363337"
|
||||
},
|
||||
"PasswordField": {
|
||||
"background": "#403e41",
|
||||
"capsLockIconColor": "#ffd866",
|
||||
"caretForeground": "#ffd866",
|
||||
"foreground": "#fcfcfa",
|
||||
"inactiveForeground": "#5b595c",
|
||||
"selectionBackground": "#5b595c",
|
||||
"selectionForeground": "#ffd866"
|
||||
},
|
||||
"Plugins": {
|
||||
"background": "#2d2a2e",
|
||||
"disabledForeground": "#939293",
|
||||
"eapTagBackground": "#5b595c",
|
||||
"lightSelectionBackground": "#363337",
|
||||
"hoverBackground": "#363337",
|
||||
"tagForeground": "#ffd866",
|
||||
"tagBackground": "#5b595c",
|
||||
"Button": {
|
||||
"installBackground": "#221f22",
|
||||
"installBorderColor": "#221f22",
|
||||
"installForeground": "#fcfcfa",
|
||||
"installFocusedBackground": "#221f22",
|
||||
"installFillForeground": "#939293",
|
||||
"installFillBackground": "#221f22",
|
||||
"updateBackground": "#221f22",
|
||||
"updateBorderColor": "#221f22",
|
||||
"updateForeground": "#fcfcfa"
|
||||
},
|
||||
"SearchField": {
|
||||
"background": "#363337",
|
||||
"borderColor": "#363337"
|
||||
},
|
||||
"SectionHeader": {
|
||||
"background": "#2d2a2e",
|
||||
"foreground": "#939293"
|
||||
},
|
||||
"Tab": {
|
||||
"hoverBackground": "#363337",
|
||||
"selectedForeground": "#fcfcfa",
|
||||
"selectedBackground": "#363337"
|
||||
}
|
||||
},
|
||||
"Popup": {
|
||||
"Advertiser": {
|
||||
"background": "#2d2a2e",
|
||||
"borderColor": "#2d2a2e",
|
||||
"foreground": "#ffd866"
|
||||
},
|
||||
"borderColor": "#221f22",
|
||||
"inactiveBorderColor": "#2d2a2e",
|
||||
"innerBorderColor": "#2d2a2e",
|
||||
"Header": {
|
||||
"activeBackground": "#2d2a2e",
|
||||
"inactiveBackground": "#221f22"
|
||||
},
|
||||
"paintBorder": true,
|
||||
"separatorForeground": "#fcfcfa",
|
||||
"separatorColor": "#2d2a2e",
|
||||
"Toolbar": {
|
||||
"background": "#221f22",
|
||||
"borderColor": "#363337"
|
||||
}
|
||||
},
|
||||
"PopupMenu": {
|
||||
"background": "#2d2a2e",
|
||||
"foreground": "#fcfcfa",
|
||||
"translucentBackground": "#2d2a2e",
|
||||
"selectionBackground": "#403e41"
|
||||
},
|
||||
"PopupMenuSeparator": {
|
||||
"height": 10,
|
||||
"stripeIndent": 5
|
||||
},
|
||||
"ProgressBar": {
|
||||
"background": "#2d2a2e",
|
||||
"foreground": "#ffd866",
|
||||
"indeterminateEndColor": "#ffd866",
|
||||
"indeterminateStartColor": "#ffd866",
|
||||
"progressColor": "#ffd866",
|
||||
"selectionBackground": "#5b595c",
|
||||
"trackColor": "#5b595c"
|
||||
},
|
||||
"RadioButton": {
|
||||
"background": "#2d2a2e",
|
||||
"disabledText": "#5b595c",
|
||||
"foreground": "#fcfcfa"
|
||||
},
|
||||
"RadioButtonMenuItem": {
|
||||
"acceleratorForeground": "#939293",
|
||||
"acceleratorSelectionForeground": "#939293",
|
||||
"background": "#2d2a2e",
|
||||
"disabledBackground": "#2d2a2e",
|
||||
"disabledForeground": "#5b595c",
|
||||
"foreground": "#fcfcfa",
|
||||
"selectionBackground": "#403e41",
|
||||
"selectionForeground": "#ffd866"
|
||||
},
|
||||
"SearchEverywhere": {
|
||||
"Advertiser": {
|
||||
"background": "#221f22",
|
||||
"foreground": "#939293"
|
||||
},
|
||||
"Header": {
|
||||
"background": "#2d2a2e"
|
||||
},
|
||||
"List": {
|
||||
"separatorColor": "#2d2a2e",
|
||||
"separatorForeground": "#939293"
|
||||
},
|
||||
"SearchField": {
|
||||
"background": "#2d2a2e",
|
||||
"borderColor": "#221f22",
|
||||
"infoForeground": "#939293"
|
||||
},
|
||||
"Tab": {
|
||||
"selectedForeground": "#ffd866",
|
||||
"selectedBackground": "#5b595c"
|
||||
}
|
||||
},
|
||||
"SearchMatch": {
|
||||
"endBackground": "#ffd866",
|
||||
"startBackground": "#ffd866"
|
||||
},
|
||||
"Separator": {
|
||||
"separatorColor": "#363337"
|
||||
},
|
||||
"SidePanel": {
|
||||
"background": "#221f22"
|
||||
},
|
||||
"Slider": {
|
||||
"background": "#2d2a2e",
|
||||
"buttonBorderColor": "#ffd866",
|
||||
"buttonColor": "#ffd866",
|
||||
"foreground": "#fcfcfa",
|
||||
"tickColor": "#403e41",
|
||||
"trackColor": "#403e41"
|
||||
},
|
||||
"SpeedSearch": {
|
||||
"background": "#5b595c",
|
||||
"borderColor": "#2d2a2e",
|
||||
"errorForeground": "#fcfcfa",
|
||||
"foreground": "#fcfcfa"
|
||||
},
|
||||
"Spinner": {
|
||||
"background": "#2d2a2e"
|
||||
},
|
||||
"SplitPane": {
|
||||
"background": "#2d2a2e",
|
||||
"highlight": "#221f22"
|
||||
},
|
||||
"SplitPaneDivider": {
|
||||
"draggingColor": "#403e41"
|
||||
},
|
||||
"StatusBar": {
|
||||
"borderColor": "#363337",
|
||||
"hoverBackground": "#363337"
|
||||
},
|
||||
"TabbedPane": {
|
||||
"background": "#2d2a2e",
|
||||
"contentAreaColor": "#5b595c",
|
||||
"disabledForeground": "#5b595c",
|
||||
"disabledUnderlineColor": "#5b595c",
|
||||
"focus": "#403e41",
|
||||
"focusColor": "#403e41",
|
||||
"foreground": "#fcfcfa",
|
||||
"hoverColor": "#363337",
|
||||
"tabSelectionHeight": 2,
|
||||
"underlineColor": "#ffd866"
|
||||
},
|
||||
"Table": {
|
||||
"background": "#221f22",
|
||||
"dropLineColor": "#ffd866",
|
||||
"dropLineShortColor": "#ffd866",
|
||||
"focusCellBackground": "#221f22",
|
||||
"focusCellForeground": "#ffd866",
|
||||
"foreground": "#fcfcfa",
|
||||
"gridColor": "#221f22",
|
||||
"lightSelectionForeground": "#ffd866",
|
||||
"lightSelectionInactiveForeground": "#fcfcfa",
|
||||
"lightSelectionInactiveBackground": "#363337",
|
||||
"selectionBackground": "#363337",
|
||||
"selectionForeground": "#ffd866",
|
||||
"selectionInactiveBackground": "#363337",
|
||||
"selectionInactiveForeground": "#fcfcfa",
|
||||
"sortIconColor": "#fcfcfa",
|
||||
"stripeColor": "#221f22"
|
||||
},
|
||||
"TableHeader": {
|
||||
"background": "#2d2a2e",
|
||||
"bottomSeparatorColor": "#363337",
|
||||
"cellBorder": "4,0,4,0",
|
||||
"foreground": "#fcfcfa",
|
||||
"focusCellBackground": "#403e41",
|
||||
"separatorColor": "#363337"
|
||||
},
|
||||
"textText": "#939293",
|
||||
"TextArea": {
|
||||
"background": "#363337",
|
||||
"caretForeground": "#ffd866",
|
||||
"foreground": "#fcfcfa",
|
||||
"inactiveForeground": "#5b595c",
|
||||
"selectionBackground": "#5b595c",
|
||||
"selectionForeground": "#ffd866"
|
||||
},
|
||||
"TextField": {
|
||||
"background": "#363337",
|
||||
"caretForeground": "#ffd866",
|
||||
"foreground": "#fcfcfa",
|
||||
"inactiveForeground": "#5b595c",
|
||||
"selectionBackground": "#5b595c",
|
||||
"selectionForeground": "#ffd866"
|
||||
},
|
||||
"TextPane": {
|
||||
"background": "#363337",
|
||||
"caretForeground": "#ffd866",
|
||||
"foreground": "#fcfcfa",
|
||||
"inactiveForeground": "#5b595c",
|
||||
"selectionBackground": "#5b595c",
|
||||
"selectionForeground": "#ffd866"
|
||||
},
|
||||
"TitlePane": {
|
||||
"background": "#221f22",
|
||||
"Button.hoverBackground": "#5b595c",
|
||||
"inactiveBackground": "#2d2a2e",
|
||||
"infoForeground": "#939293",
|
||||
"inactiveInfoForeground": "#939293"
|
||||
},
|
||||
"TitledBorder": {
|
||||
"titleColor": "#2d2a2e"
|
||||
},
|
||||
"ToggleButton": {
|
||||
"borderColor": "#403e41",
|
||||
"buttonColor": "#fcfcfa",
|
||||
"disabledText": "#5b595c",
|
||||
"foreground": "#939293",
|
||||
"offForeground": "#2d2a2e",
|
||||
"offBackground": "#2d2a2e",
|
||||
"onBackground": "#ffd866",
|
||||
"onForeground": "#ffd866"
|
||||
},
|
||||
"ToolBar": {
|
||||
"background": "#221f22",
|
||||
"borderHandleColor": "#939293",
|
||||
"floatingForeground": "#939293",
|
||||
"foreground": "#fcfcfa"
|
||||
},
|
||||
"ToolTip": {
|
||||
"Actions": {
|
||||
"background": "#2d2a2e",
|
||||
"infoForeground": "#939293"
|
||||
},
|
||||
"background": "#2d2a2e",
|
||||
"borderColor": "#5b595c",
|
||||
"foreground": "#fcfcfa",
|
||||
"infoForeground": "#939293",
|
||||
"shortcutForeground": "#939293"
|
||||
},
|
||||
"ToolWindow": {
|
||||
"Button": {
|
||||
"hoverBackground": "#363337",
|
||||
"selectedForeground": "#ffd866",
|
||||
"selectedBackground": "#363337"
|
||||
},
|
||||
"Header": {
|
||||
"background": "#2d2a2e",
|
||||
"borderColor": "#363337",
|
||||
"inactiveBackground": "#2d2a2e"
|
||||
},
|
||||
"HeaderCloseButton": {
|
||||
"background": "#2d2a2e"
|
||||
},
|
||||
"HeaderTab": {
|
||||
"hoverBackground": "#363337",
|
||||
"hoverInactiveBackground": "#363337",
|
||||
"inactiveUnderlineColor": "#ffd866",
|
||||
"selectedInactiveBackground": "#2d2a2e",
|
||||
"underlineColor": "#ffd866",
|
||||
"underlinedTabBackground": "#363337",
|
||||
"underlinedTabInactiveBackground": "#363337"
|
||||
}
|
||||
},
|
||||
"Tree": {
|
||||
"background": "#221f22",
|
||||
"foreground": "#939293",
|
||||
"hash": "#2d2a2e",
|
||||
"modifiedItemForeground": "#ffd866",
|
||||
"rowHeight": 22,
|
||||
"selectionBackground": "#2d2a2e",
|
||||
"selectionForeground": "#ffd866",
|
||||
"selectionInactiveBackground": "#2d2a2e"
|
||||
},
|
||||
"UiDesigner": {
|
||||
"Panel": {
|
||||
"background": "#2d2a2e"
|
||||
},
|
||||
"Preview": {
|
||||
"background": "#2d2a2e"
|
||||
}
|
||||
},
|
||||
"ValidationTooltip": {
|
||||
"errorBackground": "#363337",
|
||||
"errorBorderColor": "#363337",
|
||||
"warningBackground": "#363337",
|
||||
"warningBorderColor": "#363337"
|
||||
},
|
||||
"VersionControl": {
|
||||
"FileHistory": {
|
||||
"Commit": {
|
||||
"selectedBranchBackground": "#2d2a2e"
|
||||
}
|
||||
},
|
||||
"GitLog": {
|
||||
"localBranchIconColor": "#ffd866",
|
||||
"otherIconColor": "#939293",
|
||||
"remoteBranchIconColor": "#fcfcfa",
|
||||
"tagIconColor": "#939293"
|
||||
},
|
||||
"HgLog": {
|
||||
"branchIconColor": "#ffd866",
|
||||
"bookmarkIconColor": "#ffd866",
|
||||
"closedBranchIconColor": "#5b595c",
|
||||
"localTagIconColor": "#939293",
|
||||
"mqTagIconColor": "#939293",
|
||||
"tagIconColor": "#939293",
|
||||
"tipIconColor": "#939293"
|
||||
},
|
||||
"Log": {
|
||||
"Commit": {
|
||||
"unmatchedForeground": "#939293",
|
||||
"currentBranchBackground": "#363337"
|
||||
}
|
||||
},
|
||||
"RefLabel": {
|
||||
"foreground": "#ffd866",
|
||||
"backgroundBase": "#5b595c"
|
||||
}
|
||||
},
|
||||
"Viewport": {
|
||||
"background": "#221f22",
|
||||
"foreground": "#fcfcfa"
|
||||
},
|
||||
"WelcomeScreen": {
|
||||
"background": "#2d2a2e",
|
||||
"borderColor": "#363337",
|
||||
"captionBackground": "#221f22",
|
||||
"captionForeground": "#fcfcfa",
|
||||
"footerBackground": "#221f22",
|
||||
"footerForeground": "#fcfcfa",
|
||||
"headerBackground": "#2d2a2e",
|
||||
"headerForeground": "#fcfcfa",
|
||||
"Projects": {
|
||||
"background": "#221f22",
|
||||
"selectionBackground": "#2d2a2e",
|
||||
"selectionInactiveBackground": "#2d2a2e"
|
||||
},
|
||||
"separatorColor": "#363337"
|
||||
},
|
||||
"window": "#2d2a2e",
|
||||
"Window": {
|
||||
"border": "0,0,0,0,#363337"
|
||||
},
|
||||
"windowBorder": "#363337",
|
||||
"windowText": "#939293"
|
||||
},
|
||||
"icons": {
|
||||
"ColorPalette": {
|
||||
"Checkbox.Background.Default.Dark": "##403e41",
|
||||
"Checkbox.Background.Disabled.Dark": "##221f22",
|
||||
"Checkbox.Background.Selected.Dark": "##403e41",
|
||||
"Checkbox.Border.Default.Dark": "##403e41",
|
||||
"Checkbox.Border.Disabled.Dark": "##221f22",
|
||||
"Checkbox.Border.Selected.Dark": "##403e41",
|
||||
"Checkbox.Focus.Thin.Default.Dark": "##403e41",
|
||||
"Checkbox.Focus.Thin.Selected.Dark": "##221f22",
|
||||
"Checkbox.Focus.Wide.Dark": "##403e41",
|
||||
"Checkbox.Foreground.Disabled.Dark": "##939293",
|
||||
"Checkbox.Foreground.Selected.Dark": "##fcfcfa"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Antelle
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,232 @@
|
||||
{
|
||||
"name": "Xcode-Dark",
|
||||
"dark": true,
|
||||
"author": "Antelle",
|
||||
"editorScheme": "/Xcode-Dark.xml",
|
||||
"ui": {
|
||||
"*": {
|
||||
"background": "#323333",
|
||||
"foreground": "#DFDFE0",
|
||||
|
||||
"infoForeground": "#A9A9AA",
|
||||
|
||||
"selectionBackground": "#1D7BED",
|
||||
"selectionForeground": "#F9FCFF",
|
||||
"selectionInactiveBackground": "#555657",
|
||||
"selectionBackgroundInactive": "#555657",
|
||||
|
||||
"lightSelectionBackground": "#2B4059",
|
||||
"lightSelectionForeground": "#FFFFFF",
|
||||
"lightSelectionInactiveBackground": "#555657",
|
||||
"lightSelectionInactiveForeground": "#DFDFE0",
|
||||
|
||||
"disabledBackground": "#323333",
|
||||
"inactiveBackground": "#313233",
|
||||
|
||||
"disabledForeground": "#737374",
|
||||
"disabledText": "#737374",
|
||||
"inactiveForeground": "#737374",
|
||||
|
||||
"acceleratorForeground": "#D0D0D9",
|
||||
"acceleratorSelectionForeground": "#D0D0D9",
|
||||
|
||||
"errorForeground": "#843937",
|
||||
|
||||
"borderColor": "#414141",
|
||||
"disabledBorderColor": "#414141",
|
||||
|
||||
"focusColor": "#24648D",
|
||||
"focusedBorderColor": "#4C8CB5",
|
||||
|
||||
"separatorForeground": "#5A5B5C",
|
||||
"separatorColor": "#5A5B5C",
|
||||
"lineSeparatorColor": "#5A5B5C",
|
||||
|
||||
"modifiedItemForeground": "#1E4D86"
|
||||
},
|
||||
|
||||
"ActionButton": {
|
||||
"hoverBackground": "#5A5B5C",
|
||||
"hoverBorderColor": "#5A5B5C",
|
||||
"pressedBackground": "#414141",
|
||||
"pressedBorderColor": "#414141"
|
||||
},
|
||||
|
||||
"Button": {
|
||||
"startBackground": "#424242",
|
||||
"endBackground": "#424242",
|
||||
"startBorderColor": "#525252",
|
||||
"endBorderColor": "#525252",
|
||||
"shadowColor": "#363636",
|
||||
|
||||
"default": {
|
||||
"foreground": "#DDE9FA",
|
||||
"startBackground": "#206DE3",
|
||||
"endBackground": "#1C61CA",
|
||||
"startBorderColor": "#6099EC",
|
||||
"endBorderColor": "#1C61CA",
|
||||
"focusedBorderColor": "#45A1F4",
|
||||
"focusColor": "#245F84",
|
||||
"shadowColor": "#363636"
|
||||
}
|
||||
},
|
||||
|
||||
"Borders": {
|
||||
"color": "#393A3B",
|
||||
"ContrastBorderColor": "#4b4c4d"
|
||||
},
|
||||
|
||||
"ComboBox": {
|
||||
"nonEditableBackground": "#4f5051",
|
||||
"background": "#414141",
|
||||
"ArrowButton": {
|
||||
"iconColor": "#DBDBDB",
|
||||
"background": "#1E67D7",
|
||||
"disabledIconColor": "#6B6B6C",
|
||||
"nonEditableBackground": "#4f5051"
|
||||
}
|
||||
},
|
||||
|
||||
"ComboPopup.border": "1,1,1,1,3F3F3F",
|
||||
|
||||
"Component": {
|
||||
"errorFocusColor": "#843937",
|
||||
"inactiveErrorFocusColor": "#433239",
|
||||
"warningFocusColor": "#8F7B2E",
|
||||
"inactiveWarningFocusColor": "#434136",
|
||||
"iconColor": "#DFDFE0",
|
||||
"hoverIconColor": "#FFFFFF"
|
||||
},
|
||||
|
||||
"Counter": {
|
||||
"background": "#909090",
|
||||
"foreground": "#000000"
|
||||
},
|
||||
|
||||
"DebuggerPopup.borderColor": "#414141",
|
||||
|
||||
"DefaultTabs": {
|
||||
"borderColor": "#484949",
|
||||
"background": "#2A2B2B",
|
||||
"inactiveUnderlineColor": "#24648D",
|
||||
"hoverBackground": "#262727",
|
||||
"underlineColor": "#1D7BED",
|
||||
"underlineHeight": 2,
|
||||
"underlinedTabBackground": "#3D3E3F"
|
||||
},
|
||||
|
||||
"DragAndDrop": {
|
||||
"areaForeground": "#DFDFE0",
|
||||
"areaBackground": "#363737",
|
||||
"areaBorderColor": "#414141"
|
||||
},
|
||||
|
||||
"EditorTabs": {
|
||||
"inactiveColoredFileBackground": "#2d281d"
|
||||
},
|
||||
|
||||
"FileColor": {
|
||||
"Yellow": "#3D3B37",
|
||||
"Green": "#383C38",
|
||||
"Blue": "#343A3E",
|
||||
"Violet": "#3C3A3D",
|
||||
"Orange": "#3D3A36",
|
||||
"Rose": "#3D383B"
|
||||
},
|
||||
|
||||
"Link": {
|
||||
"activeForeground": "#428EE1",
|
||||
"hoverForeground": "#7094FF",
|
||||
"pressedForeground": "#FC4741",
|
||||
"visitedForeground": "#7094FF"
|
||||
},
|
||||
|
||||
"Notification": {
|
||||
"errorForeground": "#DFDFE0",
|
||||
"errorBackground": "#843937",
|
||||
"errorBorderColor": "#982B31",
|
||||
|
||||
"MoreButton.innerBorderColor": "#4b4c4d",
|
||||
|
||||
"ToolWindow": {
|
||||
"informativeForeground": "#DFDFE0",
|
||||
"informativeBackground": "#225DA1",
|
||||
"informativeBorderColor": "#1C61CA",
|
||||
|
||||
"warningForeground": "#DFDFE0",
|
||||
"warningBackground": "#A98938",
|
||||
"warningBorderColor": "#FEC42E",
|
||||
|
||||
"errorForeground": "#DFDFE0",
|
||||
"errorBackground": "#843937",
|
||||
"errorBorderColor": "#982B31"
|
||||
}
|
||||
},
|
||||
|
||||
"ProgressBar": {
|
||||
"trackColor": "#252525",
|
||||
"progressColor": "#CDCCCC",
|
||||
"indeterminateStartColor": "#CDCCCC",
|
||||
"indeterminateEndColor": "#B4B3B3",
|
||||
"failedColor": "#DF1A21",
|
||||
"failedEndColor": "#982B31",
|
||||
"passedColor": "#3AA87B",
|
||||
"passedEndColor": "#368E68"
|
||||
},
|
||||
|
||||
"SearchMatch": {
|
||||
"startBackground": "#f5bc2d",
|
||||
"endBackground": "#e9b32b"
|
||||
},
|
||||
|
||||
"SpeedSearch": {
|
||||
"errorForeground": "#DF1A21"
|
||||
},
|
||||
|
||||
"ToggleButton": {
|
||||
"onBackground": "#1D7BED"
|
||||
},
|
||||
|
||||
"CompletionPopup": {
|
||||
"matchForeground": "#FDA14F",
|
||||
"selectionBackground": "#1D7BED"
|
||||
},
|
||||
|
||||
"Popup": {
|
||||
"Header": {
|
||||
"activeBackground": "#4A4E52",
|
||||
"inactiveBackground": "#4A4E52"
|
||||
}
|
||||
},
|
||||
|
||||
"SearchEverywhere": {
|
||||
"Tab": {
|
||||
"selectedForeground": "#F9FCFF",
|
||||
"selectedBackground": "#555A5E"
|
||||
}
|
||||
},
|
||||
|
||||
"icons": {
|
||||
"ColorPalette": {
|
||||
"Actions.Grey": "#969798",
|
||||
"Actions.Red": "#FC545B",
|
||||
"Actions.Yellow": "#e0c24c",
|
||||
"Actions.Green": "#71bf47",
|
||||
"Actions.Blue": "#3062d1",
|
||||
"Actions.GreyInline.Dark": "#6F6F70",
|
||||
|
||||
"Objects.Grey": "#6F6F70",
|
||||
"Objects.RedStatus": "#FC4741",
|
||||
"Objects.Red": "#FC545B",
|
||||
"Objects.Pink": "#F5539E",
|
||||
"Objects.Yellow": "#e0c24c",
|
||||
"Objects.Green": "#71bf47",
|
||||
"Objects.Blue": "#3062d1",
|
||||
"Objects.Purple": "#A453A5",
|
||||
"Objects.BlackText": "#000000",
|
||||
"Objects.YellowDark": "#89744D",
|
||||
"Objects.GreenAndroid": "#5D7554"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -164,6 +164,10 @@
|
||||
"background": "#323846",
|
||||
"selectionInactiveForeground": "#e5e9f0"
|
||||
},
|
||||
"MemoryIndicator": {
|
||||
"allocatedBackground": "#81a1c1",
|
||||
"usedBackground": "#5e81ac"
|
||||
},
|
||||
"Menu": {
|
||||
"background": "#323846",
|
||||
"borderColor": "#3b4252",
|
||||
@@ -231,6 +235,9 @@
|
||||
"activeBackground": "#434c5e"
|
||||
}
|
||||
},
|
||||
"PopupMenu": {
|
||||
"background": "#323846"
|
||||
},
|
||||
"ProgressBar": {
|
||||
"background": "#88c0d0",
|
||||
"failedColor": "#bf616a",
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
"backgroundColor": "#21252b",
|
||||
"borderColor": "#333841",
|
||||
"infoForeground": "#7e8491",
|
||||
"foregroundColor": "#abb2bf"
|
||||
"foregroundColor": "#abb2bf",
|
||||
"notificationBackground": "#3d424b",
|
||||
"selectionBackground": "#323844",
|
||||
"selectionForeground": "#d7dae0"
|
||||
},
|
||||
"ui": {
|
||||
"*": {
|
||||
@@ -17,10 +20,18 @@
|
||||
|
||||
"infoForeground": "#5c6370",
|
||||
|
||||
"selectionBackground": "#323844",
|
||||
"selectionBackground": {
|
||||
"os.default": "selectionBackground",
|
||||
"os.windows": "selectionBackground",
|
||||
"os.mac": "selectionBackground"
|
||||
},
|
||||
"selectionForeground": {
|
||||
"os.default": "selectionForeground",
|
||||
"os.windows": "selectionForeground",
|
||||
"os.mac": "selectionForeground"
|
||||
},
|
||||
"selectionInactiveBackground": "#2c313a",
|
||||
"selectionBackgroundInactive": "#2c313a",
|
||||
"selectionForeground": "#d7dae0",
|
||||
|
||||
"disabledBackground": "backgroundColor",
|
||||
"inactiveBackground": "backgroundColor",
|
||||
@@ -142,6 +153,9 @@
|
||||
"Editor": {
|
||||
"background": "#282c34",
|
||||
"foreground": "#abb2bf",
|
||||
"SearchField": {
|
||||
"background": "#282c34"
|
||||
},
|
||||
"shortcutForeground": "accentColor"
|
||||
},
|
||||
|
||||
@@ -192,7 +206,7 @@
|
||||
},
|
||||
|
||||
"Notification": {
|
||||
"background": "#3d424b",
|
||||
"background": "notificationBackground",
|
||||
"borderColor": "#53565f",
|
||||
|
||||
"errorForeground": "#abb2bf",
|
||||
@@ -219,6 +233,10 @@
|
||||
}
|
||||
},
|
||||
|
||||
"NotificationsToolwindow.newNotification.background" : "notificationBackground",
|
||||
"NotificationsToolwindow.newNotification.hoverBackground" : "#3d424b",
|
||||
"NotificationsToolwindow.Notification.hoverBackground" : "#3d424b",
|
||||
|
||||
"Panel.background": "backgroundColor",
|
||||
|
||||
"ParameterInfo": {
|
||||
@@ -314,6 +332,8 @@
|
||||
|
||||
"Settings.Spotlight.borderColor": "accentColor",
|
||||
|
||||
"StatusBar.background": "baseBackground",
|
||||
|
||||
"TabbedPane": {
|
||||
"underlineColor": "accentColor",
|
||||
"contentAreaColor": "#323844",
|
||||
@@ -362,6 +382,7 @@
|
||||
},
|
||||
|
||||
"ToolWindow": {
|
||||
"background": "backgroundColor",
|
||||
"Button": {
|
||||
"hoverBackground": "#323844",
|
||||
"selectedBackground": "#3d424b",
|
||||
|
||||
@@ -15,84 +15,101 @@
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id( "dev.nokee.jni-library" ) version "0.4.0"
|
||||
id( "dev.nokee.cpp-language" ) version "0.4.0"
|
||||
`cpp-library`
|
||||
}
|
||||
|
||||
library {
|
||||
targetMachines.set( listOf( machines.windows.x86, machines.windows.x86_64 ) )
|
||||
|
||||
variants.configureEach {
|
||||
sharedLibrary {
|
||||
compileTasks.configureEach {
|
||||
onlyIf { isBuildable }
|
||||
// disable debuggable for release builds to make shared libraries smaller
|
||||
binaries.configureEach( CppSharedLibrary::class ) {
|
||||
with( compileTask.get() ) {
|
||||
if( name.contains( "Release" ) )
|
||||
isDebuggable = false
|
||||
}
|
||||
with( linkTask.get() ) {
|
||||
if( name.contains( "Release" ) )
|
||||
debuggable.set( false )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// depend on :flatlaf-core:compileJava because it generates the JNI headers
|
||||
dependsOn( ":flatlaf-core:compileJava" )
|
||||
var javaHome = System.getProperty( "java.home" )
|
||||
if( javaHome.endsWith( "jre" ) )
|
||||
javaHome += "/.."
|
||||
|
||||
doFirst {
|
||||
println( "Used Tool Chain:" )
|
||||
println( " - ${toolChain.get()}" )
|
||||
println( "Available Tool Chains:" )
|
||||
toolChains.forEach {
|
||||
println( " - $it" )
|
||||
}
|
||||
tasks {
|
||||
register( "build-natives" ) {
|
||||
group = "build"
|
||||
description = "Builds natives"
|
||||
|
||||
// copy needed JNI headers
|
||||
copy {
|
||||
from( project( ":flatlaf-core" ).buildDir.resolve( "generated/jni-headers" ) )
|
||||
into( "src/main/headers" )
|
||||
include(
|
||||
"com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder.h",
|
||||
"com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc.h"
|
||||
)
|
||||
filter<org.apache.tools.ant.filters.FixCrLfFilter>(
|
||||
"eol" to org.apache.tools.ant.filters.FixCrLfFilter.CrLf.newInstance( "lf" )
|
||||
)
|
||||
}
|
||||
}
|
||||
dependsOn( "linkReleaseX86", "linkReleaseX86-64" )
|
||||
}
|
||||
|
||||
compilerArgs.addAll( toolChain.map {
|
||||
when( it ) {
|
||||
is Gcc, is Clang -> listOf( "-O2" )
|
||||
is VisualCpp -> listOf( "/O2", "/Zl", "/GS-" )
|
||||
else -> emptyList()
|
||||
}
|
||||
} )
|
||||
withType<CppCompile>().configureEach {
|
||||
onlyIf { name.contains( "Release" ) }
|
||||
|
||||
// depend on :flatlaf-core:compileJava because it generates the JNI headers
|
||||
dependsOn( ":flatlaf-core:compileJava" )
|
||||
|
||||
doFirst {
|
||||
println( "Used Tool Chain:" )
|
||||
println( " - ${toolChain.get()}" )
|
||||
println( "Available Tool Chains:" )
|
||||
toolChains.forEach {
|
||||
println( " - $it" )
|
||||
}
|
||||
|
||||
linkTask.configure {
|
||||
onlyIf { isBuildable }
|
||||
|
||||
val nativesDir = project( ":flatlaf-core" ).projectDir.resolve( "src/main/resources/com/formdev/flatlaf/natives" )
|
||||
val is64Bit = targetMachine.architecture.is64Bit
|
||||
val libraryName = if( is64Bit ) "flatlaf-windows-x86_64.dll" else "flatlaf-windows-x86.dll"
|
||||
val jawt = if( is64Bit ) "lib/jawt-x86_64" else "lib/jawt-x86"
|
||||
|
||||
outputs.file( "$nativesDir/$libraryName" )
|
||||
|
||||
linkerArgs.addAll( toolChain.map {
|
||||
when( it ) {
|
||||
is Gcc, is Clang -> listOf( "-l${jawt}", "-lUser32", "-lGdi32", "-lshell32", "-lAdvAPI32", "-lKernel32" )
|
||||
is VisualCpp -> listOf( "${jawt}.lib", "User32.lib", "Gdi32.lib", "shell32.lib", "AdvAPI32.lib", "Kernel32.lib", "/NODEFAULTLIB" )
|
||||
else -> emptyList()
|
||||
}
|
||||
} )
|
||||
|
||||
doLast {
|
||||
// copy shared library to flatlaf-core resources
|
||||
copy {
|
||||
from( linkedFile )
|
||||
into( nativesDir )
|
||||
rename( "flatlaf-natives-windows.dll", libraryName )
|
||||
}
|
||||
}
|
||||
// copy needed JNI headers
|
||||
copy {
|
||||
from( project( ":flatlaf-core" ).buildDir.resolve( "generated/jni-headers" ) )
|
||||
into( "src/main/headers" )
|
||||
include(
|
||||
"com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder.h",
|
||||
"com_formdev_flatlaf_ui_FlatWindowsNativeWindowBorder_WndProc.h"
|
||||
)
|
||||
filter<org.apache.tools.ant.filters.FixCrLfFilter>(
|
||||
"eol" to org.apache.tools.ant.filters.FixCrLfFilter.CrLf.newInstance( "lf" )
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
for( taskName in listOf( "jarX86", "jarX86-64" ) ) {
|
||||
tasks.named( taskName ) {
|
||||
onlyIf { false }
|
||||
}
|
||||
includes.from(
|
||||
"${javaHome}/include",
|
||||
"${javaHome}/include/win32"
|
||||
)
|
||||
|
||||
compilerArgs.addAll( toolChain.map {
|
||||
when( it ) {
|
||||
is Gcc, is Clang -> listOf( "-O2", "-DUNICODE" )
|
||||
is VisualCpp -> listOf( "/O2", "/Zl", "/GS-", "/DUNICODE" )
|
||||
else -> emptyList()
|
||||
}
|
||||
} )
|
||||
}
|
||||
|
||||
withType<LinkSharedLibrary>().configureEach {
|
||||
onlyIf { name.contains( "Release" ) }
|
||||
|
||||
val nativesDir = project( ":flatlaf-core" ).projectDir.resolve( "src/main/resources/com/formdev/flatlaf/natives" )
|
||||
val is64Bit = name.contains( "64" )
|
||||
val libraryName = if( is64Bit ) "flatlaf-windows-x86_64.dll" else "flatlaf-windows-x86.dll"
|
||||
val jawt = if( is64Bit ) "lib/jawt-x86_64" else "lib/jawt-x86"
|
||||
|
||||
linkerArgs.addAll( toolChain.map {
|
||||
when( it ) {
|
||||
is Gcc, is Clang -> listOf( "-l${jawt}", "-lUser32", "-lGdi32", "-lshell32", "-lAdvAPI32", "-lKernel32" )
|
||||
is VisualCpp -> listOf( "${jawt}.lib", "User32.lib", "Gdi32.lib", "shell32.lib", "AdvAPI32.lib", "Kernel32.lib", "/NODEFAULTLIB" )
|
||||
else -> emptyList()
|
||||
}
|
||||
} )
|
||||
|
||||
doLast {
|
||||
// copy shared library to flatlaf-core resources
|
||||
copy {
|
||||
from( linkedFile )
|
||||
into( nativesDir )
|
||||
rename( "flatlaf-natives-windows.dll", libraryName )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
#---- monospaced ----
|
||||
|
||||
- monospaced.font [active] Consolas plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||
- monospaced.font [active] Monospaced plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||
+ monospaced.font [active] Menlo plain 13 javax.swing.plaf.FontUIResource [UI]
|
||||
|
||||
|
||||
|
||||
@@ -313,6 +313,7 @@ FileView.computerIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFil
|
||||
FileView.directoryIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileViewDirectoryIcon [UI]
|
||||
FileView.fileIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileViewFileIcon [UI]
|
||||
FileView.floppyDriveIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileViewFloppyDriveIcon [UI]
|
||||
FileView.fullRowSelection true
|
||||
FileView.hardDriveIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileViewHardDriveIcon [UI]
|
||||
|
||||
|
||||
@@ -1044,6 +1045,7 @@ TabbedPane.hasFullBorder false
|
||||
TabbedPane.hiddenTabsNavigation moreTabsButton
|
||||
TabbedPane.highlight #232324 HSL 240 1 14 javax.swing.plaf.ColorUIResource [UI]
|
||||
TabbedPane.hoverColor #303234 HSL 210 4 20 com.formdev.flatlaf.util.DerivedColor [UI] darken(5%)
|
||||
TabbedPane.inactiveUnderlineColor #466a92 HSL 212 35 42 javax.swing.plaf.ColorUIResource [UI]
|
||||
TabbedPane.labelShift 1
|
||||
TabbedPane.light #2f3031 HSL 210 2 19 javax.swing.plaf.ColorUIResource [UI]
|
||||
TabbedPane.scrollButtonsPlacement both
|
||||
@@ -1090,7 +1092,7 @@ Table.focusCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.F
|
||||
Table.focusSelectedCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Selected [UI] lineColor=#000000 HSL 0 0 0 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000
|
||||
Table.font [active] $defaultFont [UI]
|
||||
Table.foreground #bbbbbb HSL 0 0 73 javax.swing.plaf.ColorUIResource [UI]
|
||||
Table.gridColor #525658 HSL 200 4 33 javax.swing.plaf.ColorUIResource [UI]
|
||||
Table.gridColor #5a5e60 HSL 200 3 36 javax.swing.plaf.ColorUIResource [UI]
|
||||
Table.intercellSpacing 0,0 javax.swing.plaf.DimensionUIResource [UI]
|
||||
Table.rowHeight 20
|
||||
Table.scrollPaneBorder [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI]
|
||||
@@ -1212,6 +1214,7 @@ TextPaneUI com.formdev.flatlaf.ui.FlatTextPaneUI
|
||||
TitlePane.background #303234 HSL 210 4 20 javax.swing.plaf.ColorUIResource [UI]
|
||||
TitlePane.buttonHoverBackground #55585c HSL 214 4 35 com.formdev.flatlaf.util.DerivedColor [UI] lighten(15% autoInverse)
|
||||
TitlePane.buttonMaximizedHeight 22
|
||||
TitlePane.buttonMinimumWidth 30
|
||||
TitlePane.buttonPressedBackground #484c4f HSL 206 5 30 com.formdev.flatlaf.util.DerivedColor [UI] lighten(10% autoInverse)
|
||||
TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI]
|
||||
TitlePane.centerTitle false
|
||||
@@ -1231,11 +1234,15 @@ TitlePane.inactiveBackground #303234 HSL 210 4 20 javax.swing.plaf.Colo
|
||||
TitlePane.inactiveForeground #8c8c8c HSL 0 0 55 javax.swing.plaf.ColorUIResource [UI]
|
||||
TitlePane.maximizeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowMaximizeIcon [UI]
|
||||
TitlePane.menuBarEmbedded true
|
||||
TitlePane.menuBarTitleGap 20
|
||||
TitlePane.menuBarResizeHeight 4
|
||||
TitlePane.menuBarTitleGap 40
|
||||
TitlePane.menuBarTitleMinimumGap 12
|
||||
TitlePane.noIconLeftGap 8
|
||||
TitlePane.restoreIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowRestoreIcon [UI]
|
||||
TitlePane.showIcon true
|
||||
TitlePane.showIconBesideTitle false
|
||||
TitlePane.titleMargins 3,0,3,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||
TitlePane.titleMinimumWidth 60
|
||||
TitlePane.unifiedBackground true
|
||||
TitlePane.useWindowDecorations true
|
||||
|
||||
@@ -1543,7 +1550,7 @@ mini.font [active] Segoe UI plain 9 javax.swing.plaf.Fon
|
||||
|
||||
#---- monospaced ----
|
||||
|
||||
monospaced.font [active] Consolas plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||
monospaced.font [active] Monospaced plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||
|
||||
|
||||
#---- ----
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
#---- monospaced ----
|
||||
|
||||
- monospaced.font [active] Consolas plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||
- monospaced.font [active] Monospaced plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||
+ monospaced.font [active] Menlo plain 13 javax.swing.plaf.FontUIResource [UI]
|
||||
|
||||
|
||||
|
||||
@@ -317,6 +317,7 @@ FileView.computerIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFil
|
||||
FileView.directoryIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileViewDirectoryIcon [UI]
|
||||
FileView.fileIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileViewFileIcon [UI]
|
||||
FileView.floppyDriveIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileViewFloppyDriveIcon [UI]
|
||||
FileView.fullRowSelection true
|
||||
FileView.hardDriveIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileViewHardDriveIcon [UI]
|
||||
|
||||
|
||||
@@ -1049,6 +1050,7 @@ TabbedPane.hasFullBorder false
|
||||
TabbedPane.hiddenTabsNavigation moreTabsButton
|
||||
TabbedPane.highlight #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
|
||||
TabbedPane.hoverColor #e0e0e0 HSL 0 0 88 com.formdev.flatlaf.util.DerivedColor [UI] darken(7% autoInverse)
|
||||
TabbedPane.inactiveUnderlineColor #97bbdc HSL 209 50 73 javax.swing.plaf.ColorUIResource [UI]
|
||||
TabbedPane.labelShift 1
|
||||
TabbedPane.light #e1e1e1 HSL 0 0 88 javax.swing.plaf.ColorUIResource [UI]
|
||||
TabbedPane.scrollButtonsPlacement both
|
||||
@@ -1095,7 +1097,7 @@ Table.focusCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.F
|
||||
Table.focusSelectedCellHighlightBorder [lazy] 2,3,2,3 false com.formdev.flatlaf.ui.FlatTableCellBorder$Selected [UI] lineColor=#000000 HSL 0 0 0 javax.swing.plaf.ColorUIResource [UI] lineThickness=1.000000
|
||||
Table.font [active] $defaultFont [UI]
|
||||
Table.foreground #000000 HSL 0 0 0 javax.swing.plaf.ColorUIResource [UI]
|
||||
Table.gridColor #f2f2f2 HSL 0 0 95 javax.swing.plaf.ColorUIResource [UI]
|
||||
Table.gridColor #ebebeb HSL 0 0 92 javax.swing.plaf.ColorUIResource [UI]
|
||||
Table.intercellSpacing 0,0 javax.swing.plaf.DimensionUIResource [UI]
|
||||
Table.rowHeight 20
|
||||
Table.scrollPaneBorder [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.FlatBorder [UI]
|
||||
@@ -1217,6 +1219,7 @@ TextPaneUI com.formdev.flatlaf.ui.FlatTextPaneUI
|
||||
TitlePane.background #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
|
||||
TitlePane.buttonHoverBackground #e6e6e6 HSL 0 0 90 com.formdev.flatlaf.util.DerivedColor [UI] darken(10% autoInverse)
|
||||
TitlePane.buttonMaximizedHeight 22
|
||||
TitlePane.buttonMinimumWidth 30
|
||||
TitlePane.buttonPressedBackground #ebebeb HSL 0 0 92 com.formdev.flatlaf.util.DerivedColor [UI] darken(8% autoInverse)
|
||||
TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI]
|
||||
TitlePane.centerTitle false
|
||||
@@ -1236,11 +1239,15 @@ TitlePane.inactiveBackground #ffffff HSL 0 0 100 javax.swing.plaf.Colo
|
||||
TitlePane.inactiveForeground #8c8c8c HSL 0 0 55 javax.swing.plaf.ColorUIResource [UI]
|
||||
TitlePane.maximizeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowMaximizeIcon [UI]
|
||||
TitlePane.menuBarEmbedded true
|
||||
TitlePane.menuBarTitleGap 20
|
||||
TitlePane.menuBarResizeHeight 4
|
||||
TitlePane.menuBarTitleGap 40
|
||||
TitlePane.menuBarTitleMinimumGap 12
|
||||
TitlePane.noIconLeftGap 8
|
||||
TitlePane.restoreIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowRestoreIcon [UI]
|
||||
TitlePane.showIcon true
|
||||
TitlePane.showIconBesideTitle false
|
||||
TitlePane.titleMargins 3,0,3,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||
TitlePane.titleMinimumWidth 60
|
||||
TitlePane.unifiedBackground true
|
||||
TitlePane.useWindowDecorations true
|
||||
|
||||
@@ -1548,7 +1555,7 @@ mini.font [active] Segoe UI plain 9 javax.swing.plaf.Fon
|
||||
|
||||
#---- monospaced ----
|
||||
|
||||
monospaced.font [active] Consolas plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||
monospaced.font [active] Monospaced plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||
|
||||
|
||||
#---- ----
|
||||
|
||||
@@ -73,43 +73,57 @@ Button.default.endBorderColor #0000ff HSL 240 100 50 javax.swing.plaf.Colo
|
||||
Button.default.focusColor #ff0000 HSL 0 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.default.focusedBackground #00ffff HSL 180 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.default.focusedBorderColor #537699 HSL 210 30 46 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.default.focusedForeground #0000ff HSL 240 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.default.foreground #880000 HSL 0 100 27 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.default.hoverBackground #ffff00 HSL 60 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.default.hoverBorderColor #ff0000 HSL 0 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.default.hoverForeground #0000ff HSL 240 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.default.pressedBackground #ffc800 HSL 47 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.default.pressedForeground #0080ff HSL 210 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.default.startBackground #dddddd HSL 0 0 87 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.default.startBorderColor #ff0000 HSL 0 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.defaultButtonFollowsFocus false
|
||||
Button.disabledBackground #e0e0e0 HSL 0 0 88 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.disabledBorderColor #000088 HSL 240 100 27 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.disabledForeground #000088 HSL 240 100 27 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.disabledSelectedBackground #112233 HSL 210 50 13 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.disabledSelectedForeground #ffcccc HSL 0 100 90 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.disabledText #000088 HSL 240 100 27 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.endBackground #bbbbbb HSL 0 0 73 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.endBorderColor #ff0000 HSL 0 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.focusedBackground #00ffff HSL 180 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.focusedBorderColor #466d94 HSL 210 36 43 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.focusedForeground #0000ff HSL 240 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.font [active] $defaultFont [UI]
|
||||
Button.foreground #ff0000 HSL 0 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.highlight #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.hoverBackground #ffff00 HSL 60 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.hoverBorderColor #ff0000 HSL 0 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.hoverForeground #0000ff HSL 240 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.iconTextGap 4
|
||||
Button.innerFocusWidth 1
|
||||
Button.light #e3e3e3 HSL 0 0 89 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.margin 2,14,2,14 javax.swing.plaf.InsetsUIResource [UI]
|
||||
Button.minimumWidth 72
|
||||
Button.pressedBackground #ffc800 HSL 47 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.pressedForeground #0080ff HSL 210 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.rollover true
|
||||
Button.selectedBackground #ffbbbb HSL 0 100 87 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.selectedForeground #332211 HSL 30 50 13 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.shadow #a0a0a0 HSL 0 0 63 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.startBackground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.startBorderColor #0000ff HSL 240 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.textIconGap 4
|
||||
Button.textShiftOffset 0
|
||||
Button.toolbar.disabledSelectedBackground #cccccc HSL 0 0 80 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.toolbar.disabledSelectedForeground #886666 HSL 0 14 47 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.toolbar.hoverBackground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.toolbar.hoverForeground #000000 HSL 0 0 0 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.toolbar.margin 3,3,3,3 javax.swing.plaf.InsetsUIResource [UI]
|
||||
Button.toolbar.pressedBackground #eeeeee HSL 0 0 93 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.toolbar.pressedForeground #666666 HSL 0 0 40 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.toolbar.selectedBackground #dddddd HSL 0 0 87 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.toolbar.selectedForeground #880000 HSL 0 100 27 javax.swing.plaf.ColorUIResource [UI]
|
||||
Button.toolbar.spacingInsets 1,2,1,2 javax.swing.plaf.InsetsUIResource [UI]
|
||||
ButtonUI com.formdev.flatlaf.ui.FlatButtonUI
|
||||
|
||||
@@ -318,6 +332,7 @@ FileView.computerIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFil
|
||||
FileView.directoryIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileViewDirectoryIcon [UI]
|
||||
FileView.fileIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileViewFileIcon [UI]
|
||||
FileView.floppyDriveIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileViewFloppyDriveIcon [UI]
|
||||
FileView.fullRowSelection true
|
||||
FileView.hardDriveIcon [lazy] 16,16 com.formdev.flatlaf.icons.FlatFileViewHardDriveIcon [UI]
|
||||
|
||||
|
||||
@@ -1059,6 +1074,7 @@ TabbedPane.hasFullBorder false
|
||||
TabbedPane.hiddenTabsNavigation moreTabsButton
|
||||
TabbedPane.highlight #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
|
||||
TabbedPane.hoverColor #eeeeee HSL 0 0 93 javax.swing.plaf.ColorUIResource [UI]
|
||||
TabbedPane.inactiveUnderlineColor #ff00ff HSL 300 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
TabbedPane.labelShift 1
|
||||
TabbedPane.light #e3e3e3 HSL 0 0 89 javax.swing.plaf.ColorUIResource [UI]
|
||||
TabbedPane.scrollButtonsPlacement both
|
||||
@@ -1233,6 +1249,7 @@ TextPaneUI com.formdev.flatlaf.ui.FlatTextPaneUI
|
||||
TitlePane.background #00ff00 HSL 120 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
TitlePane.borderColor #ff0000 HSL 0 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
TitlePane.buttonMaximizedHeight 22
|
||||
TitlePane.buttonMinimumWidth 30
|
||||
TitlePane.buttonSize 44,30 javax.swing.plaf.DimensionUIResource [UI]
|
||||
TitlePane.centerTitle false
|
||||
TitlePane.centerTitleIfMenuBarEmbedded true
|
||||
@@ -1250,11 +1267,15 @@ TitlePane.inactiveBackground #008800 HSL 120 100 27 javax.swing.plaf.Colo
|
||||
TitlePane.inactiveForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
|
||||
TitlePane.maximizeIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowMaximizeIcon [UI]
|
||||
TitlePane.menuBarEmbedded true
|
||||
TitlePane.menuBarTitleGap 20
|
||||
TitlePane.menuBarResizeHeight 4
|
||||
TitlePane.menuBarTitleGap 40
|
||||
TitlePane.menuBarTitleMinimumGap 12
|
||||
TitlePane.noIconLeftGap 8
|
||||
TitlePane.restoreIcon [lazy] 44,30 com.formdev.flatlaf.icons.FlatWindowRestoreIcon [UI]
|
||||
TitlePane.showIcon true
|
||||
TitlePane.showIconBesideTitle false
|
||||
TitlePane.titleMargins 3,0,3,0 javax.swing.plaf.InsetsUIResource [UI]
|
||||
TitlePane.titleMinimumWidth 60
|
||||
TitlePane.unifiedBackground true
|
||||
TitlePane.useWindowDecorations true
|
||||
|
||||
@@ -1278,31 +1299,43 @@ ToggleButton.border [lazy] 1,1,1,1 false com.formdev.flatlaf.ui.F
|
||||
ToggleButton.darkShadow #696969 HSL 0 0 41 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.disabledBackground #e0e0e0 HSL 0 0 88 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.disabledSelectedBackground #44dd44 HSL 120 69 57 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.disabledSelectedForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.disabledText #000088 HSL 240 100 27 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.focusedBackground #00ffff HSL 180 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.focusedForeground #0000ff HSL 240 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.font [active] $defaultFont [UI]
|
||||
ToggleButton.foreground #ff0000 HSL 0 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.highlight #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.hoverBackground #ffff00 HSL 60 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.hoverForeground #0000ff HSL 240 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.iconTextGap 4
|
||||
ToggleButton.light #e3e3e3 HSL 0 0 89 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.margin 2,14,2,14 javax.swing.plaf.InsetsUIResource [UI]
|
||||
ToggleButton.pressedBackground #ffc800 HSL 47 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.pressedForeground #0080ff HSL 210 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.rollover true
|
||||
ToggleButton.selectedBackground #44ff44 HSL 120 100 63 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.selectedForeground #000000 HSL 0 0 0 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.shadow #a0a0a0 HSL 0 0 63 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.tab.disabledUnderlineColor #7a7a7a HSL 0 0 48 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.tab.focusBackground #dddddd HSL 0 0 87 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.tab.focusForeground #008800 HSL 120 100 27 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.tab.hoverBackground #eeeeee HSL 0 0 93 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.tab.selectedBackground #00ff00 HSL 120 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.tab.hoverForeground #0000ff HSL 240 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.tab.selectedBackground #008800 HSL 120 100 27 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.tab.selectedForeground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.tab.underlineColor #ffff00 HSL 60 100 50 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.tab.underlineHeight 2
|
||||
ToggleButton.textIconGap 4
|
||||
ToggleButton.textShiftOffset 0
|
||||
ToggleButton.toolbar.disabledSelectedBackground #cccccc HSL 0 0 80 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.toolbar.disabledSelectedForeground #886666 HSL 0 14 47 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.toolbar.hoverBackground #ffffff HSL 0 0 100 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.toolbar.hoverForeground #000000 HSL 0 0 0 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.toolbar.pressedBackground #eeeeee HSL 0 0 93 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.toolbar.pressedForeground #666666 HSL 0 0 40 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.toolbar.selectedBackground #dddddd HSL 0 0 87 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButton.toolbar.selectedForeground #880000 HSL 0 100 27 javax.swing.plaf.ColorUIResource [UI]
|
||||
ToggleButtonUI com.formdev.flatlaf.ui.FlatToggleButtonUI
|
||||
|
||||
|
||||
@@ -1561,7 +1594,7 @@ mini.font [active] Segoe UI plain 9 javax.swing.plaf.Fon
|
||||
|
||||
#---- monospaced ----
|
||||
|
||||
monospaced.font [active] Consolas plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||
monospaced.font [active] Monospaced plain 12 javax.swing.plaf.FontUIResource [UI]
|
||||
|
||||
|
||||
#---- ----
|
||||
|
||||
@@ -16,7 +16,12 @@
|
||||
|
||||
package com.formdev.flatlaf.testing;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.function.Function;
|
||||
import javax.swing.*;
|
||||
import com.formdev.flatlaf.icons.FlatFileChooserHomeFolderIcon;
|
||||
import net.miginfocom.swing.*;
|
||||
|
||||
/**
|
||||
@@ -28,6 +33,24 @@ public class FlatChooserTest
|
||||
public static void main( String[] args ) {
|
||||
SwingUtilities.invokeLater( () -> {
|
||||
FlatTestFrame frame = FlatTestFrame.create( args, "FlatChooserTest" );
|
||||
|
||||
UIManager.put( "FileChooser.shortcuts.filesFunction", (Function<File[], File[]>) files -> {
|
||||
ArrayList<File> list = new ArrayList<>( Arrays.asList( files ) );
|
||||
list.add( 0, new File( System.getProperty( "user.home" ) ) );
|
||||
return list.toArray( new File[list.size()] );
|
||||
} );
|
||||
|
||||
UIManager.put( "FileChooser.shortcuts.displayNameFunction", (Function<File, String>) file -> {
|
||||
if( file.getAbsolutePath().equals( System.getProperty( "user.home" ) ) )
|
||||
return "Home";
|
||||
return null;
|
||||
} );
|
||||
UIManager.put( "FileChooser.shortcuts.iconFunction", (Function<File, Icon>) file -> {
|
||||
if( file.getAbsolutePath().equals( System.getProperty( "user.home" ) ) )
|
||||
return new FlatFileChooserHomeFolderIcon();
|
||||
return null;
|
||||
} );
|
||||
|
||||
frame.showFrame( FlatChooserTest::new );
|
||||
} );
|
||||
}
|
||||
|
||||
@@ -106,6 +106,20 @@ public class FlatComponents2Test
|
||||
table1.setModel( tableModel );
|
||||
xTable1.setModel( tableModel );
|
||||
|
||||
// table header popup menu
|
||||
JMenuItem addMenuItem = new JMenuItem( "Add column" );
|
||||
addMenuItem.addActionListener( e -> {
|
||||
tableModel.setColumnCount( tableModel.getColumnCount() + 1 );
|
||||
});
|
||||
JMenuItem removeMenuItem = new JMenuItem( "Remove last column" );
|
||||
removeMenuItem.addActionListener( e -> {
|
||||
tableModel.setColumnCount( tableModel.getColumnCount() - 1 );
|
||||
});
|
||||
JPopupMenu popupMenu = new JPopupMenu();
|
||||
popupMenu.add( addMenuItem );
|
||||
popupMenu.add( removeMenuItem );
|
||||
table1.getTableHeader().setComponentPopupMenu( popupMenu );
|
||||
|
||||
// table column editors
|
||||
initTableEditors( table1 );
|
||||
initTableEditors( xTable1 );
|
||||
@@ -336,6 +350,16 @@ public class FlatComponents2Test
|
||||
table.setSurrendersFocusOnKeystroke( focusCellEditorCheckBox.isSelected() );
|
||||
}
|
||||
|
||||
private void alternatingRowsChanged() {
|
||||
UIManager.put( "Table.alternateRowColor", alternatingRowsCheckBox.isSelected() ? Color.orange : null );
|
||||
table1ScrollPane.repaint();
|
||||
}
|
||||
|
||||
private void paintOutsideAlternateRowsChanged() {
|
||||
UIManager.put( "Table.paintOutsideAlternateRows", paintOutsideAlternateRowsCheckBox.isSelected() ? true : null );
|
||||
table1ScrollPane.repaint();
|
||||
}
|
||||
|
||||
private void treeRendererChanged() {
|
||||
Object sel = treeRendererComboBox.getSelectedItem();
|
||||
if( !(sel instanceof String) )
|
||||
@@ -493,8 +517,10 @@ public class FlatComponents2Test
|
||||
focusCellEditorCheckBox = new JCheckBox();
|
||||
showVerticalLinesCheckBox = new JCheckBox();
|
||||
columnSelectionCheckBox = new JCheckBox();
|
||||
alternatingRowsCheckBox = new JCheckBox();
|
||||
intercellSpacingCheckBox = new JCheckBox();
|
||||
rowHeaderCheckBox = new JCheckBox();
|
||||
paintOutsideAlternateRowsCheckBox = new JCheckBox();
|
||||
redGridColorCheckBox = new JCheckBox();
|
||||
tableHeaderButtonCheckBox = new JCheckBox();
|
||||
|
||||
@@ -875,6 +901,11 @@ public class FlatComponents2Test
|
||||
columnSelectionCheckBox.addActionListener(e -> columnSelectionChanged());
|
||||
tableOptionsPanel.add(columnSelectionCheckBox, "cell 1 2");
|
||||
|
||||
//---- alternatingRowsCheckBox ----
|
||||
alternatingRowsCheckBox.setText("alternating rows");
|
||||
alternatingRowsCheckBox.addActionListener(e -> alternatingRowsChanged());
|
||||
tableOptionsPanel.add(alternatingRowsCheckBox, "cell 2 2");
|
||||
|
||||
//---- intercellSpacingCheckBox ----
|
||||
intercellSpacingCheckBox.setText("intercell spacing");
|
||||
intercellSpacingCheckBox.addActionListener(e -> intercellSpacingChanged());
|
||||
@@ -885,6 +916,11 @@ public class FlatComponents2Test
|
||||
rowHeaderCheckBox.addActionListener(e -> rowHeaderChanged());
|
||||
tableOptionsPanel.add(rowHeaderCheckBox, "cell 1 3");
|
||||
|
||||
//---- paintOutsideAlternateRowsCheckBox ----
|
||||
paintOutsideAlternateRowsCheckBox.setText("outside alternating rows");
|
||||
paintOutsideAlternateRowsCheckBox.addActionListener(e -> paintOutsideAlternateRowsChanged());
|
||||
tableOptionsPanel.add(paintOutsideAlternateRowsCheckBox, "cell 2 3");
|
||||
|
||||
//---- redGridColorCheckBox ----
|
||||
redGridColorCheckBox.setText("red grid color");
|
||||
redGridColorCheckBox.addActionListener(e -> redGridColorChanged());
|
||||
@@ -927,8 +963,10 @@ public class FlatComponents2Test
|
||||
private JCheckBox focusCellEditorCheckBox;
|
||||
private JCheckBox showVerticalLinesCheckBox;
|
||||
private JCheckBox columnSelectionCheckBox;
|
||||
private JCheckBox alternatingRowsCheckBox;
|
||||
private JCheckBox intercellSpacingCheckBox;
|
||||
private JCheckBox rowHeaderCheckBox;
|
||||
private JCheckBox paintOutsideAlternateRowsCheckBox;
|
||||
private JCheckBox redGridColorCheckBox;
|
||||
private JCheckBox tableHeaderButtonCheckBox;
|
||||
// JFormDesigner - End of variables declaration //GEN-END:variables
|
||||
@@ -1150,6 +1188,7 @@ public class FlatComponents2Test
|
||||
{ "item 12", null, "December", null, null, null },
|
||||
};
|
||||
|
||||
private int columnCount = columnNames.length;
|
||||
private int rowCount = rows.length;
|
||||
private final Map<Integer, Object[]> moreRowsMap = new HashMap<>();
|
||||
|
||||
@@ -1157,6 +1196,16 @@ public class FlatComponents2Test
|
||||
setRowCount( rowCount );
|
||||
}
|
||||
|
||||
void setColumnCount( int columnCount ) {
|
||||
if( columnCount > columnNames.length )
|
||||
columnCount = columnNames.length;
|
||||
|
||||
this.columnCount = columnCount;
|
||||
|
||||
// fire event
|
||||
fireTableStructureChanged();
|
||||
}
|
||||
|
||||
void setRowCount( int rowCount ) {
|
||||
int oldRowCount = this.rowCount;
|
||||
this.rowCount = rowCount;
|
||||
@@ -1175,7 +1224,7 @@ public class FlatComponents2Test
|
||||
|
||||
@Override
|
||||
public int getColumnCount() {
|
||||
return columnNames.length;
|
||||
return columnCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
JFDML JFormDesigner: "7.0.5.0.382" Java: "16" encoding: "UTF-8"
|
||||
JFDML JFormDesigner: "7.0.5.0.404" Java: "17.0.2" encoding: "UTF-8"
|
||||
|
||||
new FormModel {
|
||||
contentType: "form/swing"
|
||||
@@ -485,6 +485,16 @@ new FormModel {
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||
name: "alternatingRowsCheckBox"
|
||||
"text": "alternating rows"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "alternatingRowsChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||
name: "intercellSpacingCheckBox"
|
||||
"text": "intercell spacing"
|
||||
@@ -505,6 +515,16 @@ new FormModel {
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 3"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||
name: "paintOutsideAlternateRowsCheckBox"
|
||||
"text": "outside alternating rows"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "paintOutsideAlternateRowsChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 3"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||
name: "redGridColorCheckBox"
|
||||
"text": "red grid color"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user