fix(battery): show discrete gpu name

This commit is contained in:
Ashley Wulber 2024-05-09 12:23:57 -04:00 • committed by Ashley Wulber
parent 81dbf62724
commit 668b0825c9

View file

@ -590,18 +590,14 @@ impl cosmic::Application for CosmicBatteryApplet {
}
content.push(
menu_button(row![
menu_button(
row![
text(fl!(
"dgpu-applications",
gpu_name = if self.gpus.len() == 1 {
String::new()
} else {
format!("\"{}\"", gpu.name)
}
gpu_name = format!("\"{}\"", gpu.name)
))
.size(14)
.width(Length::Fill)
.height(Length::Fixed(24.0))
.vertical_alignment(Vertical::Center),
container(
icon::from_name(if gpu.toggled {
@ -616,7 +612,9 @@ impl cosmic::Application for CosmicBatteryApplet {
.align_y(Vertical::Center)
.width(Length::Fixed(24.0))
.height(Length::Fixed(24.0)),
])
]
.align_items(Alignment::Center),
)
.on_press(Message::ToggleGpuApps(key.clone()))
.into(),
);