Merge remote-tracking branch 'origin/master' into display-info

This commit is contained in:
Ilya Zlobintsev
2026-06-19 18:04:28 +03:00
38 changed files with 90 additions and 82 deletions
@@ -285,7 +285,7 @@ impl NvidiaGpuController {
for fan in 0..fan_count {
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
if let Err(err) =
device.set_fan_speed(fan, (f64::from(target_pwm) / 2.5) as u32)
device.set_fan_speed(fan, (f64::from(target_pwm) / 2.55) as u32)
{
error!("could not set fan speed: {err}, disabling fan control");
break;
+6 -10
View File
@@ -1,27 +1,21 @@
mod about_dialog;
mod ext;
pub(crate) mod formatting;
pub(crate) mod components;
mod gpu_selector;
pub mod graphs_window;
mod info_dialog;
mod info_row;
mod info_row_level;
mod loader;
pub(crate) mod msg;
mod overdrive_dialog;
mod page_section;
mod page_section_expander;
pub(crate) mod pages;
mod preferences_dialog;
mod process_monitor;
mod profiles;
pub(crate) mod styles;
pub(crate) mod utils;
use crate::{
APP_ID, CONFIG, GUI_VERSION, I18N,
app::{
about_dialog::{AboutDialog, AboutDialogMsg},
ext::RelmLaunchable as _,
components::loader,
gpu_selector::GpuSelector,
info_dialog::{
InfoDialog, InfoDialogConfirmation, InfoDialogData, InfoDialogId, InfoDialogMsg,
@@ -34,12 +28,12 @@ use crate::{
ProfileSelector, ProfileSelectorMsg,
profile_rule_window::{ProfileRuleWindowMsg, profile_rule_row::ProfileRuleRowMsg},
},
utils::ext::RelmLaunchable as _,
},
config::WindowSize,
};
use adw::prelude::*;
use anyhow::{Context, anyhow};
use ext::RelmDefaultLauchable;
use graphs_window::{GraphsWindow, GraphsWindowMsg};
use gtk::{
FileChooserAction, FileChooserDialog, ResponseType, STYLE_PROVIDER_PRIORITY_APPLICATION,
@@ -82,6 +76,8 @@ use std::{
cell::Cell, fs, os::unix::net::UnixStream, path::PathBuf, rc::Rc, sync::Arc, time::Duration,
};
use tracing::{debug, error, info, trace, warn};
use utils::ext::RelmDefaultLauchable;
use utils::styles;
pub(crate) static APP_BROKER: MessageBroker<AppMsg> = MessageBroker::new();
@@ -14,13 +14,3 @@ flowboxchild:not(.clickable-info-row):hover {
.clickable-info-row:hover {
background-color: rgba(0, 0, 0, 0.08);
}
/* https://gitlab.gnome.org/GNOME/libadwaita/-/issues/1119 */
.info-row-level-bar {
border-radius: 5px;
}
.info-row-level-bar block {
border-radius: 0;
}
@@ -0,0 +1,8 @@
/* https://gitlab.gnome.org/GNOME/libadwaita/-/issues/1119 */
.info-row-level-bar {
border-radius: 5px;
}
.info-row-level-bar block {
border-radius: 0;
}
@@ -1,4 +1,4 @@
use crate::app::info_row::InfoRow;
use crate::app::components::info_row::InfoRow;
use gtk::glib::{self, Object};
glib::wrapper! {
@@ -31,7 +31,7 @@ mod imp {
use gtk::{LevelBar, glib, subclass::prelude::*};
use relm4::view;
use crate::app::info_row::{InfoRow, InfoRowExt};
use crate::app::components::info_row::{InfoRow, InfoRowExt};
#[derive(Default, Properties)]
#[properties(wrapper_type = super::InfoRowLevel)]
@@ -4,12 +4,12 @@ use gtk::{
};
use std::{cell::Cell, rc::Rc, time::Duration};
const APP_SVG: &[u8] = include_bytes!("../../../res/io.github.ilya_zlobintsev.LACT.svg");
const APP_SVG: &[u8] = include_bytes!("../../../../res/io.github.ilya_zlobintsev.LACT.svg");
const FRAME_COUNT: usize = 12;
const FRAME_INTERVAL: Duration = Duration::from_millis(65);
const SIZE: i32 = 192;
pub(super) fn new() -> gtk::Picture {
pub(crate) fn new() -> gtk::Picture {
let textures = Rc::new(build_textures());
let picture = gtk::Picture::new();
+6
View File
@@ -0,0 +1,6 @@
pub(crate) mod info_row;
pub(crate) mod info_row_level;
pub(crate) mod loader;
pub(crate) mod oc_adjustment;
pub(crate) mod page_section;
pub(crate) mod page_section_expander;
+1 -1
View File
@@ -2,7 +2,7 @@ pub mod plot;
mod plot_component;
pub mod stat;
use super::{APP_BROKER, msg::AppMsg};
use crate::app::{APP_BROKER, msg::AppMsg};
use crate::{CONFIG, I18N};
use anyhow::Context;
use gtk::{glib, prelude::*};
@@ -1,8 +1,8 @@
use super::PlotColorScheme;
use super::cubic_spline::cubic_spline_interpolation;
use super::to_texture_ext::ToTextureExt;
use crate::app::formatting;
use crate::app::graphs_window::stat::{StatType, StatsData};
use crate::app::utils::formatting;
use anyhow::Context;
use cairo::{Context as CairoContext, ImageSurface};
use gtk::gdk::MemoryTexture;
+2 -2
View File
@@ -1,5 +1,5 @@
use super::msg::AppMsg;
use crate::I18N;
use crate::app::msg::AppMsg;
use adw::prelude::*;
use gtk::glib::clone;
use i18n_embed_fl::fl;
@@ -116,7 +116,7 @@ impl InfoDialog {
}
#[derive(Clone, Copy, Debug)]
pub(super) enum InfoDialogEntryResponse {
pub(crate) enum InfoDialogEntryResponse {
Closed(InfoDialogId),
Confirmed(InfoDialogId),
}
+7 -5
View File
@@ -1,9 +1,11 @@
use super::PageUpdate;
use crate::I18N;
use crate::app::ext::FlowBoxExt;
use crate::app::formatting::fmt_human_bytes;
use crate::app::info_row::{InfoRow, InfoRowExt, InfoRowItem};
use crate::app::page_section::PageSection;
use crate::app::components::{
info_row::{InfoRow, InfoRowExt, InfoRowItem},
page_section::PageSection,
};
use crate::app::pages::PageUpdate;
use crate::app::utils::ext::FlowBoxExt;
use crate::app::utils::formatting::fmt_human_bytes;
use gtk::prelude::*;
use i18n_embed_fl::fl;
use lact_schema::{AmdIpInfo, CacheInfo, CacheType, DeviceInfo, DeviceStats};
@@ -1,7 +1,6 @@
pub mod crash_page;
pub mod displays_page;
pub mod info_page;
pub mod oc_adjustment;
pub mod oc_page;
pub mod software_page;
pub mod thermals_page;
+6 -7
View File
@@ -1,20 +1,18 @@
mod clocks_frame;
pub mod gpu_stats_section;
mod gpu_stats_section;
mod performance_frame;
mod power_cap_section;
mod power_states;
mod vf_curve;
use super::PageUpdate;
use crate::app::ext::RelmLaunchable as _;
use crate::app::pages::oc_page::gpu_stats_section::GpuStatsSectionMsg;
use crate::app::pages::oc_page::vf_curve::{VfCurveEditor, VfCurveEditorMsg};
use crate::app::{ext::RelmDefaultLauchable, msg::AppMsg};
use crate::app::pages::PageUpdate;
use crate::app::utils::ext::RelmLaunchable as _;
use crate::app::{msg::AppMsg, utils::ext::RelmDefaultLauchable};
use amdgpu_sysfs::gpu_handle::{
PerformanceLevel, PowerLevelKind, power_profile_mode::PowerProfileModesTable,
};
use clocks_frame::{ClocksFrame, ClocksFrameMsg};
use gpu_stats_section::GpuStatsSection;
use gpu_stats_section::{GpuStatsSection, GpuStatsSectionMsg};
use gtk::prelude::{BoxExt, OrientableExt, WidgetExt};
use indexmap::IndexMap;
use lact_schema::config;
@@ -26,6 +24,7 @@ use relm4::binding::BoolBinding;
use relm4::{ComponentController, ComponentParts, ComponentSender, RelmWidgetExt};
use std::sync::Arc;
use tracing::debug;
use vf_curve::{VfCurveEditor, VfCurveEditorMsg};
pub struct OcPage {
stats_section: relm4::Controller<GpuStatsSection>,
@@ -1,6 +1,9 @@
use crate::{
APP_BROKER, I18N,
app::{ext::make_event_controller_no_scroll, msg::AppMsg, pages::oc_adjustment::OcAdjustment},
app::{
components::oc_adjustment::OcAdjustment, msg::AppMsg,
utils::ext::make_event_controller_no_scroll,
},
};
use gtk::{
glib::{SignalHandlerId, object::ObjectExt},
@@ -3,13 +3,9 @@ mod adjustment_row;
use crate::{
APP_BROKER, I18N,
app::{
msg::AppMsg,
page_section::PageSection,
pages::oc_page::{OcPageMsg, clocks_frame::adjustment_group::AdjustmentGroup},
},
app::{components::page_section::PageSection, msg::AppMsg, pages::oc_page::OcPageMsg},
};
use adjustment_group::ClockCategory;
use adjustment_group::{AdjustmentGroup, ClockCategory};
use adjustment_row::ClocksData;
use amdgpu_sysfs::gpu_handle::overdrive::ClocksTableGen as AmdClocksTable;
use gtk::{
@@ -1,10 +1,14 @@
use crate::I18N;
use crate::app::{
ext::FlowBoxExt,
formatting::{self, Mono},
info_row::{InfoRow, InfoRowExt},
info_row_level::InfoRowLevel,
page_section::PageSection,
components::{
info_row::{InfoRow, InfoRowExt},
info_row_level::InfoRowLevel,
page_section::PageSection,
},
utils::{
ext::FlowBoxExt,
formatting::{self, Mono},
},
};
use gtk::pango::AttrList;
use gtk::prelude::{BoxExt, Cast, FlowBoxChildExt, OrientableExt, PopoverExt as _, WidgetExt};
@@ -1,9 +1,8 @@
mod heuristics_list;
use super::OcPageMsg;
use crate::{
APP_BROKER, I18N,
app::{msg::AppMsg, page_section::PageSection},
app::{components::page_section::PageSection, msg::AppMsg, pages::oc_page::OcPageMsg},
};
use amdgpu_sysfs::gpu_handle::{PerformanceLevel, power_profile_mode::PowerProfileModesTable};
use gtk::{
@@ -1,9 +1,9 @@
use crate::{
APP_BROKER, I18N,
app::{
components::{oc_adjustment::OcAdjustment, page_section::PageSection},
msg::AppMsg,
page_section::PageSection,
pages::{PageUpdate, oc_adjustment::OcAdjustment},
pages::PageUpdate,
},
};
use gtk::{
@@ -1,13 +1,10 @@
use super::power_states_list::PowerStatesList;
use super::power_states_list::{PowerStatesListMsg, PowerStatesListOptions};
use crate::{
APP_BROKER, I18N,
app::{
ext::RelmLaunchable as _,
msg::AppMsg,
page_section_expander::PageSectionExpander,
pages::oc_page::power_states::power_states_list::{
PowerStatesListMsg, PowerStatesListOptions,
},
components::page_section_expander::PageSectionExpander, msg::AppMsg,
utils::ext::RelmLaunchable as _,
},
};
use amdgpu_sysfs::gpu_handle::{PerformanceLevel, PowerLevelKind};
@@ -1,6 +1,4 @@
use crate::app::pages::oc_page::power_states::power_states_row::{
PowerStateRow, PowerStateRowMsg, PowerStateRowOptions,
};
use super::power_states_row::{PowerStateRow, PowerStateRowMsg, PowerStateRowOptions};
use amdgpu_sysfs::gpu_handle::PowerLevelId;
use gtk::prelude::{FrameExt, WidgetExt};
use lact_schema::PowerState;
+6 -5
View File
@@ -1,13 +1,14 @@
use crate::app::ext::FlowBoxExt;
mod vulkan;
use crate::app::loader;
use crate::{
GUI_VERSION, I18N, REPO_URL,
app::{
formatting,
info_row::{InfoRow, InfoRowExt},
page_section::PageSection,
components::{
info_row::{InfoRow, InfoRowExt},
loader,
page_section::PageSection,
},
utils::{ext::FlowBoxExt, formatting},
},
};
use gtk::prelude::*;
+6 -5
View File
@@ -1,14 +1,15 @@
mod fan_curve_frame;
use super::{PageUpdate, oc_adjustment::OcAdjustment};
use crate::app::ext::{FlowBoxExt, make_event_controller_no_scroll};
use crate::app::pages::PageUpdate;
use crate::{
APP_BROKER, I18N,
app::{
formatting::{fmt_fan_speed, fmt_temperature_text, fmt_throttling_text},
info_row::InfoRow,
components::{info_row::InfoRow, oc_adjustment::OcAdjustment, page_section::PageSection},
msg::AppMsg,
page_section::PageSection,
utils::{
ext::{FlowBoxExt, make_event_controller_no_scroll},
formatting::{fmt_fan_speed, fmt_temperature_text, fmt_throttling_text},
},
},
};
use amdgpu_sysfs::gpu_handle::fan_control::FanInfo;
@@ -1,7 +1,9 @@
use super::{FanSettingRow, PmfwOptions, adj_is_empty};
use crate::{
APP_BROKER, I18N,
app::{graphs_window::plot::PlotColorScheme, msg::AppMsg, pages::oc_adjustment::OcAdjustment},
app::{
components::oc_adjustment::OcAdjustment, graphs_window::plot::PlotColorScheme, msg::AppMsg,
},
};
use gtk::{
gdk,
+5 -1
View File
@@ -1,6 +1,10 @@
use crate::{
CONFIG, I18N,
app::{APP_BROKER, msg::AppMsg, styles, styles::AppTheme},
app::{
APP_BROKER,
msg::AppMsg,
utils::styles::{self, AppTheme},
},
config::{MAX_STATS_POLL_INTERVAL_MS, MIN_STATS_POLL_INTERVAL_MS},
};
use adw::prelude::{
+1 -1
View File
@@ -1,6 +1,6 @@
use std::collections::HashMap;
use crate::app::{APP_BROKER, formatting, msg::AppMsg};
use crate::app::{APP_BROKER, msg::AppMsg, utils::formatting};
use adw::prelude::AdwWindowExt;
use gtk::{
glib::{
+1 -1
View File
@@ -4,7 +4,6 @@ mod profile_row;
pub mod profile_rule_window;
use crate::I18N;
use crate::app::ext::RelmLaunchable as _;
use crate::app::msg::AppMsg;
use crate::app::profiles::new_profile_dialog::NewProfileDialog;
use crate::app::profiles::profile_rename_dialog::ProfileRenameDialog;
@@ -12,6 +11,7 @@ use crate::app::profiles::profile_row::ProfileRow;
use crate::app::profiles::profile_row::ProfileRowType;
use crate::app::profiles::profile_rule_window::ProfileEditParams;
use crate::app::profiles::profile_rule_window::ProfileRuleWindow;
use crate::app::utils::ext::RelmLaunchable as _;
use gtk::glib::clone;
use gtk::prelude::*;
use i18n_embed_fl::fl;
+3
View File
@@ -0,0 +1,3 @@
pub(crate) mod ext;
pub(crate) mod formatting;
pub(crate) mod styles;
+1 -1
View File
@@ -1,4 +1,4 @@
use crate::app::{graphs_window::stat::StatType, styles::AppTheme};
use crate::app::{graphs_window::stat::StatType, utils::styles::AppTheme};
use serde::{Deserialize, Deserializer, Serialize};
use serde_with::skip_serializing_none;
use std::{collections::HashMap, env, fs, path::PathBuf};