1
1
/*
2
- * Copyright (c) 2011, 2012 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2011, 2021 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
38
38
39
39
import sun .swing .SwingUtilities2 ;
40
40
41
+ import apple .laf .JRSUIUtils ;
41
42
import apple .laf .JRSUIConstants .*;
42
43
43
44
public class AquaTabbedPaneContrastUI extends AquaTabbedPaneUI {
45
+ private static boolean isFrameActive = false ;
46
+
44
47
public static ComponentUI createUI (final JComponent c ) {
45
48
return new AquaTabbedPaneContrastUI ();
46
49
}
@@ -79,6 +82,8 @@ protected static Color getSelectedTabTitleColor(boolean enabled, boolean pressed
79
82
return UIManager .getColor ("TabbedPane.selectedTabTitlePressedColor" );
80
83
} else if (!enabled ) {
81
84
return UIManager .getColor ("TabbedPane.selectedTabTitleDisabledColor" );
85
+ } else if (!JRSUIUtils .isMacOSXBigSurOrAbove () && !isFrameActive ) {
86
+ return UIManager .getColor ("TabbedPane.selectedTabTitleNonFocusColor" );
82
87
} else {
83
88
return UIManager .getColor ("TabbedPane.selectedTabTitleNormalColor" );
84
89
}
@@ -101,6 +106,7 @@ protected boolean shouldRepaintSelectedTabOnMouseDown() {
101
106
}
102
107
103
108
protected State getState (final int index , final boolean frameActive , final boolean isSelected ) {
109
+ isFrameActive = frameActive ;;
104
110
if (!frameActive ) return State .INACTIVE ;
105
111
if (!tabPane .isEnabled ()) return State .DISABLED ;
106
112
if (pressedTab == index ) return State .PRESSED ;
0 commit comments