2024-05-06 15:39:04 +02:00
|
|
|
// Copyright 2023 System76 <info@system76.com>
|
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
|
|
2025-05-19 23:51:43 -04:00
|
|
|
use cosmic_config::{self, CosmicConfigEntry, cosmic_config_derive::CosmicConfigEntry};
|
2024-03-22 17:22:43 +01:00
|
|
|
|
2025-05-09 13:27:22 -06:00
|
|
|
#[derive(Debug, Clone, CosmicConfigEntry, PartialEq, Eq, serde::Deserialize, serde::Serialize)]
|
2024-03-22 17:22:43 +01:00
|
|
|
#[version = 1]
|
|
|
|
|
pub struct TimeAppletConfig {
|
|
|
|
|
pub military_time: bool,
|
2024-08-19 03:13:51 -04:00
|
|
|
pub show_seconds: bool,
|
2024-03-22 17:34:24 +01:00
|
|
|
pub first_day_of_week: u8,
|
2024-03-22 17:22:43 +01:00
|
|
|
pub show_date_in_top_panel: bool,
|
2024-05-25 05:16:25 +02:00
|
|
|
pub show_weekday: bool,
|
2025-11-07 13:42:36 -05:00
|
|
|
#[serde(default, skip_serializing_if = "str::is_empty")]
|
|
|
|
|
pub format_strftime: String,
|
2024-03-22 17:22:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Default for TimeAppletConfig {
|
|
|
|
|
fn default() -> Self {
|
|
|
|
|
Self {
|
|
|
|
|
military_time: false,
|
2024-08-19 03:13:51 -04:00
|
|
|
show_seconds: false,
|
2024-03-22 17:34:24 +01:00
|
|
|
first_day_of_week: 6,
|
2024-03-22 17:22:43 +01:00
|
|
|
show_date_in_top_panel: true,
|
2024-05-25 05:16:25 +02:00
|
|
|
show_weekday: false,
|
2025-11-07 13:42:36 -05:00
|
|
|
format_strftime: Default::default(),
|
2024-03-22 17:22:43 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|