Resolves ksni issues in Ubuntu & adding additional menu for battery status
This commit is contained in:
@@ -66,10 +66,18 @@ impl BatteryTray {
|
|||||||
|
|
||||||
impl Tray for BatteryTray {
|
impl Tray for BatteryTray {
|
||||||
fn icon_name(&self) -> String {
|
fn icon_name(&self) -> String {
|
||||||
"headset".into()
|
"audio-headset".into()
|
||||||
|
}
|
||||||
|
fn id(&self) -> String {
|
||||||
|
env!("CARGO_PKG_NAME").into()
|
||||||
}
|
}
|
||||||
fn menu(&self) -> Vec<MenuItem<Self>> {
|
fn menu(&self) -> Vec<MenuItem<Self>> {
|
||||||
vec![
|
vec![
|
||||||
|
StandardItem {
|
||||||
|
label: format!("Battery level: {bat}% ({crg})", bat = self.battery_level,crg = (if self.charging.is_some() { "Charging" } else {"Discharging"})).into(),
|
||||||
|
..Default::default()
|
||||||
|
}
|
||||||
|
.into(),
|
||||||
StandardItem {
|
StandardItem {
|
||||||
label: "Exit".into(),
|
label: "Exit".into(),
|
||||||
icon_name: "application-exit".into(),
|
icon_name: "application-exit".into(),
|
||||||
@@ -111,8 +119,8 @@ impl Tray for BatteryTray {
|
|||||||
ToolTip {
|
ToolTip {
|
||||||
title: "HyperX Cloud II".to_string(),
|
title: "HyperX Cloud II".to_string(),
|
||||||
description: description,
|
description: description,
|
||||||
icon_name: "".into(),
|
icon_name: "audio-headset".into(),
|
||||||
icon_pixmap: Vec::new(),
|
icon_pixmap: Vec::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user