Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tray icons #7

Open
p00f opened this issue May 12, 2023 · 3 comments
Open

tray icons #7

p00f opened this issue May 12, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@p00f
Copy link

p00f commented May 12, 2023

I'm willing to work on this, can you tell me how to start? I found https://docs.rs/stray/0.1.3/stray/message/tray/struct.StatusNotifierItem.html which returns the icon name and/or the icon pixmap, how do I actually draw these?

@MaxVerevkin
Copy link
Owner

Hi.

It looks like stray uses tokio, so the first step would be to start using tokio ourselves (which I used to do at some point but removed (91381b2) because it wasn't really necessary at that point).

Then you can create a tray module, in which you will keep track of the tray state.

To draw an icon, you will need to create a Surface, and then

cairo_ctx.set_source_surface(&surface, x, y).unwrap();
cairo_ctx.paint().unwrap();

@p00f
Copy link
Author

p00f commented May 12, 2023 via email

@MaxVerevkin
Copy link
Owner

So, a high-level plan can be

  1. Transition to tokio.
  2. Add an option to enable the tray and just render the icons.
  3. Add config options to customize the appearance of those icons.
  4. Implement menus, clicks, popups.

@MaxVerevkin MaxVerevkin added the enhancement New feature or request label May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants