From 668b0825c941b719f8fee47010844391fe902717 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Thu, 9 May 2024 12:23:57 -0400 Subject: [PATCH] fix(battery): show discrete gpu name --- cosmic-applet-battery/src/app.rs | 50 +++++++++++++++----------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/cosmic-applet-battery/src/app.rs b/cosmic-applet-battery/src/app.rs index 69b97eef..f9e12923 100644 --- a/cosmic-applet-battery/src/app.rs +++ b/cosmic-applet-battery/src/app.rs @@ -590,33 +590,31 @@ impl cosmic::Application for CosmicBatteryApplet { } content.push( - menu_button(row![ - text(fl!( - "dgpu-applications", - gpu_name = if self.gpus.len() == 1 { - String::new() - } else { - format!("\"{}\"", gpu.name) - } - )) - .size(14) - .width(Length::Fill) - .height(Length::Fixed(24.0)) - .vertical_alignment(Vertical::Center), - container( - icon::from_name(if gpu.toggled { - "go-down-symbolic" - } else { - "go-up-symbolic" - }) + menu_button( + row![ + text(fl!( + "dgpu-applications", + gpu_name = format!("\"{}\"", gpu.name) + )) .size(14) - .symbolic(true) - ) - .align_x(Horizontal::Center) - .align_y(Vertical::Center) - .width(Length::Fixed(24.0)) - .height(Length::Fixed(24.0)), - ]) + .width(Length::Fill) + .vertical_alignment(Vertical::Center), + container( + icon::from_name(if gpu.toggled { + "go-down-symbolic" + } else { + "go-up-symbolic" + }) + .size(14) + .symbolic(true) + ) + .align_x(Horizontal::Center) + .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(), );