├── .editorconfig
├── .gitignore
├── CHANGELOG.md
├── FluentLib
├── .gitignore
├── FluentLib.sln
├── FluentLib.vcxproj
├── FluentLib.vcxproj.filters
├── dllmain.cpp
├── framework.h
├── pch.cpp
└── pch.h
├── LICENSE
├── README.md
├── build.gradle.kts
├── demo
├── build.gradle.kts
└── src
│ └── main
│ ├── kotlin
│ ├── Main.kt
│ ├── MainActivity.kt
│ ├── controllers
│ │ └── Fragments.kt
│ ├── fragments
│ │ ├── ComboBoxFragment.kt
│ │ ├── DialogFragment.kt
│ │ ├── HeaderBarFragment.kt
│ │ ├── HomeFragment.kt
│ │ ├── InfoBarFragment.kt
│ │ ├── ProgressBarFragment.kt
│ │ ├── SystemBackdropFragment.kt
│ │ └── TableViewFragment.kt
│ └── views
│ │ ├── FluentPasswordField.kt
│ │ └── Sidebar.kt
│ └── resources
│ ├── GalleryHeaderImage.png
│ ├── MainActivity.fxml
│ ├── assets
│ ├── Acrylic.png
│ ├── Header-WindowsDesign.png
│ ├── Slices.png
│ ├── TitleBar.png
│ ├── github-mark.png
│ └── lantern-3713486_1280.jpg
│ ├── dialogs
│ ├── Dialog.fxml
│ └── FullDialog.fxml
│ ├── fragments
│ ├── ButtonFragment.fxml
│ ├── CheckBoxFragment.fxml
│ ├── ComboBoxFragment.fxml
│ ├── DatePickerFragment.fxml
│ ├── DialogFragment.fxml
│ ├── HeaderBarFragment.fxml
│ ├── HomeFragment.fxml
│ ├── HyperlinkFragment.fxml
│ ├── InfoBarFragment.fxml
│ ├── LabelFragment.fxml
│ ├── ListViewFragment.fxml
│ ├── MenuBarFragment.fxml
│ ├── MenuButtonFragment.fxml
│ ├── PasswordFieldFragment.fxml
│ ├── ProgressBarFragment.fxml
│ ├── RadioButtonFragment.fxml
│ ├── ScrollViewFragment.fxml
│ ├── SettingsFragment.fxml
│ ├── SliderFragment.fxml
│ ├── SpinnerFragment.fxml
│ ├── SystemBackdropFragment.fxml
│ ├── TableViewFragment.fxml
│ ├── TextAreaFragment.fxml
│ ├── ToggleButtonFragment.fxml
│ ├── TooltipFragment.fxml
│ ├── TreeViewFragment.fxml
│ └── TypographyFragment.fxml
│ ├── strings.properties
│ ├── style.css
│ └── views
│ ├── SidebarItem.fxml
│ └── SidebarSeparator.fxml
├── docs
├── Demo.png
├── ExampleApp1.png
├── ExampleApp2.png
├── Gallery.png
└── HeaderBarMica.png
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle.kts
└── theme
├── build.gradle.kts
└── src
└── main
├── css
├── _buttons.scss
├── _checkbox.scss
├── _combo-box.scss
├── _context-menu.scss
├── _date-picker.scss
├── _dialog.scss
├── _header-bar.scss
├── _hyperlink.scss
├── _info-bar.scss
├── _list-view.scss
├── _menu-bar.scss
├── _progress-bar.scss
├── _radio-button.scss
├── _scroll-bar.scss
├── _separator.scss
├── _slider.scss
├── _spinner.scss
├── _table-view.scss
├── _text.scss
├── _titled-pane.scss
├── _tooltip.scss
├── _tree-view.scss
├── _typography.scss
└── fluent-light.scss
├── kotlin
└── earth
│ └── groundctrl
│ └── fluent
│ ├── FluentApp.kt
│ ├── lib
│ └── Windows.kt
│ ├── ui
│ └── Animation.kt
│ └── views
│ ├── FluentComboBox.kt
│ ├── FluentListView.kt
│ ├── FluentSlider.kt
│ ├── FluentSpinner.kt
│ ├── FluentTooltip.kt
│ ├── HeaderBar.kt
│ └── InfoBar.kt
└── resources
├── earth
└── groundctrl
│ └── fluent
│ └── views
│ └── InfoBar.fxml
└── fluent-light.css
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | max_line_length = 99
5 | insert_final_newline = true
6 | trim_trailing_whitespace = true
7 |
8 | [*.{kt,kts}]
9 | max_line_length = 120
10 | indent_style = space
11 | indent_size = 4
12 |
13 | [*.{html,xml,fxml,ui}]
14 | max_line_length = off
15 | indent_style = tab
16 | indent_size = 3
17 |
18 | [*.{css,scss}]
19 | indent_style = tab
20 | indent_size = 2
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | demo/*.dll
2 |
3 | .gradle
4 | build/
5 | !gradle/wrapper/gradle-wrapper.jar
6 | !**/src/main/**/build/
7 | !**/src/test/**/build/
8 |
9 | ### IntelliJ IDEA ###
10 | .idea/modules.xml
11 | .idea/jarRepositories.xml
12 | .idea/compiler.xml
13 | .idea/libraries/
14 | *.iws
15 | *.iml
16 | *.ipr
17 | out/
18 | !**/src/main/**/out/
19 | !**/src/test/**/out/
20 |
21 | ### Eclipse ###
22 | .apt_generated
23 | .classpath
24 | .factorypath
25 | .project
26 | .settings
27 | .springBeans
28 | .sts4-cache
29 | bin/
30 | !**/src/main/**/bin/
31 | !**/src/test/**/bin/
32 |
33 | ### NetBeans ###
34 | /nbproject/private/
35 | /nbbuild/
36 | /dist/
37 | /nbdist/
38 | /.nb-gradle/
39 |
40 | ### VS Code ###
41 | .vscode/
42 |
43 | ### Mac OS ###
44 | .DS_Store
45 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6 |
7 | ## [v2024.12b] - 2024-12-20 (WIP)
8 |
9 | ### Added
10 |
11 | - Added `buildnumber` to Windows API functions
12 | - Added `onStageCreated` callback for `FluentApp`. Use this for anything that should run after FluentApp's built-in `stage.show()` call.
13 | - Added fluent styling for `TreeView`, `ListView`, and `TableView`
14 | - Added optional `FluentListView` styling with fluent animations
15 | - Added a custom control for WinUI's InfoBar: `InfoBar`
16 | - Added fluent styling for `Dialog`
17 | - Fixed some style issues for `Spinner`
18 | - Updated `ComboBox`/`ChoiceBox` sample
19 | - Added optional `FluentComboBox` styling with fluent animations
20 |
21 | ### Changed
22 |
23 | - Changed the `FluentApp` constructor to zero arguments. Initial Mica and HeaderBar flags are set via static fields.
24 | - Updated and built with JDK 22, JavaFX 23
25 | - GPU check doesn't use `wmic` anymore (because it's been deprecated?)
26 |
27 | ### Removed
28 |
29 | - Removed the current TitledPane skin because it looks a little awkward. Will be replaced by a proper `Expander` control in the future.
30 |
31 | ### Fixed
32 |
33 | - Fixed exception in Slider skin
34 | - Fixed hover styling of CheckBox (if it was also focused)
35 | - Updated styling of RadioButtons (WinUI's have a darker background)
36 | - Fixed several code examples in the demo application
37 | - Fixed bug in GPU check that prevented the demo from starting
38 |
39 | ## [v2024.05] - 2024-04-05
40 |
41 | ### Added
42 |
43 | - Added `FluentApp.initialize()` which takes care of setting up the necessary environment prior to showing a JavaFX stage.
44 |
45 | ## [v2024.04] - 2024-04-05
46 |
47 | ### Removed
48 |
49 | - `FluentApp` constructor does not take `initialTitle` parameter anywhere. Instead, make sure to set some kind of title in `onCreateStage` if you use any `useMica:` or `useHeaderBar:` parameter.
50 |
51 | ### Changed
52 |
53 | - Source files have been organized into a package hierarchy to accommodate Java projects. The import prefix is `earth.groundctrl.fluent`.
54 |
55 | - The Mica workaround for non-AMD GPUs is no longer automatically tested in `FluentApp.onCreateStage`. You can use `Windows.isAmdGpu` to do this check manually. The idea behind this change is to be able to set the required system properties in Java's `main` function, i.e. before the JavaFX runtime is initialized.
56 |
57 | ### Fixed
58 |
59 | - Fixed "Determinate ProgressBar" sample in demo app.
60 |
61 | ## [v2023.09] - 2023-09-15
62 |
63 | First published version.
64 |
--------------------------------------------------------------------------------
/FluentLib/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Ll]og/
33 | [Ll]ogs/
34 |
35 | # Visual Studio 2015/2017 cache/options directory
36 | .vs/
37 | # Uncomment if you have tasks that create the project's static files in wwwroot
38 | #wwwroot/
39 |
40 | # Visual Studio 2017 auto generated files
41 | Generated\ Files/
42 |
43 | # MSTest test Results
44 | [Tt]est[Rr]esult*/
45 | [Bb]uild[Ll]og.*
46 |
47 | # NUnit
48 | *.VisualState.xml
49 | TestResult.xml
50 | nunit-*.xml
51 |
52 | # Build Results of an ATL Project
53 | [Dd]ebugPS/
54 | [Rr]eleasePS/
55 | dlldata.c
56 |
57 | # Benchmark Results
58 | BenchmarkDotNet.Artifacts/
59 |
60 | # .NET Core
61 | project.lock.json
62 | project.fragment.lock.json
63 | artifacts/
64 |
65 | # ASP.NET Scaffolding
66 | ScaffoldingReadMe.txt
67 |
68 | # StyleCop
69 | StyleCopReport.xml
70 |
71 | # Files built by Visual Studio
72 | *_i.c
73 | *_p.c
74 | *_h.h
75 | *.ilk
76 | *.meta
77 | *.obj
78 | *.iobj
79 | *.pch
80 | *.pdb
81 | *.ipdb
82 | *.pgc
83 | *.pgd
84 | *.rsp
85 | *.sbr
86 | *.tlb
87 | *.tli
88 | *.tlh
89 | *.tmp
90 | *.tmp_proj
91 | *_wpftmp.csproj
92 | *.log
93 | *.tlog
94 | *.vspscc
95 | *.vssscc
96 | .builds
97 | *.pidb
98 | *.svclog
99 | *.scc
100 |
101 | # Chutzpah Test files
102 | _Chutzpah*
103 |
104 | # Visual C++ cache files
105 | ipch/
106 | *.aps
107 | *.ncb
108 | *.opendb
109 | *.opensdf
110 | *.sdf
111 | *.cachefile
112 | *.VC.db
113 | *.VC.VC.opendb
114 |
115 | # Visual Studio profiler
116 | *.psess
117 | *.vsp
118 | *.vspx
119 | *.sap
120 |
121 | # Visual Studio Trace Files
122 | *.e2e
123 |
124 | # TFS 2012 Local Workspace
125 | $tf/
126 |
127 | # Guidance Automation Toolkit
128 | *.gpState
129 |
130 | # ReSharper is a .NET coding add-in
131 | _ReSharper*/
132 | *.[Rr]e[Ss]harper
133 | *.DotSettings.user
134 |
135 | # TeamCity is a build add-in
136 | _TeamCity*
137 |
138 | # DotCover is a Code Coverage Tool
139 | *.dotCover
140 |
141 | # AxoCover is a Code Coverage Tool
142 | .axoCover/*
143 | !.axoCover/settings.json
144 |
145 | # Coverlet is a free, cross platform Code Coverage Tool
146 | coverage*.json
147 | coverage*.xml
148 | coverage*.info
149 |
150 | # Visual Studio code coverage results
151 | *.coverage
152 | *.coveragexml
153 |
154 | # NCrunch
155 | _NCrunch_*
156 | .*crunch*.local.xml
157 | nCrunchTemp_*
158 |
159 | # MightyMoose
160 | *.mm.*
161 | AutoTest.Net/
162 |
163 | # Web workbench (sass)
164 | .sass-cache/
165 |
166 | # Installshield output folder
167 | [Ee]xpress/
168 |
169 | # DocProject is a documentation generator add-in
170 | DocProject/buildhelp/
171 | DocProject/Help/*.HxT
172 | DocProject/Help/*.HxC
173 | DocProject/Help/*.hhc
174 | DocProject/Help/*.hhk
175 | DocProject/Help/*.hhp
176 | DocProject/Help/Html2
177 | DocProject/Help/html
178 |
179 | # Click-Once directory
180 | publish/
181 |
182 | # Publish Web Output
183 | *.[Pp]ublish.xml
184 | *.azurePubxml
185 | # Note: Comment the next line if you want to checkin your web deploy settings,
186 | # but database connection strings (with potential passwords) will be unencrypted
187 | *.pubxml
188 | *.publishproj
189 |
190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
191 | # checkin your Azure Web App publish settings, but sensitive information contained
192 | # in these scripts will be unencrypted
193 | PublishScripts/
194 |
195 | # NuGet Packages
196 | *.nupkg
197 | # NuGet Symbol Packages
198 | *.snupkg
199 | # The packages folder can be ignored because of Package Restore
200 | **/[Pp]ackages/*
201 | # except build/, which is used as an MSBuild target.
202 | !**/[Pp]ackages/build/
203 | # Uncomment if necessary however generally it will be regenerated when needed
204 | #!**/[Pp]ackages/repositories.config
205 | # NuGet v3's project.json files produces more ignorable files
206 | *.nuget.props
207 | *.nuget.targets
208 |
209 | # Microsoft Azure Build Output
210 | csx/
211 | *.build.csdef
212 |
213 | # Microsoft Azure Emulator
214 | ecf/
215 | rcf/
216 |
217 | # Windows Store app package directories and files
218 | AppPackages/
219 | BundleArtifacts/
220 | Package.StoreAssociation.xml
221 | _pkginfo.txt
222 | *.appx
223 | *.appxbundle
224 | *.appxupload
225 |
226 | # Visual Studio cache files
227 | # files ending in .cache can be ignored
228 | *.[Cc]ache
229 | # but keep track of directories ending in .cache
230 | !?*.[Cc]ache/
231 |
232 | # Others
233 | ClientBin/
234 | ~$*
235 | *~
236 | *.dbmdl
237 | *.dbproj.schemaview
238 | *.jfm
239 | *.pfx
240 | *.publishsettings
241 | orleans.codegen.cs
242 |
243 | # Including strong name files can present a security risk
244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
245 | #*.snk
246 |
247 | # Since there are multiple workflows, uncomment next line to ignore bower_components
248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
249 | #bower_components/
250 |
251 | # RIA/Silverlight projects
252 | Generated_Code/
253 |
254 | # Backup & report files from converting an old project file
255 | # to a newer Visual Studio version. Backup files are not needed,
256 | # because we have git ;-)
257 | _UpgradeReport_Files/
258 | Backup*/
259 | UpgradeLog*.XML
260 | UpgradeLog*.htm
261 | ServiceFabricBackup/
262 | *.rptproj.bak
263 |
264 | # SQL Server files
265 | *.mdf
266 | *.ldf
267 | *.ndf
268 |
269 | # Business Intelligence projects
270 | *.rdl.data
271 | *.bim.layout
272 | *.bim_*.settings
273 | *.rptproj.rsuser
274 | *- [Bb]ackup.rdl
275 | *- [Bb]ackup ([0-9]).rdl
276 | *- [Bb]ackup ([0-9][0-9]).rdl
277 |
278 | # Microsoft Fakes
279 | FakesAssemblies/
280 |
281 | # GhostDoc plugin setting file
282 | *.GhostDoc.xml
283 |
284 | # Node.js Tools for Visual Studio
285 | .ntvs_analysis.dat
286 | node_modules/
287 |
288 | # Visual Studio 6 build log
289 | *.plg
290 |
291 | # Visual Studio 6 workspace options file
292 | *.opt
293 |
294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
295 | *.vbw
296 |
297 | # Visual Studio 6 auto-generated project file (contains which files were open etc.)
298 | *.vbp
299 |
300 | # Visual Studio 6 workspace and project file (working project files containing files to include in project)
301 | *.dsw
302 | *.dsp
303 |
304 | # Visual Studio 6 technical files
305 | *.ncb
306 | *.aps
307 |
308 | # Visual Studio LightSwitch build output
309 | **/*.HTMLClient/GeneratedArtifacts
310 | **/*.DesktopClient/GeneratedArtifacts
311 | **/*.DesktopClient/ModelManifest.xml
312 | **/*.Server/GeneratedArtifacts
313 | **/*.Server/ModelManifest.xml
314 | _Pvt_Extensions
315 |
316 | # Paket dependency manager
317 | .paket/paket.exe
318 | paket-files/
319 |
320 | # FAKE - F# Make
321 | .fake/
322 |
323 | # CodeRush personal settings
324 | .cr/personal
325 |
326 | # Python Tools for Visual Studio (PTVS)
327 | __pycache__/
328 | *.pyc
329 |
330 | # Cake - Uncomment if you are using it
331 | # tools/**
332 | # !tools/packages.config
333 |
334 | # Tabs Studio
335 | *.tss
336 |
337 | # Telerik's JustMock configuration file
338 | *.jmconfig
339 |
340 | # BizTalk build output
341 | *.btp.cs
342 | *.btm.cs
343 | *.odx.cs
344 | *.xsd.cs
345 |
346 | # OpenCover UI analysis results
347 | OpenCover/
348 |
349 | # Azure Stream Analytics local run output
350 | ASALocalRun/
351 |
352 | # MSBuild Binary and Structured Log
353 | *.binlog
354 |
355 | # NVidia Nsight GPU debugger configuration file
356 | *.nvuser
357 |
358 | # MFractors (Xamarin productivity tool) working folder
359 | .mfractor/
360 |
361 | # Local History for Visual Studio
362 | .localhistory/
363 |
364 | # Visual Studio History (VSHistory) files
365 | .vshistory/
366 |
367 | # BeatPulse healthcheck temp database
368 | healthchecksdb
369 |
370 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
371 | MigrationBackup/
372 |
373 | # Ionide (cross platform F# VS Code tools) working folder
374 | .ionide/
375 |
376 | # Fody - auto-generated XML schema
377 | FodyWeavers.xsd
378 |
379 | # VS Code files for those working on multiple tools
380 | .vscode/*
381 | !.vscode/settings.json
382 | !.vscode/tasks.json
383 | !.vscode/launch.json
384 | !.vscode/extensions.json
385 | *.code-workspace
386 |
387 | # Local History for Visual Studio Code
388 | .history/
389 |
390 | # Windows Installer files from build outputs
391 | *.cab
392 | *.msi
393 | *.msix
394 | *.msm
395 | *.msp
396 |
397 | # JetBrains Rider
398 | *.sln.iml
399 |
400 |
--------------------------------------------------------------------------------
/FluentLib/FluentLib.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.7.34024.191
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FluentLib", "FluentLib.vcxproj", "{CEB37A2A-2E95-4485-88FA-A25A2AE15767}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x64 = Debug|x64
11 | Debug|x86 = Debug|x86
12 | Release|x64 = Release|x64
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {CEB37A2A-2E95-4485-88FA-A25A2AE15767}.Debug|x64.ActiveCfg = Debug|x64
17 | {CEB37A2A-2E95-4485-88FA-A25A2AE15767}.Debug|x64.Build.0 = Debug|x64
18 | {CEB37A2A-2E95-4485-88FA-A25A2AE15767}.Debug|x86.ActiveCfg = Debug|Win32
19 | {CEB37A2A-2E95-4485-88FA-A25A2AE15767}.Debug|x86.Build.0 = Debug|Win32
20 | {CEB37A2A-2E95-4485-88FA-A25A2AE15767}.Release|x64.ActiveCfg = Release|x64
21 | {CEB37A2A-2E95-4485-88FA-A25A2AE15767}.Release|x64.Build.0 = Release|x64
22 | {CEB37A2A-2E95-4485-88FA-A25A2AE15767}.Release|x86.ActiveCfg = Release|Win32
23 | {CEB37A2A-2E95-4485-88FA-A25A2AE15767}.Release|x86.Build.0 = Release|Win32
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {47152299-D079-4976-8428-170B12C8FB8A}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/FluentLib/FluentLib.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 | Debug
14 | x64
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 | 17.0
23 | Win32Proj
24 | {ceb37a2a-2e95-4485-88fa-a25a2ae15767}
25 | FluentLib
26 | 10.0
27 |
28 |
29 |
30 | DynamicLibrary
31 | true
32 | v143
33 | Unicode
34 |
35 |
36 | DynamicLibrary
37 | false
38 | v143
39 | true
40 | Unicode
41 |
42 |
43 | DynamicLibrary
44 | true
45 | v143
46 | NotSet
47 |
48 |
49 | DynamicLibrary
50 | false
51 | v143
52 | true
53 | NotSet
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | Level3
76 | true
77 | WIN32;_DEBUG;FLUENTLIB_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
78 | true
79 | Use
80 | pch.h
81 |
82 |
83 | Windows
84 | true
85 | false
86 |
87 |
88 |
89 |
90 | Level3
91 | true
92 | true
93 | true
94 | WIN32;NDEBUG;FLUENTLIB_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
95 | true
96 | Use
97 | pch.h
98 |
99 |
100 | Windows
101 | true
102 | true
103 | true
104 | false
105 |
106 |
107 |
108 |
109 | Level3
110 | true
111 | _DEBUG;FLUENTLIB_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
112 | true
113 | Use
114 | pch.h
115 | C:\Users\Eroica\.jdks\jdk-20.0.2\include;C:\Users\Eroica\.jdks\jdk-20.0.2\include\win32;%(AdditionalIncludeDirectories)
116 |
117 |
118 | Windows
119 | true
120 | false
121 |
122 |
123 |
124 |
125 | Level3
126 | true
127 | true
128 | true
129 | NDEBUG;FLUENTLIB_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)
130 | true
131 | Use
132 | pch.h
133 | C:\Users\Eroica\.jdks\corretto-22.0.2\include;C:\Users\Eroica\.jdks\corretto-22.0.2\include\win32;%(AdditionalIncludeDirectories)
134 |
135 |
136 | Windows
137 | true
138 | true
139 | true
140 | false
141 | dwmapi.lib;%(AdditionalDependencies)
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 | Create
152 | Create
153 | Create
154 | Create
155 |
156 |
157 |
158 |
159 |
160 |
--------------------------------------------------------------------------------
/FluentLib/FluentLib.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Header Files
20 |
21 |
22 | Header Files
23 |
24 |
25 |
26 |
27 | Source Files
28 |
29 |
30 | Source Files
31 |
32 |
33 |
--------------------------------------------------------------------------------
/FluentLib/framework.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
4 | // Windows Header Files
5 | #include
6 |
--------------------------------------------------------------------------------
/FluentLib/pch.cpp:
--------------------------------------------------------------------------------
1 | // pch.cpp: source file corresponding to the pre-compiled header
2 |
3 | #include "pch.h"
4 |
5 | // When you are using pre-compiled headers, this source file is necessary for compilation to succeed.
6 |
--------------------------------------------------------------------------------
/FluentLib/pch.h:
--------------------------------------------------------------------------------
1 | // pch.h: This is a precompiled header file.
2 | // Files listed below are compiled only once, improving build performance for future builds.
3 | // This also affects IntelliSense performance, including code completion and many code browsing features.
4 | // However, files listed here are ALL re-compiled if any one of them is updated between builds.
5 | // Do not add files here that you will be updating frequently as this negates the performance advantage.
6 |
7 | #ifndef PCH_H
8 | #define PCH_H
9 |
10 | // add headers that you want to pre-compile here
11 | #include "framework.h"
12 |
13 | #endif //PCH_H
14 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2023-2025 Eroica
2 |
3 | This software is provided 'as-is', without any express or implied
4 | warranty. In no event will the authors be held liable for any damages
5 | arising from the use of this software.
6 |
7 | Permission is granted to anyone to use this software for any purpose,
8 | including commercial applications, and to alter it and redistribute it
9 | freely, subject to the following restrictions:
10 |
11 | 1. The origin of this software must not be misrepresented; you must not
12 | claim that you wrote the original software. If you use this software
13 | in a product, an acknowledgment in the product documentation would be
14 | appreciated but is not required.
15 | 2. Altered source versions must be plainly marked as such, and must not be
16 | misrepresented as being the original software.
17 | 3. This notice may not be removed or altered from any source distribution.
18 |
--------------------------------------------------------------------------------
/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | kotlin("jvm") version "2.1.20"
3 | }
4 |
5 | allprojects {
6 | group = "earth.groundctrl"
7 | version = "v2025.05"
8 | }
9 |
10 | repositories {
11 | google()
12 | mavenLocal()
13 | mavenCentral()
14 | }
15 |
16 | kotlin {
17 | jvmToolchain(23)
18 | }
19 |
20 | subprojects {
21 | apply(plugin = "org.jetbrains.kotlin.jvm")
22 | }
23 |
--------------------------------------------------------------------------------
/demo/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | application
3 | id("org.openjfx.javafxplugin") version "0.1.0"
4 | id("com.jaredsburrows.license") version "0.9.3"
5 | id("com.dua3.gradle.runtime") version "1.13.1-patch-1"
6 | }
7 |
8 | repositories {
9 | google()
10 | mavenLocal()
11 | mavenCentral()
12 | }
13 |
14 | javafx {
15 | version = "24"
16 | modules("javafx.controls", "javafx.fxml")
17 | }
18 |
19 | dependencies {
20 | implementation(project(":theme"))
21 | // Replace the line above with this line when using a local package
22 | // implementation("earth.groundctrl:javafx-fluent-theme:v2025.05")
23 | }
24 |
25 | tasks {
26 | jpackage {
27 | finalizedBy("copyDlls")
28 | }
29 | }
30 |
31 | tasks.register("copyDlls") {
32 | from(".")
33 | include("*.dll")
34 | into(file(layout.buildDirectory.dir("jpackage/JavaFX Fluent UI Gallery")))
35 | }
36 |
37 | application {
38 | mainClass.set("MainKt")
39 | }
40 |
41 | runtime {
42 | options.set(listOf("--strip-debug", "--compress", "zip-9", "--no-header-files", "--no-man-pages"))
43 | modules = listOf(
44 | "java.scripting",
45 | "java.xml",
46 | "jdk.unsupported"
47 | )
48 | launcher {
49 | noConsole = true
50 | }
51 | jpackage {
52 | imageName = "JavaFX Fluent UI Gallery"
53 | skipInstaller = true
54 | imageOptions = listOf(
55 | "--copyright", "Copyright (c) 2023-2025 Eroica",
56 | "--vendor", "GROUNDCTRL",
57 | )
58 | appVersion = "2025.05"
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/demo/src/main/kotlin/Main.kt:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2023-2025 Eroica
2 | *
3 | * This software is provided 'as-is', without any express or implied
4 | * warranty. In no event will the authors be held liable for any damages
5 | * arising from the use of this software.
6 | *
7 | * Permission is granted to anyone to use this software for any purpose,
8 | * including commercial applications, and to alter it and redistribute it
9 | * freely, subject to the following restrictions:
10 | *
11 | * 1. The origin of this software must not be misrepresented; you must not
12 | * claim that you wrote the original software. If you use this software
13 | * in a product, an acknowledgment in the product documentation would be
14 | * appreciated but is not required.
15 | * 2. Altered source versions must be plainly marked as such, and must not be
16 | * misrepresented as being the original software.
17 | * 3. This notice may not be removed or altered from any source distribution.
18 | */
19 |
20 | import earth.groundctrl.fluent.FluentApp
21 | import javafx.application.Application.launch
22 | import javafx.beans.InvalidationListener
23 | import javafx.scene.Scene
24 | import javafx.scene.paint.Color
25 | import javafx.stage.Stage
26 |
27 | fun main() {
28 | FluentApp.initialize()
29 | launch(FluentDemo::class.java)
30 | }
31 |
32 | class FluentDemo : FluentApp() {
33 | override fun onCreateStage(primaryStage: Stage) {
34 | primaryStage.minWidth = 800.0
35 | primaryStage.minHeight = 600.0
36 | primaryStage.title = "JavaFX Fluent UI Gallery"
37 | primaryStage.scene = Scene(MainActivity(primaryStage, hostServices).apply {
38 | }, Color.TRANSPARENT).apply {
39 | stylesheets.add("style.css")
40 | }
41 | primaryStage.focusedProperty().addListener(InvalidationListener {
42 | if (primaryStage.isFocused) {
43 | primaryStage.scene.root.styleClass.remove("no-focus")
44 | } else {
45 | primaryStage.scene.root.styleClass.add("no-focus")
46 | }
47 | })
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/demo/src/main/kotlin/MainActivity.kt:
--------------------------------------------------------------------------------
1 | import controllers.FragmentType
2 | import controllers.IFragment
3 | import earth.groundctrl.fluent.lib.Windows
4 | import javafx.application.HostServices
5 | import javafx.beans.InvalidationListener
6 | import javafx.beans.property.ReadOnlyBooleanProperty
7 | import javafx.beans.property.SimpleBooleanProperty
8 | import javafx.event.ActionEvent
9 | import javafx.fxml.FXML
10 | import javafx.fxml.FXMLLoader
11 | import javafx.scene.control.TreeView
12 | import javafx.scene.layout.StackPane
13 | import javafx.scene.layout.VBox
14 | import javafx.stage.Stage
15 | import views.ISidebarItem
16 | import views.SidebarItem
17 |
18 | sealed interface IViewEvent {
19 | class Select(val fragment: FragmentType) : IViewEvent
20 | }
21 |
22 | class MainActivity(
23 | val window: Stage,
24 | private val hostServices: HostServices
25 | ) : VBox() {
26 | @FXML
27 | private lateinit var sidebar: TreeView
28 |
29 | @FXML
30 | private lateinit var fragmentContainer: StackPane
31 |
32 | private val isMicaEffect = SimpleBooleanProperty(true)
33 | fun getIsMicaEffect() = isMicaEffect.get()
34 | fun isMicaEffectProperty(): ReadOnlyBooleanProperty = isMicaEffect
35 |
36 | private val isHeaderBar = SimpleBooleanProperty(true)
37 | fun getIsHeaderBar() = isHeaderBar.get()
38 | fun isHeaderBarProperty(): ReadOnlyBooleanProperty = isHeaderBar
39 |
40 | private var fragment: IFragment? = null
41 |
42 | init {
43 | FXMLLoader(javaClass.getResource("MainActivity.fxml")).apply {
44 | setRoot(this@MainActivity)
45 | setController(this@MainActivity)
46 | load()
47 | }
48 |
49 | sidebar.selectionModel.selectedItemProperty()
50 | .addListener { _, _, treeItem ->
51 | (treeItem.value as? SidebarItem)?.fragment?.let { on(IViewEvent.Select(it)) }
52 | }
53 |
54 | isMicaEffectProperty().addListener(InvalidationListener {
55 | if (getIsMicaEffect()) {
56 | styleClass.add("use-mica")
57 | } else {
58 | styleClass.remove("use-mica")
59 | }
60 | })
61 |
62 | on(IViewEvent.Select(FragmentType.Home))
63 | }
64 |
65 | fun on(event: IViewEvent) {
66 | when (event) {
67 | is IViewEvent.Select -> {
68 | replaceFragment(event.fragment)
69 | }
70 | }
71 | }
72 |
73 | fun toggleMica() {
74 | Windows.setMicaFor(window.title, !getIsMicaEffect().also { isMicaEffect.set(!it) })
75 | }
76 |
77 | fun toggleHeaderBar() {
78 | Windows.setHeaderBarFor(window.title, !getIsHeaderBar().also { isHeaderBar.set(!it) })
79 | }
80 |
81 | fun openLink(uri: String) {
82 | hostServices.showDocument(uri)
83 | }
84 |
85 | @FXML
86 | private fun onSettingsClick(event: ActionEvent) {
87 | replaceFragment(FragmentType.Settings)
88 | event.consume()
89 | }
90 |
91 | private fun replaceFragment(fragment: FragmentType) {
92 | this.fragment?.onDestroy()
93 | fragmentContainer.children.clear()
94 | val newFragment = fragment()
95 | newFragment.activity = this
96 | newFragment.onCreateView()
97 | fragmentContainer.children.add(newFragment.view)
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/demo/src/main/kotlin/controllers/Fragments.kt:
--------------------------------------------------------------------------------
1 | package controllers
2 |
3 | import MainActivity
4 | import fragments.ComboBoxFragment
5 | import fragments.DialogFragment
6 | import fragments.HeaderBarFragment
7 | import fragments.HomeFragment
8 | import fragments.InfoBarFragment
9 | import fragments.ProgressBarFragment
10 | import fragments.SystemBackdropFragment
11 | import javafx.beans.NamedArg
12 | import javafx.event.ActionEvent
13 | import javafx.fxml.FXML
14 | import javafx.fxml.FXMLLoader
15 | import javafx.scene.control.Hyperlink
16 | import javafx.scene.layout.Pane
17 | import javafx.scene.layout.VBox
18 | import java.util.*
19 |
20 | enum class FragmentType(private val factory: () -> IFragment) {
21 | Home({ HomeFragment() }),
22 | Typography({ BaseFragment("TypographyFragment.fxml") }),
23 |
24 | /* Basic input */
25 | Button({ BaseFragment("ButtonFragment.fxml") }),
26 | MenuButton({ BaseFragment("MenuButtonFragment.fxml") }),
27 | Hyperlink({ BaseFragment("HyperlinkFragment.fxml") }),
28 | ToggleButton({ BaseFragment("ToggleButtonFragment.fxml") }),
29 | CheckBox({ BaseFragment("CheckBoxFragment.fxml") }),
30 | ComboBox({ ComboBoxFragment() }),
31 | RadioButton({ BaseFragment("RadioButtonFragment.fxml") }),
32 | Slider({ BaseFragment("SliderFragment.fxml") }),
33 |
34 | /* Collections */
35 | ListView({ BaseFragment("ListViewFragment.fxml") }),
36 | TreeView({ BaseFragment("TreeViewFragment.fxml") }),
37 | TableView({ BaseFragment("TableViewFragment.fxml") }),
38 |
39 | /* Date & time */
40 | DatePicker({ BaseFragment("DatePickerFragment.fxml") }),
41 |
42 | /* Menus & toolbars */
43 | MenuBar({ BaseFragment("MenuBarFragment.fxml") }),
44 |
45 | /* Dialogs & flyouts */
46 | Dialog({ DialogFragment() }),
47 |
48 | /* Scrolling */
49 | ScrollView({ BaseFragment("ScrollViewFragment.fxml") }),
50 |
51 | /* Status & info */
52 | InfoBar({ InfoBarFragment() }),
53 | ProgressBar({ ProgressBarFragment() }),
54 | Tooltip({ BaseFragment("TooltipFragment.fxml") }),
55 |
56 | /* Styles */
57 | SystemBackdrop({ SystemBackdropFragment() }),
58 |
59 | /* Text */
60 | Spinner({ BaseFragment("SpinnerFragment.fxml") }),
61 | PasswordField({ BaseFragment("PasswordFieldFragment.fxml") }),
62 | Label({ BaseFragment("LabelFragment.fxml") }),
63 | TextArea({ BaseFragment("TextAreaFragment.fxml") }),
64 |
65 | /* Windowing */
66 | HeaderBar({ HeaderBarFragment() }),
67 |
68 | Settings({ BaseFragment("SettingsFragment.fxml") });
69 |
70 | operator fun invoke(): IFragment = factory()
71 | }
72 |
73 | interface IFragment {
74 | val view: Pane
75 | var activity: MainActivity
76 |
77 | fun onCreateView() = Unit
78 | fun onDestroy() = Unit
79 | }
80 |
81 | open class BaseFragment(@NamedArg("resourceId") private val resourceId: String) : VBox(), IFragment {
82 | override lateinit var activity: MainActivity
83 |
84 | override fun onCreateView() {
85 | val bundle = ResourceBundle.getBundle("strings")
86 | FXMLLoader(javaClass.getResource("/fragments/$resourceId"), bundle).apply {
87 | setRoot(this@BaseFragment)
88 | setController(this@BaseFragment)
89 | load()
90 | }
91 | }
92 |
93 | override val view: Pane
94 | get() = this
95 |
96 | @FXML
97 | private fun onHyperlinkClick(event: ActionEvent) {
98 | activity.openLink((event.source as Hyperlink).text)
99 | event.consume()
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/demo/src/main/kotlin/fragments/ComboBoxFragment.kt:
--------------------------------------------------------------------------------
1 | package fragments
2 |
3 | import controllers.BaseFragment
4 | import javafx.fxml.FXML
5 | import javafx.scene.control.ComboBox
6 | import javafx.scene.control.Label
7 | import javafx.scene.text.Font
8 |
9 | class ComboBoxFragment : BaseFragment("ComboBoxFragment.fxml") {
10 | companion object {
11 | private val DEFAULT_FONT = Font(10.0)
12 | }
13 |
14 | private val fontMap = mutableMapOf(
15 | 10.0 to DEFAULT_FONT
16 | )
17 |
18 | @FXML
19 | private lateinit var fontSize: ComboBox
20 |
21 | @FXML
22 | private lateinit var fontSizeLabel: Label
23 |
24 | override fun onCreateView() {
25 | super.onCreateView()
26 | fontSize.valueProperty().addListener { _, _, newValue ->
27 | try {
28 | val cachedFont = fontMap.getOrPut(newValue.toDouble()) { Font(newValue.toDouble()) }
29 | fontSizeLabel.font = cachedFont
30 | } catch (_: NumberFormatException) {
31 | fontSizeLabel.font = DEFAULT_FONT
32 | }
33 | }
34 | }
35 |
36 | override fun onDestroy() {
37 | fontMap.clear()
38 | super.onDestroy()
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/demo/src/main/kotlin/fragments/DialogFragment.kt:
--------------------------------------------------------------------------------
1 | package fragments
2 |
3 | import controllers.BaseFragment
4 | import javafx.beans.property.ReadOnlyStringProperty
5 | import javafx.beans.property.SimpleStringProperty
6 | import javafx.event.ActionEvent
7 | import javafx.fxml.FXML
8 | import javafx.fxml.FXMLLoader
9 | import javafx.scene.control.ButtonBar
10 | import javafx.scene.control.ButtonType
11 | import javafx.scene.control.Dialog
12 | import javafx.stage.Modality
13 | import javafx.stage.Stage
14 |
15 | class FullDialog(private val parentWindow: Stage) {
16 | private val dialog: Stage = FXMLLoader(javaClass.getResource("/dialogs/FullDialog.fxml")).apply {
17 | setController(this@FullDialog)
18 | }.load()
19 |
20 | init {
21 | dialog.isResizable = false
22 | dialog.initOwner(parentWindow)
23 | dialog.initModality(Modality.WINDOW_MODAL)
24 | }
25 |
26 | fun show() {
27 | dialog.show()
28 | }
29 | }
30 |
31 | class DialogFragment : BaseFragment("DialogFragment.fxml") {
32 | private val dialogResult = SimpleStringProperty()
33 |
34 | fun getDialogResult() = dialogResult.get()
35 | fun dialogResultProperty(): ReadOnlyStringProperty = dialogResult
36 |
37 | private val dialog: Dialog by lazy {
38 | FXMLLoader(javaClass.getResource("/dialogs/Dialog.fxml")).load