From 6cbb8319dacc257f65a87b7fc2c8ca8d434cf6c4 Mon Sep 17 00:00:00 2001 From: Roman Makarov Date: Thu, 27 Aug 2026 23:02:16 +0200 Subject: [PATCH] chore: remove device name from stats (#1176) --- .../src/app/components/gpu_stats_section.rs | 35 +++---------------- lact-gui/src/app/pages/oc_page.rs | 1 - 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/lact-gui/src/app/components/gpu_stats_section.rs b/lact-gui/src/app/components/gpu_stats_section.rs index 9cf8d457..8994ac07 100644 --- a/lact-gui/src/app/components/gpu_stats_section.rs +++ b/lact-gui/src/app/components/gpu_stats_section.rs @@ -13,7 +13,7 @@ use crate::app::{ use gtk::pango::AttrList; use gtk::prelude::{BoxExt, OrientableExt, PopoverExt as _, WidgetExt}; use i18n_embed_fl::fl; -use lact_schema::{DeviceInfo, DeviceStats, PowerStates, PowerStats, clean_gpu_name}; +use lact_schema::{DeviceInfo, DeviceStats, PowerStates, PowerStats}; use relm4::{ComponentParts, ComponentSender, RelmWidgetExt as _}; use std::collections::HashSet; use std::str::FromStr as _; @@ -23,7 +23,6 @@ pub struct GpuStatsSection { stats_to_show: HashSet, stats: Arc, vram_clock_ratio: f64, - gpu_model: String, max_gpu_clock: Option, max_vram_clock: Option, min_gpu_clock: Option, @@ -63,15 +62,6 @@ impl relm4::SimpleComponent for GpuStatsSection { set_max_children_per_line: model.columns(GpuStatDisplay::Digits), set_selection_mode: gtk::SelectionMode::None, - append_child = &InfoRow { - set_name: fl!(I18N, "device-name"), - #[watch] - set_value: model.gpu_model.clone(), - } -> device_name_item: gtk::FlowBoxChild { - #[watch] - set_visible: model.shows(GpuStat::DeviceName), - }, - append_child = &InfoRow { set_name: fl!(I18N, "throttling"), #[watch] @@ -373,7 +363,6 @@ impl relm4::SimpleComponent for GpuStatsSection { stats_to_show: config.stats, stats: Arc::new(DeviceStats::default()), vram_clock_ratio: 1.0, - gpu_model: String::new(), max_gpu_clock: None, max_vram_clock: None, min_gpu_clock: None, @@ -389,16 +378,6 @@ impl relm4::SimpleComponent for GpuStatsSection { match msg { GpuStatsSectionMsg::Info(info) => { self.vram_clock_ratio = info.vram_clock_ratio(); - if let Some(pci_info) = &info.pci_info { - self.gpu_model = clean_gpu_name( - info.drm_info - .as_ref() - .and_then(|drm| drm.device_name.as_deref()) - .or(pci_info.device_pci_info.model.as_deref()) - .unwrap_or("Unknown"), - ) - .to_owned(); - } } GpuStatsSectionMsg::Stats(stats) => { self.stats = stats; @@ -427,7 +406,6 @@ pub struct GpuStatsSectionConfig { #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub enum GpuStat { - DeviceName, Throttling, GpuClockTarget, GpuVoltage, @@ -453,8 +431,7 @@ impl GpuStat { /// given a display. fn display(self) -> GpuStatDisplay { match self { - Self::DeviceName - | Self::Throttling + Self::Throttling | Self::GpuClockTarget | Self::GpuVoltage | Self::Temperature @@ -479,11 +456,9 @@ impl GpuStatsSection { fn has_data_for(&self, stat: GpuStat) -> bool { match stat { // Rendered with a placeholder when unavailable - GpuStat::DeviceName - | GpuStat::Throttling - | GpuStat::Temperature - | GpuStat::VramUsage - | GpuStat::FanSpeed => true, + GpuStat::Throttling | GpuStat::Temperature | GpuStat::VramUsage | GpuStat::FanSpeed => { + true + } GpuStat::GpuClockTarget => self.stats.clockspeed.target_gpu_clockspeed.is_some(), GpuStat::GpuVoltage => self.stats.voltage.gpu.is_some(), GpuStat::GpuClock => self.stats.clockspeed.gpu_clockspeed.is_some(), diff --git a/lact-gui/src/app/pages/oc_page.rs b/lact-gui/src/app/pages/oc_page.rs index ad8f070c..6ed53ca3 100644 --- a/lact-gui/src/app/pages/oc_page.rs +++ b/lact-gui/src/app/pages/oc_page.rs @@ -90,7 +90,6 @@ impl relm4::Component for OcPage { ) -> ComponentParts { let stats_section = GpuStatsSection::detach(GpuStatsSectionConfig { stats: HashSet::from([ - GpuStat::DeviceName, GpuStat::Throttling, GpuStat::GpuClockTarget, GpuStat::GpuVoltage,