https://github.com/pit-ray/fluent-tray
Fluent design-based GUI library for system tray applications written in C++ single header.
https://github.com/pit-ray/fluent-tray
cpp desktop fluent-design gui-library tray windows windows-10 windows-11
Last synced: 11 months ago
JSON representation
Fluent design-based GUI library for system tray applications written in C++ single header.
- Host: GitHub
- URL: https://github.com/pit-ray/fluent-tray
- Owner: pit-ray
- License: mit
- Created: 2024-02-05T01:27:25.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-22T14:55:10.000Z (over 1 year ago)
- Last Synced: 2024-07-22T17:56:30.473Z (over 1 year ago)
- Topics: cpp, desktop, fluent-design, gui-library, tray, windows, windows-10, windows-11
- Language: C++
- Homepage: https://pit-ray.github.io/fluent-tray/
- Size: 1.04 MB
- Stars: 15
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
fluent-tray

Fluent Design-based GUI Library for System Tray Applications
## Concept
fluent-tray provides a simple system tray icon and menu to easily create resident applications that do not require complex windows.
All you have to do is include a single header file since only the native API is used.
Currently, only Windows is supported.
## Demo

#### Code
Simply create a `FluentTray` object and add a menu with `.add_menu()`.
```cpp
#include "fluent_tray.hpp"
int main()
{
using namespace fluent_tray ;
FluentTray tray{} ;
// Initialize the tray icon.
tray.create_tray("demo", "demo/assets/icon.ico") ;
// Add menus in order from the top.
tray.add_menu("Home", "demo/assets/fa-home.ico") ;
tray.add_separator() ;
tray.add_menu("Download", "demo/assets/fa-download.ico") ;
tray.add_menu("Insight", "demo/assets/fa-line-chart.ico") ;
tray.add_separator() ;
tray.add_menu("Coffee", "demo/assets/fa-coffee.ico", true) ;
tray.add_menu("Desktop", "demo/assets/fa-desktop.ico", true) ;
tray.add_separator() ;
tray.add_menu("Exit", "demo/assets/fa-sign-out.ico") ;
// Start message loop
tray.update_with_loop() ;
return 0 ;
}
```
#### Build
You can build this demo using `cmake` as follows.
```sh
$ cmake -B build demo
$ cmake --build build
$ ./build/Debug/fluent-tray-demo.exe
```
## Test
```sh
$ cmake -B build_test tests
$ cmake --build build_test
$ ctest -C Debug --test-dir build_test --output-on-failure
```
## License
This library is provided by pit-ray under the [MIT License](./LICENSE.txt).