PasswordField: fixed reveal button appearance in IntelliJ themes (issue #494)

This commit is contained in:
Karl Tauber
2022-03-13 18:39:12 +01:00
parent 99f7b9ad84
commit c478d28b71
10 changed files with 35 additions and 15 deletions

View File

@@ -242,7 +242,19 @@ public class IntelliJTheme
defaults.put( "Tree.rowHeight", 22 );
// apply theme specific UI defaults at the end to allow overwriting
defaults.putAll( themeSpecificDefaults );
for( Map.Entry<Object, Object> e : themeSpecificDefaults.entrySet() ) {
Object key = e.getKey();
Object value = e.getValue();
// append styles to existing styles
if( key instanceof String && ((String)key).startsWith( "[style]" ) ) {
Object oldValue = defaults.get( key );
if( oldValue != null )
value = oldValue + "; " + value;
}
defaults.put( key, value );
}
}
private Map<Object, Object> removeThemeSpecificDefaults( UIDefaults defaults ) {

View File

@@ -240,6 +240,7 @@ MenuBar.borderColor = $Separator.foreground
#---- PasswordField ----
PasswordField.capsLockIconColor = #ffffff64
PasswordField.revealIconColor = @foreground
#---- Popup ----
@@ -367,6 +368,6 @@ Tree.hash = lighten($Tree.background,5%)
focusable: false; \
toolbar.margin: 1,1,1,1; \
toolbar.spacingInsets: 1,1,1,1; \
toolbar.hoverBackground: fade(Actions.GreyInline,30%,lazy); \
toolbar.pressedBackground: fade(Actions.GreyInline,40%,lazy); \
toolbar.selectedBackground: fade(Actions.GreyInline,50%,lazy)
toolbar.hoverBackground: lighten($TextField.background,5%); \
toolbar.pressedBackground: lighten($TextField.background,10%); \
toolbar.selectedBackground: lighten($TextField.background,15%)

View File

@@ -487,7 +487,6 @@ PasswordField.showCapsLock = true
PasswordField.showRevealButton = false
PasswordField.capsLockIcon = com.formdev.flatlaf.icons.FlatCapsLockIcon
PasswordField.revealIcon = com.formdev.flatlaf.icons.FlatRevealIcon
PasswordField.revealIconColor = lazy(Actions.Grey)
#---- Popup ----

View File

@@ -247,6 +247,7 @@ MenuBar.borderColor = $Separator.foreground
#---- PasswordField ----
PasswordField.capsLockIconColor = #00000064
PasswordField.revealIconColor = tint(@foreground,40%)
#---- Popup ----
@@ -374,6 +375,6 @@ Tree.hash = darken($Tree.background,10%)
focusable: false; \
toolbar.margin: 1,1,1,1; \
toolbar.spacingInsets: 1,1,1,1; \
toolbar.hoverBackground: fade(Actions.GreyInline,10%,lazy); \
toolbar.pressedBackground: fade(Actions.GreyInline,20%,lazy); \
toolbar.selectedBackground: fade(Actions.GreyInline,30%,lazy)
toolbar.hoverBackground: darken($TextField.background,4%); \
toolbar.pressedBackground: darken($TextField.background,8%); \
toolbar.selectedBackground: darken($TextField.background,12%)

View File

@@ -158,6 +158,11 @@ ToggleButton.endBackground = $ToggleButton.background
[High_contrast]ToggleButton.selectedForeground = #000
[High_contrast]ToggleButton.disabledSelectedBackground = #444
[High_contrast]ToggleButton.toolbar.selectedBackground = #fff
[High_contrast][style]Button.inTextField = \
toolbar.hoverBackground: #444; \
toolbar.pressedBackground: #666; \
toolbar.selectedBackground: #fff
[High_contrast][style]ToggleButton.inTextField = $[High_contrast][style]Button.inTextField
[Light_Flat]TableHeader.background = #E5E5E9