mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
macOS themes: support changing accent and highlight colors (issue #497)
This commit is contained in:
@@ -88,12 +88,12 @@
|
||||
@menuBackground = lighten(@background,8%)
|
||||
|
||||
# selection
|
||||
@selectionBackground = @nsSelectedContentBackgroundColor
|
||||
@selectionBackground = if(systemColor(accent), shade(spin(systemColor(accent),4),20%), @nsSelectedContentBackgroundColor)
|
||||
@selectionForeground = @nsSelectedMenuItemTextColor
|
||||
@selectionInactiveBackground = @nsUnemphasizedSelectedContentBackgroundColor
|
||||
|
||||
# text selection
|
||||
@textSelectionBackground = @nsSelectedTextBackgroundColor
|
||||
@textSelectionBackground = systemColor(highlight,if(systemColor(accent), darken(desaturate(systemColor(accent),60%),10%), @nsSelectedTextBackgroundColor))
|
||||
@textSelectionForeground = @nsSelectedTextColor
|
||||
|
||||
# menu
|
||||
@@ -101,8 +101,8 @@
|
||||
@menuItemMargin = 3,11,3,11
|
||||
|
||||
# accent colors (blueish)
|
||||
@accentColor = @nsControlAccentColor
|
||||
@accentFocusColor = @nsKeyboardFocusIndicatorColor
|
||||
@accentColor = systemColor(accent,@nsControlAccentColor)
|
||||
@accentFocusColor = if(systemColor(accent), fade(spin(systemColor(accent),-10),50%), @nsKeyboardFocusIndicatorColor)
|
||||
|
||||
|
||||
#---- Button ----
|
||||
|
||||
@@ -88,12 +88,12 @@
|
||||
@menuBackground = darken(@background,4%)
|
||||
|
||||
# selection
|
||||
@selectionBackground = @nsSelectedContentBackgroundColor
|
||||
@selectionBackground = if(systemColor(accent), shade(spin(systemColor(accent),4),10%), @nsSelectedContentBackgroundColor)
|
||||
@selectionForeground = @nsSelectedMenuItemTextColor
|
||||
@selectionInactiveBackground = @nsUnemphasizedSelectedContentBackgroundColor
|
||||
|
||||
# text selection
|
||||
@textSelectionBackground = @nsSelectedTextBackgroundColor
|
||||
@textSelectionBackground = systemColor(highlight,if(systemColor(accent), tint(systemColor(accent),70%), @nsSelectedTextBackgroundColor))
|
||||
@textSelectionForeground = @foreground
|
||||
|
||||
# menu
|
||||
@@ -102,8 +102,8 @@
|
||||
@menuItemMargin = 3,11,3,11
|
||||
|
||||
# accent colors (blueish)
|
||||
@accentColor = @nsControlAccentColor
|
||||
@accentFocusColor = @nsKeyboardFocusIndicatorColor
|
||||
@accentColor = systemColor(accent,@nsControlAccentColor)
|
||||
@accentFocusColor = if(systemColor(accent), fade(spin(systemColor(accent),4),50%), @nsKeyboardFocusIndicatorColor)
|
||||
|
||||
|
||||
#---- Button ----
|
||||
|
||||
@@ -44,6 +44,8 @@ import com.formdev.flatlaf.extras.FlatUIDefaultsInspector;
|
||||
import com.formdev.flatlaf.extras.components.FlatButton;
|
||||
import com.formdev.flatlaf.extras.components.FlatButton.ButtonType;
|
||||
import com.formdev.flatlaf.icons.FlatAbstractIcon;
|
||||
import com.formdev.flatlaf.themes.FlatMacDarkLaf;
|
||||
import com.formdev.flatlaf.themes.FlatMacLightLaf;
|
||||
import com.formdev.flatlaf.extras.FlatSVGUtils;
|
||||
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||
import com.formdev.flatlaf.ui.JBRCustomDecorations;
|
||||
@@ -455,7 +457,9 @@ class DemoFrame
|
||||
lafClass == FlatLightLaf.class ||
|
||||
lafClass == FlatDarkLaf.class ||
|
||||
lafClass == FlatIntelliJLaf.class ||
|
||||
lafClass == FlatDarculaLaf.class;
|
||||
lafClass == FlatDarculaLaf.class ||
|
||||
lafClass == FlatMacLightLaf.class ||
|
||||
lafClass == FlatMacDarkLaf.class;
|
||||
|
||||
accentColorLabel.setVisible( isAccentColorSupported );
|
||||
for( int i = 0; i < accentColorButtons.length; i++ )
|
||||
|
||||
Reference in New Issue
Block a user