Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Workspace): add missing settings and update design #557

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

400 changes: 361 additions & 39 deletions cosmic-settings/src/pages/desktop/workspaces.rs

Large diffs are not rendered by default.

21 changes: 1 addition & 20 deletions cosmic-settings/src/pages/input/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::app;
use crate::{app, utils::system_has_touchpad};
use cosmic::{
cosmic_config::{self, ConfigGet, ConfigSet},
Task,
Expand Down Expand Up @@ -200,22 +200,3 @@ impl page::AutoBind<crate::pages::Message> for Page {
}
}
}

/// Uses `udev` to check if a touchpad device exists on the system.
fn system_has_touchpad() -> bool {
let Ok(mut enumerator) = udev::Enumerator::new() else {
return false;
};

let _res = enumerator.match_subsystem("input");

let Ok(mut devices) = enumerator.scan_devices() else {
return false;
};

devices.any(|device| {
device
.property_value("ID_INPUT_TOUCHPAD")
.map_or(false, |value| value == "1")
})
}
19 changes: 19 additions & 0 deletions cosmic-settings/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,25 @@ pub fn map_stderr_output(result: io::Result<process::Output>) -> Result<(), Stri
})
}

/// Uses `udev` to check if a touchpad device exists on the system.
pub fn system_has_touchpad() -> bool {
let Ok(mut enumerator) = udev::Enumerator::new() else {
return false;
};

let _res = enumerator.match_subsystem("input");

let Ok(mut devices) = enumerator.scan_devices() else {
return false;
};

devices.any(|device| {
device
.property_value("ID_INPUT_TOUCHPAD")
.map_or(false, |value| value == "1")
})
}

/// Creates a slab with predefined items
#[macro_export]
macro_rules! slab {
Expand Down
15 changes: 15 additions & 0 deletions i18n/en/cosmic_settings.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,21 @@ workspaces-overview-thumbnails = Workspace Overview Thumbnails
workspaces-orientation = Workspaces Orientation
.vertical = Vertical
.horizontal = Horizontal
.thumbnail-placement = Thumbnail placement
.left = Left
.right = Right
.top = Top
.bottom = Bottom
.trackpad-gestures = Trackpad gestures
.switch-workspace = Switch Workspace with Four-Finger
.open-workspaces = Open Workspaces with Four-Finger
.open-applications = Open Applications with Four-Finger
.swipe-horizontal = Swipe Left/Right
.swipe-vertical = Swipe Up/Down
.swipe-up = Swipe Up
.swipe-down = Swipe Down
.swipe-left = Swipe Left
.swipe-right = Swipe Right

hot-corner = Hot Corner
.top-left-corner = Enable top-left hot corner for Workspaces
Expand Down
15 changes: 15 additions & 0 deletions i18n/fr/cosmic_settings.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,21 @@ workspaces-overview-thumbnails = Vignettes de l'aperçu des espaces de travail
workspaces-orientation = Orientation des espaces de travail
.vertical = Verticale
.horizontal = Horizontale
.thumbnail-placement = Positionnement des aperçus
.left = Gauche
.right = Droite
.top = Haut
.bottom = Bas
.trackpad-gestures = Gestes sur le pavé tactile
.switch-workspace = Changement de l'espace de travail avec quatre doigts
.open-workspaces = Overture des espaces de travails avec quatre doigts
.open-applications = Overture des applications avec quatre doigts
.swipe-horizontal = Balayage à Gauche/Droite
.swipe-vertical = Balayage en Haut/Bas
.swipe-up = Balayage en Haut
.swipe-down = Balayage en Bas
.swipe-left = Balayage à Gauche
.swipe-right = Balayage à Droite

hot-corner = Coin actif
.top-left-corner = Activer le coin actif en haut à gauche pour les espaces de travail
Expand Down
9 changes: 9 additions & 0 deletions resources/assets/trackpad-gesture-swipe-down-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions resources/assets/trackpad-gesture-swipe-down-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions resources/assets/trackpad-gesture-swipe-horizontal-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading