Consolidate desktop controls with editable holidays and a running-window tray
This commit is contained in:
1 parent
9908dde9f8
commit
326465952a
55 files changed
+4207
-450
No files matched your search
@@ -17,6 +17,7 @@ pub enum Page {
|
||||
Startup,
|
||||
Displays,
|
||||
Connections,
|
||||
Calendar,
|
||||
}
|
||||
|
||||
impl Page {
|
||||
@@ -36,6 +37,7 @@ impl Page {
|
||||
Self::Displays,
|
||||
Self::Connections,
|
||||
Self::Notifications,
|
||||
Self::Calendar,
|
||||
Self::LockScreen,
|
||||
Self::Startup,
|
||||
],
|
||||
@@ -75,7 +77,7 @@ impl Page {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub const ALL: [Self; 17] = [
|
||||
pub const ALL: [Self; 18] = [
|
||||
Self::Appearance,
|
||||
Self::General,
|
||||
Self::Theme,
|
||||
@@ -93,6 +95,7 @@ impl Page {
|
||||
Self::Startup,
|
||||
Self::Displays,
|
||||
Self::Connections,
|
||||
Self::Calendar,
|
||||
];
|
||||
|
||||
pub fn title(self) -> &'static str {
|
||||
@@ -117,6 +120,7 @@ impl Page {
|
||||
Self::Startup => "Login items",
|
||||
Self::Displays => "Displays",
|
||||
Self::Connections => "Connections",
|
||||
Self::Calendar => "Calendar",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,6 +145,7 @@ impl Page {
|
||||
Self::Startup => "Ready when you sign in.",
|
||||
Self::Displays => "A place for every screen.",
|
||||
Self::Connections => "Wi-Fi networks and Bluetooth devices.",
|
||||
Self::Calendar => "Calendar, Japanese holiday rules and custom holidays.",
|
||||
})
|
||||
}
|
||||
|
||||
@@ -159,6 +164,9 @@ impl Page {
|
||||
Self::Wallpaper => "M4 4h16v16H4z M4 16l5-5 4 4 3-3 4 4 M15 8h.01",
|
||||
Self::Bar => "M3 5h18v14H3z M3 9h18 M6 7h.01 M18 7h.01",
|
||||
Self::Notifications => "M6 8a6 6 0 0 1 12 0v6l2 3H4l2-3z M10 21h4",
|
||||
Self::Calendar => {
|
||||
"M4 5h16v16H4z M8 3v4 M16 3v4 M4 10h16 M8 14h.01 M12 14h.01 M16 14h.01 M8 18h.01 M12 18h.01"
|
||||
}
|
||||
Self::LockScreen => "M7 10V7a5 5 0 0 1 10 0v3 M5 10h14v11H5z M12 14v3",
|
||||
Self::Windows => "M3 4h12v12H3z M8 9h13v12H8z",
|
||||
Self::Motion => "M3 8h9a3 3 0 1 0-3-3 M3 12h15a3 3 0 1 1-3 3 M3 16h5",
|
||||
@@ -971,6 +979,12 @@ pub fn fields(page: Page) -> Vec<Field> {
|
||||
("en", "English"),
|
||||
],
|
||||
)],
|
||||
Page::Calendar => vec![toggle(
|
||||
"status.calendar.show_adjacent_days",
|
||||
"Show dates from adjacent months",
|
||||
"Display the previous and next month's dates in the calendar.",
|
||||
true,
|
||||
)],
|
||||
Page::Tray => vec![
|
||||
toggle(
|
||||
"status.tray.enabled",
|
||||
@@ -1027,6 +1041,7 @@ pub fn grouped_fields(page: Page, fields: Vec<Field>) -> Vec<FieldGroup> {
|
||||
let p = field.path.as_str();
|
||||
let title = match page {
|
||||
Page::General => "Interface",
|
||||
Page::Calendar => "Calendar display",
|
||||
Page::Windows => {
|
||||
if p.starts_with("workspaces.") || p == "layout.mode" || p.starts_with("scrolling.")
|
||||
{
|
||||
@@ -1115,6 +1130,36 @@ pub fn grouped_fields(page: Page, fields: Vec<Field>) -> Vec<FieldGroup> {
|
||||
mod group_tests {
|
||||
use super::*;
|
||||
#[test]
|
||||
fn every_standard_field_and_choice_has_chinese_interface_text() {
|
||||
use ferese_config::locale::{Language, in_language};
|
||||
for page in Page::ALL {
|
||||
for field in fields(page) {
|
||||
for text in [&field.label, &field.description] {
|
||||
if !text.is_empty() {
|
||||
assert_ne!(
|
||||
in_language(Language::Chinese, text),
|
||||
text,
|
||||
"{}: {text}",
|
||||
field.path
|
||||
);
|
||||
}
|
||||
}
|
||||
if let Kind::Choice { choices, .. } = field.kind {
|
||||
for (_, text) in choices {
|
||||
if !matches!(*text, "English" | "简体中文") {
|
||||
assert_ne!(
|
||||
in_language(Language::Chinese, text),
|
||||
*text,
|
||||
"{}: {text}",
|
||||
field.path
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#[test]
|
||||
fn semantic_groups_keep_every_field_once_and_separate_input_devices() {
|
||||
for page in Page::ALL {
|
||||
let mut expected = fields(page).into_iter().map(|f| f.path).collect::<Vec<_>>();
|
||||
|
||||
Reference in new issue
Block a user