Giter Site home page Giter Site logo

trayicon-rs's Introduction

TrayIcon

Currently I target Windows tray icon implementation, with popup menu, click, double click events. Goal is to provide a channel for events and ability to plug in winit event loop easily.

Open here a full working example with winit crate ๐Ÿข…

TODO

Provide coordinates of the Tray Icon area for custom popups.

Alternatives

Most mature alternative is qdot's systray-rs. Unfortunately I got frustrated with the API in it and decided to rewrite my own. This however largely does not use the code in it, instead I loaned my old C/C++ code repository as a template.

Change log

  • 0.2.0 - 2024-05-09
    • Removed dependency to winit crate, now setting a sender is a function.
    • Added show_menu, this means user must call it to show the menu even on right click. Previously right click always showed the menu.

trayicon-rs's People

Contributors

ciantic avatar fkrull avatar slonopotamus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

trayicon-rs's Issues

winit example not compiling

When I try to run the Winit example (clone this repo, navigate to the winit example, and cargo run) I get

mismatched types
expected struct winit::event_loop::EventLoopProxy<Events>
found struct EventLoopProxy<Events>
perhaps two different versions of crate winit are being used?

Show menu function

I can't find any function to show the menu.
I would like to show the menu after a specific event (for instance after a simple or double click).

Is there a way to do that with the current API?

Consider removing TrayIconSender

Since #5 seems to be ignored (and updating winit every time is not really convenient), I suggest that we remove the sender_* functions entirely and provide a callback F: Fn(T) -> () (where T is the event type). Since almost all existing message passing implementations (std, winit, and crossbeam) only takes &self, this would be fine. The final code would look like this:

let proxy = event_loop.create_proxy();
let mut tray_icon = TrayIconBuilder::new()
  .sender(move |e| { let _ = proxy.send(e.clone()); });

This completely eliminates the dependency on crossbeam and winit.

[FEATURE]: Icon::from_resource

I want to load Icon from resuouce.
Avoid multiple loads and reduce file size.

I use embed-resource lib, Write an *.rc include Icon ใ€cur file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.