Skip to content

Fluent design-based GUI library for system tray applications written in C++ single header.

License

Notifications You must be signed in to change notification settings

pit-ray/fluent-tray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fluent-tray

Fluent Design-based GUI Library for System Tray Applications

Coveralls
Coverity Scan Build Status

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().

#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.

$ cmake -B build demo
$ cmake --build build
$ ./build/Debug/fluent-tray-demo.exe

Test

$ 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.