Fluent Design-based GUI Library for System Tray Applications
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.
Simply create a FluentTray
object and add a menu with .add_menu()
.
#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 ;
}
You can build this demo using cmake
as follows.
$ cmake -B build demo
$ cmake --build build
$ ./build/Debug/fluent-tray-demo.exe
$ cmake -B build_test tests
$ cmake --build build_test
$ ctest -C Debug --test-dir build_test --output-on-failure
This library is provided by pit-ray under the MIT License.