dialog: preserve show details setting

This commit is contained in:
Jeremy Soller 2025-07-21 19:50:28 -06:00
parent 5fd643b166
commit 4f0c5c1ec1
2 changed files with 54 additions and 10 deletions

View file

@ -164,6 +164,7 @@ impl State {
#[serde(default)]
pub struct Config {
pub app_theme: AppTheme,
pub dialog: DialogConfig,
pub desktop: DesktopConfig,
pub favorites: Vec<Favorite>,
pub show_details: bool,
@ -206,6 +207,7 @@ impl Default for Config {
Self {
app_theme: AppTheme::System,
desktop: DesktopConfig::default(),
dialog: DialogConfig::default(),
favorites: vec![
Favorite::Home,
Favorite::Documents,
@ -249,6 +251,18 @@ impl DesktopConfig {
}
}
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, CosmicConfigEntry, Deserialize, Serialize)]
#[serde(default)]
pub struct DialogConfig {
pub show_details: bool,
}
impl Default for DialogConfig {
fn default() -> Self {
Self { show_details: true }
}
}
/// Global and local [`crate::tab::Tab`] config.
///
/// [`TabConfig`] contains options that are passed to each instance of [`crate::tab::Tab`].