View Javadoc
1   package de.spiritscorp.datasync.theme;
2   
3   /*-
4    * 		Data Sync
5    *
6    * 		Copyright ©   2022    The Spirit
7    * 		@email                        thespirit@spiritscorp.network
8    *
9    * 		This program is free software; you can redistribute it and/or modify
10   * 		it under the terms of the GNU General Public License as published by
11   * 		the Free Software Foundation; either version 3 of the License, or
12   * 		(at your option) any later version.
13   *
14   * 		This program is distributed in the hope that it will be useful,
15   * 		but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * 		MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17   * 		See the GNU General Public License for more details.
18   *
19   * 		You should have received a copy of the GNU General Public License
20   * 		along with this program. If not, see <http://www.gnu.org/licenses/>.
21   */
22  
23  import javafx.scene.Scene;
24  
25  /**
26   * NordLightTheme provides a clean, modern light theme based on the Nord color palette.
27   */
28  public class NordicLightTheme implements AppTheme {
29  	@Override
30  	public void apply( Scene scene ) {
31  		scene.getRoot().setStyle( "-fx-font-size: 14; -fx-font-family: 'Comic Sans MS', 'Segoe UI'; -fx-background-color: #f4f6f9;" );
32  		final String css = """
33  				.list-view { -fx-background-color: #e5e9f0; }
34  				.list-cell { -fx-background-color: #e5e9f0; -fx-text-fill: #4c566a; -fx-padding: 12px; -fx-border-color: #d8dee9; -fx-border-width: 0 0 1px 0; }
35  				.list-cell:hover { -fx-background-color: #d8dee9; }
36  				.list-cell:selected { -fx-background-color: #88c0d0; -fx-text-fill: #2e3440; -fx-font-weight: bold; }
37  				.label { -fx-text-fill: #2e44a4 !important; }
38  				.button { -fx-background-color: #81a1c1; -fx-text-fill: white; -fx-background-radius: 4px; -fx-cursor: hand;}
39  				.button:hover { -fx-background-color: #5e81ac; }
40  				.text-field, .combo-box, .text-area { -fx-background-color: #ffffff; -fx-text-fill: #2e3440; -fx-border-color: #d8dee9; -fx-background-radius: 4px; -fx-border-radius: 4px; }
41  				.text-field:focused, .combo-box:focused, .text-area:focused { -fx-border-color: #3498db; }
42  				.combo-box:hover { -fx-border-color: #95a5a6; }
43  				.combo-box .list-cell { -fx-background-color: #ffffff; -fx-text-fill: #2e3440; }
44  				.combo-box .list-cell:selected { -fx-background-color: #88c0d0; -fx-text-fill: #2e3440; }
45  				.status-success { -fx-text-fill: #22aa22; -fx-font-weight: bold; }
46  				.status-error { -fx-text-fill: #ff3333; -fx-font-weight: bold; }
47  				.status-warning { -fx-text-fill: #ffaa00; -fx-font-weight: bold; }
48  
49  				/* Extended JavaFX Controls */
50  				.table-view { -fx-background-color: #ffffff; -fx-border-color: #d8dee9; }
51  				.table-view .column-header, .table-view .filler { -fx-background-color: #e5e9f0; -fx-border-color: #d8dee9; }
52  				.table-view .column-header .label { -fx-text-fill: #4c566a; }
53  				.table-row-cell { -fx-background-color: #ffffff; -fx-text-fill: #2e3440; }
54  				.table-row-cell:odd { -fx-background-color: #f8fafc; }
55  				.table-row-cell:selected { -fx-background-color: #88c0d0; }
56  
57  				.tab-pane .tab-header-area .tab-header-background { -fx-background-color: #e5e9f0; }
58  				.tab { -fx-background-color: #d8dee9; -fx-background-radius: 4px 4px 0 0; }
59  				.tab:selected { -fx-background-color: #81a1c1; }
60  				.tab:selected .tab-label { -fx-text-fill: #ffffff !important; }
61  				.tab .tab-label { -fx-text-fill: #4c566a; }
62  
63  				.progress-bar .track { -fx-background-color: #e5e9f0; -fx-background-radius: 4px; }
64  				.progress-bar .bar { -fx-background-color: #81a1c1; -fx-background-radius: 4px; }
65  				.dialog-pane { -fx-background-color: #ffffff; }
66  				.check-box .box { -fx-background-color: #ffffff; -fx-border-color: #d8dee9; -fx-background-radius: 3px; }
67  				.check-box:selected .mark { -fx-background-color: #81a1c1; }
68  				""";
69  		scene.getStylesheets().clear();
70  		scene.getStylesheets().add( "data:text/css," + css.replace( "\n", "" ).replace( " ", "%20" ) );
71  	}
72  
73  	@Override
74  	public String getName() { return "Nordic Light"; }
75  
76  	@Override
77  	public String toString() {
78  		return getName();
79  	}
80  }