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   * DarkSlateTheme provides a professional dark mode interface using slate and deep blue tones.
27   */
28  public class DarkSlateTheme implements AppTheme {
29  	@Override
30  	public void apply( final Scene scene ) {
31  		scene.getRoot().setStyle( "-fx-font-size: 14; -fx-font-family: 'Comic Sans MS', 'Segoe UI'; -fx-background-color: #2c3e50; -fx-text-fill: #b9c0c7;" );
32  		final String css = """
33  				/* Extended JavaFX Controls */
34  				.tooltip { -fx-background-color: black !important; -fx-text-fill: #b9c0c7 !important; -fx-font-weight: normal !important; }
35  				.label { -fx-text-fill: #b9c0c7; }
36  				.button { -fx-background-color: #34495e; -fx-text-fill: #b9c0c7; -fx-border-color: #3498db; -fx-background-radius: 12px; -fx-border-radius: 12px; -fx-cursor: hand; -fx-padding: 8px 16px; }
37  				.button:hover { -fx-background-color: #415b76; -fx-border-color: #3498db; }
38  
39  				/* List View */
40  				.list-view { -fx-background-color: #2c3e50 !important; -fx-border-color: #506880; -fx-border-width: 1px;}
41  				.list-cell { -fx-background-color: #2c3e50; -fx-text-fill: #b9c0c7; -fx-padding: 12px; -fx-border-color: #506880; -fx-border-width: 0 0 1px 0; -fx-cursor: hand;}
42  				.list-cell:hover { -fx-background-color: #34495e; }
43  				.list-cell:selected { -fx-background-color: #3498db; -fx-text-fill: #b9c0c7;  -fx-font-weight: bold; }
44  
45  				/* Form Inputs & Dropdowns */
46  				.text-field, .text-area { -fx-background-color: #b9c0c7; -fx-text-fill: #2c3e50; -fx-border-color: #bdc3c7;  -fx-border-width: 1px; -fx-background-radius: 10px; -fx-border-radius: 10px; }
47  				.text-field:focused, .combo-box:focused, .text-area:focused { -fx-border-color: #3498db; }
48  				.text-area, .text-area .content { -fx-background-color: #2c3e50; -fx-text-fill: #b9c0c7 !important; }
49  
50  				/* Dropdown Menu Button */
51  				 .menu-button, .menu-item { -fx-background-color: #415b75 !important; -fx-text-fill: #b9c0c7 !important; -fx-border-color: #2c3e50; -fx-background-radius: 16px; -fx-border-radius: 16px; }
52  				.menu-button .label { -fx-text-fill: #b9c0c7 !important; }
53  				.menu-button:hover { -fx-background-color: #506f8f !important;  -fx-border-color: #3498db; -fx-cursor: hand; }
54  				.menu-button:hover .label { -fx-text-fill: #b9c0c7; }
55  
56  				/* Context Menu */
57  				.context-menu { -fx-background-color: #b9c0c7 !important; -fx-border-color: #bdc3c7 !important; -fx-border-width: 1px; -fx-padding: 5px; -fx-background-radius: 10px; -fx-border-radius: 10px; }
58  				.context-menu .menu-item { -fx-background-color: #b9c0c7 !important;  -fx-background-radius: 16px; -fx-border-radius: 16px;}
59  				.context-menu .menu-item .label { -fx-text-fill: #2c3e50 !important; }
60  				.context-menu .menu-item:focused, .context-menu .menu-item:hover { -fx-background-color: #3498db !important; }
61  				.context-menu .menu-item:focused .label, .context-menu .menu-item:hover .label { -fx-text-fill: #b9c0c7 !important; -fx-cursor: hand; }
62  				.context-menu .separator .line { -fx-border-color: #9da3a7 !important; }
63  
64  				/* Table View */
65  				.table-view { -fx-background-color: #2c3e50; -fx-border-color: black; -fx-border-width: 1px; }
66  				.table-view .column-header, .table-view .filler { -fx-background-color: #2c3e50; -fx-border-color: #3498db; }
67  				.table-view .column-header .label { -fx-text-fill: #b9c0c7 !important; -fx-font-weight: bold; }
68  				.table-row-cell { -fx-background-color: #ffffff; -fx-text-fill: #2c3e50; -fx-border-color: #e2e6ea; -fx-border-width: 0 0 1px 0; }
69  				.table-row-cell:odd { -fx-background-color: #f4f6f9; }
70  				.table-row-cell:selected { -fx-background-color: #2980b9; -fx-text-fill: #b9c0c7 !important; }
71  				.table-row-cell:selected .text { -fx-fill: #ffffff !important; }
72  
73  				/* Scroll Pane */
74  				.scroll-pane { -fx-background-color: #2c3e50; -fx-background: #f4f6f9 !important; -fx-text-fill: #b9c0c7; -fx-border-color: #bdc3c7 !important; -fx-border-width: 1px !important; }
75  				.scroll-pane .viewport{ -fx-background-color: #2c3e50; -fx-background: #f4f6f9 !important; -fx-text-fill: #b9c0c7; }
76  				.scroll-pane .label { -fx-text-fill: #b9c0c7 !important; }
77  				.scroll-pane .scroll-bar:vertical, .scroll-pane .scroll-bar:horizontal { -fx-background-color: #e2e6ea !important; }
78  				.scroll-pane .scroll-bar .thumb { -fx-background-color: #bdc3c7 !important; -fx-border-color: #95a5a6 !important; -fx-background-radius: 4px !important; }
79  
80  				/* Progress Bar */
81  				.progress-bar .track { -fx-background-color: #e2e6ea; -fx-border-color: #bdc3c7; -fx-border-width: 1px; -fx-background-radius: 4px; }
82  				.progress-bar .bar { -fx-background-color: #3498db !important; -fx-background-radius: 4px; -fx-background-insets: 0; }
83  
84  				/* Dialog */
85  				.dialog-pane { -fx-background-color: #2c3e50; -fx-border-color: #bdc3c7; -fx-border-width: 1px; }
86  				.dialog-pane .header-panel { -fx-background-color: #2c3e50; -fx-border-color: transparent; }
87  				.dialog-pane .content-panel, .dialog-pane .button-bar { -fx-background-color: #2c3e50; }
88  				.dialog-pane .label, .dialog-custom-icon {  -fx-text-fill: #b9c0c7; -fx-fill: #b9c0c7; }
89  				.dialog-pane .button { -fx-background-color: #34495e; -fx-text-fill: #b9c0c7; -fx-border-color: #2c3e50; }
90  				.dialog-pane .button:hover { -fx-background-color: #3498db; -fx-text-fill: #b9c0c7; }
91  
92  				/* Combo Box */
93  				.combo-box { -fx-background-color: #2488cb; -fx-border-color: #3498db; -fx-text-fill: #b9c0c7 !important;  -fx-background-radius: 10px; -fx-border-radius: 10px; -fx-cursor: hand; }
94  				.combo-box:hover { -fx-border-color: #000000; }
95  				.combo-box .list-cell { -fx-background-color: #b9c0c7 !important; -fx-text-fill: #2c3e50 !important; -fx-border-width: 0; -fx-background-radius: 10px; -fx-border-radius: 10px; -fx-cursor: hand; }
96  				.combo-box .list-cell:hover, .combo-box .list-cell:selected { -fx-background-color: #3498db !important; -fx-text-fill: #b9c0c7 !important; }
97  
98  				/* Check Box */
99  				.check-box .box { -fx-background-color: #b9c0c7; -fx-border-color: #f4f6f9; -fx-border-width: 1px; -fx-background-radius: 7px; -fx-border-radius: 7px; -fx-cursor: hand;  }
100 				.check-box:hover .box { -fx-border-color: #3498db; }
101 				.check-box .text { -fx-fill: #b9c0c7 !important; -fx-cursor: hand; }
102 				.check-box:selected .mark { -fx-background-color: #3498db; }
103 
104 				/* Icons */
105 				.menu-icon { -fx-icon-color: black; }
106 				.job-icon { -fx-icon-color: #3498db; }
107 				.button-icon { -fx-icon-color: white; }
108 
109 				/* Sidebar View */
110 				.sidebar-title-label { -fx-font-size: 11px; -fx-font-weight: bold; }
111 				.drag-over-target { -fx-border-color: #2ecc71 transparent transparent transparent; -fx-border-width: 3px 0 0 0; }
112 				.add-job-button { -fx-background-color: #2ecc71; -fx-text-fill: white; -fx-font-weight: bold; -fx-padding: 11px; }
113 				.exit-button { -fx-background-color: #e74c3c; -fx-text-fill: white; -fx-font-weight: bold; -fx-padding: 11px; }
114 
115 				/* Workspace View */
116 				.console-text-area { -fx-font-family: 'Consolas', monospace; -fx-font-size: 12px; }
117 				.workspace-header-label { -fx-font-size: 22px; -fx-font-weight: bold; }
118 				.context-info-label { -fx-font-size: 15px; -fx-font-style: italic; -fx-padding: 0 0 8px 0; }
119 				.action-button { -fx-background-color: #2ecc71; -fx-text-fill: white; -fx-font-weight: bold; -fx-padding: 10px 20px; }
120 				.cancel-button { -fx-background-color: #95a5a6; -fx-text-fill: white; -fx-font-weight: bold; -fx-padding: 10px 20px; }
121 
122 				/* Duplicate Button */
123 				.delete-button { -fx-background-color: #e74c3c; -fx-text-fill: white; }
124 
125 				/* Config Menu */
126 				.settings-grid { -fx-background-color: #2c3e50; }
127 				.mode-label { -fx-font-weight: bold; }
128 				.params-title-label { -fx-font-size: 14px; -fx-font-weight: bold; }
129 				.global-title-label { -fx-font-size: 14px; -fx-font-weight: bold; }
130 				.save-button { -fx-background-color: #2ecc71; -fx-text-fill: white; -fx-font-weight: bold; -fx-padding: 10px 24px; }
131 
132 				/* Directory rendering */
133 				.dir-title-label { -fx-font-size: 14px; -fx-font-weight: bold; }
134 				.multi-src-label { -fx-font-weight: bold; }
135 
136 				/*Special button hover */
137 				.cancel-button:hover { -fx-background-color: #7f8c8d;  -fx-text-fill: #d6e0fa;  -fx-icon-color: #d6e0fa; }
138 				.action-button:hover, .save-button:hover, .add-job-button:hover { -fx-background-color: #1abc9c; -fx-text-fill: #d6e0fa; -fx-icon-color: #d6e0fa; }
139 				.delete-button:hover, .exit-button:hover { -fx-background-color: #c0392b; -fx-text-fill: #d6e0fa; -fx-icon-color: #d6e0fa; }
140 
141 				/* Info View */
142 				.info-box { -fx-background-color: #2c3e50; -fx-padding: 15px; }
143 				.app-title-label { -fx-font-size: 18px; -fx-font-weight: bold; }
144 				.legal-text { -fx-font-family: monospace; }
145 
146 				/* Status messages */
147 				.status-success { -fx-text-fill: #27ae60; -fx-font-weight: bold; }
148 				.status-error   { -fx-text-fill: #c0392b; -fx-font-weight: bold; }
149 				.status-warning { -fx-text-fill: #f39c12; -fx-font-weight: bold; }
150 				""";
151 
152 		scene.getStylesheets().clear();
153 		scene.getStylesheets().add( "data:text/css," + css.replace( "\n", "" ).replace( " ", "%20" ) );
154 	}
155 
156 	@Override
157 	public String toString() {
158 		return getName();
159 	}
160 
161 	@Override
162 	public String getName() { return "Dark Slate"; }
163 }