You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by lk...@apache.org on 2020/01/01 08:17:43 UTC

[netbeans] 01/02: [NETBEANS-3644] Support to change Welcome Screen Top bar font color from LAF

This is an automated email from the ASF dual-hosted git repository.

lkishalmi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git

commit e7592f01f35a363b88f12efc076b136f44a17817
Author: Laszlo Kishalmi <la...@gmail.com>
AuthorDate: Fri Dec 27 16:58:09 2019 -0800

    [NETBEANS-3644] Support to change Welcome Screen Top bar font color from LAF
---
 nb/welcome/src/org/netbeans/modules/welcome/content/Constants.java | 1 +
 nb/welcome/src/org/netbeans/modules/welcome/content/Utils.java     | 7 +++++++
 .../src/org/netbeans/modules/welcome/resources/Bundle.properties   | 4 +---
 nb/welcome/src/org/netbeans/modules/welcome/ui/ContentHeader.java  | 2 +-
 nb/welcome/src/org/netbeans/modules/welcome/ui/ShowNextTime.java   | 2 +-
 nb/welcome/src/org/netbeans/modules/welcome/ui/TabbedPane.java     | 2 +-
 6 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/nb/welcome/src/org/netbeans/modules/welcome/content/Constants.java b/nb/welcome/src/org/netbeans/modules/welcome/content/Constants.java
index 53d8ad6..e1e4585 100644
--- a/nb/welcome/src/org/netbeans/modules/welcome/content/Constants.java
+++ b/nb/welcome/src/org/netbeans/modules/welcome/content/Constants.java
@@ -39,6 +39,7 @@ public interface Constants {
     static final String COLOR_TAB_BACKGROUND = "TabBackgroundColor"; //NOI18N
     static final String COLOR_TAB_BORDER1 = "TabBorder1Color"; //NOI18N
     static final String COLOR_TAB_BORDER2 = "TabBorder2Color"; //NOI18N
+    static final String COLOR_TAB_FOREGROUND = "TabForegroundColor"; //NOI18N
 
     static final String COLOR_RSS_DATE = "RssDateTimeColor"; //NOI18N
     static final String COLOR_RSS_DETAILS = "RssDetailsColor"; //NOI18N
diff --git a/nb/welcome/src/org/netbeans/modules/welcome/content/Utils.java b/nb/welcome/src/org/netbeans/modules/welcome/content/Utils.java
index cf13a54..743a450 100644
--- a/nb/welcome/src/org/netbeans/modules/welcome/content/Utils.java
+++ b/nb/welcome/src/org/netbeans/modules/welcome/content/Utils.java
@@ -146,6 +146,13 @@ public class Utils {
         return res;
     }
 
+    public static Color getTopBarForeground() {
+        Color res = UIManager.getColor("nb.startpage.topbar.foreground"); //NOI18N
+        if( null == res )
+            res = getColor( Constants.COLOR_TAB_BACKGROUND );
+        return res;
+    }
+
     public static Color getTopBarColor() {
         Color res = UIManager.getColor("nb.startpage.topbar.background"); //NOI18N
         if( null == res )
diff --git a/nb/welcome/src/org/netbeans/modules/welcome/resources/Bundle.properties b/nb/welcome/src/org/netbeans/modules/welcome/resources/Bundle.properties
index 0049517..362c818 100644
--- a/nb/welcome/src/org/netbeans/modules/welcome/resources/Bundle.properties
+++ b/nb/welcome/src/org/netbeans/modules/welcome/resources/Bundle.properties
@@ -144,9 +144,7 @@ LBL_ActivateFeaturesDescrFullIDE=<html>NetBeans turns on functionality as you us
 #NOI18N
 ScreenBackgroundColor=0xFFFFFF
 #NOI18N
-TabSelForegroundColor=0x1D2153
-#NOI18N
-TabUnselForegroundColor=0xFFFFFF
+TabForegroundColor=0xFFFFFF
 #NOI18N
 MouseOverTabColor=0xE5E5E5
 #NOI18N
diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/ContentHeader.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/ContentHeader.java
index be9ee8b..838f30d 100644
--- a/nb/welcome/src/org/netbeans/modules/welcome/ui/ContentHeader.java
+++ b/nb/welcome/src/org/netbeans/modules/welcome/ui/ContentHeader.java
@@ -67,7 +67,7 @@ public class ContentHeader extends JPanel implements Constants {
         setLayout( new BorderLayout() );
         lblTitle.setText( title );
         lblTitle.setFont( CONTENT_HEADER_FONT );
-        lblTitle.setForeground( Color.white );
+        lblTitle.setForeground( Utils.getTopBarForeground() );
         add( lblTitle, BorderLayout.WEST );
         setBorder( BorderFactory.createEmptyBorder( 12+18, 34, 15, 34 ) );
     }
diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/ShowNextTime.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/ShowNextTime.java
index 35cbf97..ea86890 100644
--- a/nb/welcome/src/org/netbeans/modules/welcome/ui/ShowNextTime.java
+++ b/nb/welcome/src/org/netbeans/modules/welcome/ui/ShowNextTime.java
@@ -50,7 +50,7 @@ class ShowNextTime extends JPanel
         button = new JCheckBox( BundleSupport.getLabel( "ShowOnStartup" ) ); // NOI18N
         button.setSelected( WelcomeOptions.getDefault().isShowOnStartup() );
         button.setOpaque( false );
-        button.setForeground( Color.white );
+        button.setForeground( Utils.getTopBarForeground() );
         button.setHorizontalTextPosition( SwingConstants.LEFT );
         BundleSupport.setAccessibilityProperties( button, "ShowOnStartup" ); //NOI18N
         add( button, BorderLayout.CENTER );
diff --git a/nb/welcome/src/org/netbeans/modules/welcome/ui/TabbedPane.java b/nb/welcome/src/org/netbeans/modules/welcome/ui/TabbedPane.java
index 4ebbfab..f1aab46 100644
--- a/nb/welcome/src/org/netbeans/modules/welcome/ui/TabbedPane.java
+++ b/nb/welcome/src/org/netbeans/modules/welcome/ui/TabbedPane.java
@@ -186,7 +186,7 @@ class TabbedPane extends JPanel implements Constants {// , Scrollable {
             this.tabIndex = tabIndex;
             setOpaque( true );
             lblTitle.setFont( TAB_FONT );
-            lblTitle.setForeground( Color.white );
+            lblTitle.setForeground( Utils.getTopBarForeground() );
             lblTitle.setHorizontalAlignment( JLabel.CENTER );
             setFocusable(true);
             setBackground( colBackground );


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists