Add searchable input controls and display profile editing
This commit is contained in:
1 parent
78ce1ed590
commit
a2be421974
24 files changed
+3426
-249
No files matched your search
@@ -18,6 +18,9 @@ pub enum Page {
|
||||
Displays,
|
||||
Connections,
|
||||
Calendar,
|
||||
Mouse,
|
||||
Touchpad,
|
||||
Shell,
|
||||
}
|
||||
|
||||
impl Page {
|
||||
@@ -29,7 +32,14 @@ impl Page {
|
||||
),
|
||||
(
|
||||
"Interaction",
|
||||
&[Self::Windows, Self::Keyboard, Self::Accessibility],
|
||||
&[
|
||||
Self::Windows,
|
||||
Self::Keyboard,
|
||||
Self::Mouse,
|
||||
Self::Touchpad,
|
||||
Self::Shortcuts,
|
||||
Self::Accessibility,
|
||||
],
|
||||
),
|
||||
(
|
||||
"System",
|
||||
@@ -49,7 +59,7 @@ impl Page {
|
||||
pub fn navigation_page(self) -> Self {
|
||||
match self {
|
||||
Self::Motion => Self::Windows,
|
||||
Self::Shortcuts => Self::Keyboard,
|
||||
Self::Shell => Self::Bar,
|
||||
_ => self,
|
||||
}
|
||||
}
|
||||
@@ -57,10 +67,7 @@ impl Page {
|
||||
pub fn subpages(self) -> &'static [(Self, &'static str)] {
|
||||
match self.navigation_page() {
|
||||
Self::Windows => &[(Self::Windows, "Windows"), (Self::Motion, "Motion")],
|
||||
Self::Keyboard => &[
|
||||
(Self::Keyboard, "Keyboard & mouse"),
|
||||
(Self::Shortcuts, "Shortcuts"),
|
||||
],
|
||||
Self::Bar => &[(Self::Bar, "Panel"), (Self::Shell, "Shell")],
|
||||
_ => &[],
|
||||
}
|
||||
}
|
||||
@@ -77,7 +84,7 @@ impl Page {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub const ALL: [Self; 18] = [
|
||||
pub const ALL: [Self; 21] = [
|
||||
Self::Appearance,
|
||||
Self::General,
|
||||
Self::Theme,
|
||||
@@ -96,6 +103,9 @@ impl Page {
|
||||
Self::Displays,
|
||||
Self::Connections,
|
||||
Self::Calendar,
|
||||
Self::Mouse,
|
||||
Self::Touchpad,
|
||||
Self::Shell,
|
||||
];
|
||||
|
||||
pub fn title(self) -> &'static str {
|
||||
@@ -115,7 +125,10 @@ impl Page {
|
||||
Self::LockScreen => "Lock screen",
|
||||
Self::Windows => "Windows",
|
||||
Self::Motion => "Motion",
|
||||
Self::Keyboard => "Keyboard & mouse",
|
||||
Self::Keyboard => "Keyboard",
|
||||
Self::Mouse => "Mouse",
|
||||
Self::Touchpad => "Touchpad",
|
||||
Self::Shell => "Shell",
|
||||
Self::Shortcuts => "Shortcuts",
|
||||
Self::Startup => "Login items",
|
||||
Self::Displays => "Displays",
|
||||
@@ -140,7 +153,10 @@ impl Page {
|
||||
Self::LockScreen => "Your desktop, safely put away.",
|
||||
Self::Windows => "Window layouts, spacing and focus effects.",
|
||||
Self::Motion => "Animations and transition speed.",
|
||||
Self::Keyboard => "Keyboard layouts, pointer behavior and touchpad gestures.",
|
||||
Self::Keyboard => "Keyboard layouts, variants and repeat behavior.",
|
||||
Self::Mouse => "Mouse buttons, pointer movement and scrolling.",
|
||||
Self::Touchpad => "Touchpad taps, scrolling and gestures.",
|
||||
Self::Shell => "Shared surfaces, launcher and system menus.",
|
||||
Self::Shortcuts => "Keyboard shortcuts and swipe actions.",
|
||||
Self::Startup => "Ready when you sign in.",
|
||||
Self::Displays => "A place for every screen.",
|
||||
@@ -173,6 +189,9 @@ impl Page {
|
||||
Self::Keyboard => {
|
||||
"M3 6h18v12H3z M6 9h.01 M10 9h.01 M14 9h.01 M18 9h.01 M6 12h.01 M10 12h.01 M14 12h.01 M18 12h.01 M8 15h8"
|
||||
}
|
||||
Self::Mouse => "M8 10V7a4 4 0 0 1 8 0v10a4 4 0 0 1-8 0z M12 3v7 M8 10h8",
|
||||
Self::Touchpad => "M3 5h18v14H3z M3 15h18 M12 15v4",
|
||||
Self::Shell => "M3 4h18v16H3z M3 9h18 M8 9v11",
|
||||
Self::Shortcuts => {
|
||||
"M8 8h8v8H8z M8 8H5a3 3 0 1 1 3-3v3z M16 8V5a3 3 0 1 1 3 3h-3z M16 16h3a3 3 0 1 1-3 3v-3z M8 16v3a3 3 0 1 1-3-3h3z"
|
||||
}
|
||||
@@ -552,7 +571,7 @@ pub fn fields(page: Page) -> Vec<Field> {
|
||||
},
|
||||
),
|
||||
],
|
||||
Page::Bar => vec![
|
||||
Page::Shell => vec![
|
||||
range(
|
||||
"theme.geometry.shell_radius",
|
||||
"Shell corner radius",
|
||||
@@ -586,6 +605,8 @@ pub fn fields(page: Page) -> Vec<Field> {
|
||||
integer: false,
|
||||
},
|
||||
),
|
||||
],
|
||||
Page::Bar => vec![
|
||||
range(
|
||||
"panels.0.geometry.height",
|
||||
"Height",
|
||||
@@ -867,43 +888,8 @@ pub fn fields(page: Page) -> Vec<Field> {
|
||||
integer: true,
|
||||
},
|
||||
),
|
||||
toggle(
|
||||
"input.touchpad.tap",
|
||||
"Tap to click",
|
||||
"Tap the touchpad to click. Updates connected devices immediately.",
|
||||
true,
|
||||
),
|
||||
toggle(
|
||||
"input.touchpad.natural_scroll",
|
||||
"Natural scrolling",
|
||||
"Move content in the direction of your fingers. Updates immediately.",
|
||||
true,
|
||||
),
|
||||
toggle(
|
||||
"input.touchpad.disable_while_typing",
|
||||
"Ignore touchpad while typing",
|
||||
"Avoid accidental pointer movement.",
|
||||
true,
|
||||
),
|
||||
toggle(
|
||||
"input.touchpad.disable_while_mouse_connected",
|
||||
"Disable touchpad with a mouse",
|
||||
"Pause the built-in touchpad while an external mouse is connected.",
|
||||
false,
|
||||
),
|
||||
range(
|
||||
"input.touchpad.accel_speed",
|
||||
"Touchpad speed",
|
||||
"Adjust pointer acceleration for the touchpad.",
|
||||
RangeSpec {
|
||||
default: 0.0,
|
||||
min: -1.0,
|
||||
max: 1.0,
|
||||
step: 0.05,
|
||||
suffix: "",
|
||||
integer: false,
|
||||
},
|
||||
),
|
||||
],
|
||||
Page::Mouse => vec![
|
||||
toggle(
|
||||
"input.mouse.natural_scroll",
|
||||
"Mouse natural scrolling",
|
||||
@@ -948,6 +934,45 @@ pub fn fields(page: Page) -> Vec<Field> {
|
||||
integer: false,
|
||||
},
|
||||
),
|
||||
],
|
||||
Page::Touchpad => vec![
|
||||
toggle(
|
||||
"input.touchpad.tap",
|
||||
"Tap to click",
|
||||
"Tap the touchpad to click. Updates connected devices immediately.",
|
||||
true,
|
||||
),
|
||||
toggle(
|
||||
"input.touchpad.natural_scroll",
|
||||
"Natural scrolling",
|
||||
"Move content in the direction of your fingers. Updates immediately.",
|
||||
true,
|
||||
),
|
||||
toggle(
|
||||
"input.touchpad.disable_while_typing",
|
||||
"Ignore touchpad while typing",
|
||||
"Avoid accidental pointer movement.",
|
||||
true,
|
||||
),
|
||||
toggle(
|
||||
"input.touchpad.disable_while_mouse_connected",
|
||||
"Disable touchpad with a mouse",
|
||||
"Pause the built-in touchpad while an external mouse is connected.",
|
||||
false,
|
||||
),
|
||||
range(
|
||||
"input.touchpad.accel_speed",
|
||||
"Touchpad speed",
|
||||
"Adjust pointer acceleration for the touchpad.",
|
||||
RangeSpec {
|
||||
default: 0.0,
|
||||
min: -1.0,
|
||||
max: 1.0,
|
||||
step: 0.05,
|
||||
suffix: "",
|
||||
integer: false,
|
||||
},
|
||||
),
|
||||
range(
|
||||
"input.touchpad.swipe_threshold",
|
||||
"Swipe distance",
|
||||
@@ -1055,6 +1080,9 @@ pub fn grouped_fields(page: Page, fields: Vec<Field>) -> Vec<FieldGroup> {
|
||||
"Focus and window effects"
|
||||
}
|
||||
}
|
||||
Page::Shell => "Shell surfaces",
|
||||
Page::Mouse => "Mouse",
|
||||
Page::Touchpad => "Touchpad",
|
||||
Page::Keyboard => {
|
||||
if p.starts_with("input.xkb_") {
|
||||
"Keyboard layout"
|
||||
@@ -1173,9 +1201,10 @@ mod group_tests {
|
||||
actual.sort();
|
||||
assert_eq!(actual, expected, "{page:?}");
|
||||
}
|
||||
let keyboard = grouped_fields(Page::Keyboard, fields(Page::Keyboard));
|
||||
let mouse = grouped_fields(Page::Mouse, fields(Page::Mouse));
|
||||
let touchpad = grouped_fields(Page::Touchpad, fields(Page::Touchpad));
|
||||
assert!(
|
||||
keyboard
|
||||
mouse
|
||||
.iter()
|
||||
.find(|g| g.title == "Mouse")
|
||||
.unwrap()
|
||||
@@ -1184,7 +1213,7 @@ mod group_tests {
|
||||
.all(|f| f.path.starts_with("input.mouse."))
|
||||
);
|
||||
assert!(
|
||||
keyboard
|
||||
touchpad
|
||||
.iter()
|
||||
.find(|g| g.title == "Touchpad")
|
||||
.unwrap()
|
||||
|
||||
Reference in new issue
Block a user