From 004982cea781599b86ef9cee0ad1ab5fae9f8626 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Thu, 4 Aug 2022 20:25:15 +1200 Subject: [PATCH] ROGCC: group fan profile buttons with cpu/gpu buttons with enable/disable --- rog-control-center/src/widgets/fan_graph.rs | 24 +++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/rog-control-center/src/widgets/fan_graph.rs b/rog-control-center/src/widgets/fan_graph.rs index 5745d050..f1792951 100644 --- a/rog-control-center/src/widgets/fan_graph.rs +++ b/rog-control-center/src/widgets/fan_graph.rs @@ -16,24 +16,26 @@ pub fn fan_graphs( ui.separator(); let mut item = |p: Profile, ui: &mut Ui| { + ui.group(|ui|{ ui.selectable_value(&mut curves.show_curve, p, format!("{p:?}")); + ui.add_enabled_ui(curves.show_curve == p ,|ui| { + ui.selectable_value( + &mut curves.show_graph, + FanCurvePU::CPU, + format!("{:?}", FanCurvePU::CPU), + ); + ui.selectable_value( + &mut curves.show_graph, + FanCurvePU::GPU, + format!("{:?}", FanCurvePU::GPU), + ); + });}); }; ui.horizontal_wrapped(|ui| { for a in curves.curves.iter() { item(*a.0, ui); } - - ui.selectable_value( - &mut curves.show_graph, - FanCurvePU::CPU, - format!("{:?}", FanCurvePU::CPU), - ); - ui.selectable_value( - &mut curves.show_graph, - FanCurvePU::GPU, - format!("{:?}", FanCurvePU::GPU), - ); }); let curve = curves.curves.get_mut(&curves.show_curve).unwrap();