Skip to content
This repository was archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Add metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakhran committed Feb 26, 2024
1 parent f3f5f12 commit 834cd76
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 15 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion librazer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "librazer"
version = "0.1.0"
version = "0.5.0"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion razer-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "razer-cli"
version = "0.1.0"
version = "0.5.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
6 changes: 5 additions & 1 deletion razer-tray/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
[package]
name = "razer-tray"
version = "0.1.0"
version = "0.5.0"
edition = "2021"

authors = ["Tarek Dakhran <>"]
homepage = "https://github.com/tdakhran/razer-ctl"
description = "A tray icon for controlling Razer Blade 16"

[dependencies]
anyhow = "1.0.80"
confy = "0.6.0"
Expand Down
27 changes: 18 additions & 9 deletions razer-tray/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ use librazer::{command, device};

use tao::event_loop::{ControlFlow, EventLoopBuilder};
use tray_icon::{
menu::{
AboutMetadata, CheckMenuItem, IsMenuItem, Menu, MenuEvent, PredefinedMenuItem, Submenu,
},
menu::{CheckMenuItem, IsMenuItem, Menu, MenuEvent, PredefinedMenuItem, Submenu},
TrayIconBuilder, TrayIconEvent,
};

Expand Down Expand Up @@ -385,12 +383,7 @@ impl ProgramState {

// footer
menu.append(&PredefinedMenuItem::separator())?;
menu.append(&PredefinedMenuItem::about(
None,
Some(AboutMetadata {
..Default::default()
}),
))?;
menu.append(&PredefinedMenuItem::about(None, Some(Self::about())))?;
menu.append(&PredefinedMenuItem::quit(None))?;

Ok((menu, event_handlers))
Expand All @@ -404,6 +397,22 @@ impl ProgramState {
Ok(*next_state)
}

fn about() -> tray_icon::menu::AboutMetadata {
tray_icon::menu::AboutMetadata {
name: Some(env!("CARGO_PKG_NAME").into()),
version: Some(env!("CARGO_PKG_VERSION").into()),
authors: Some(
env!("CARGO_PKG_AUTHORS")
.split(';')
.map(|a| a.trim().to_string())
.collect::<Vec<_>>(),
),
website: Some(env!("CARGO_PKG_HOMEPAGE").into()),
comments: Some(env!("CARGO_PKG_DESCRIPTION").into()),
..Default::default()
}
}

fn get_next_perf_mode(&self) -> DeviceState {
DeviceState {
perf_mode: match self.device_state.perf_mode {
Expand Down

0 comments on commit 834cd76

Please sign in to comment.