diff --git a/resources/i18n/de/cosmic_comp.ftl b/resources/i18n/de/cosmic_comp.ftl index 4ea47bb0..bb146e1c 100644 --- a/resources/i18n/de/cosmic_comp.ftl +++ b/resources/i18n/de/cosmic_comp.ftl @@ -1,5 +1,27 @@ +a11y-zoom-move-continuously = Ansicht bewegt kontinuierlich sich mit dem Cursor +a11y-zoom-move-onedge = Ansicht bewegt sich an den Rändern +a11y-zoom-move-centered = Ansicht hält Cursor zentriert +a11y-zoom-settings = Bildschirmlupe-Einstellungen... grow-window = Vergrößern shrink-window = Verkleinern swap-windows = Fenster tauschen stack-windows = Fenster stapeln -unknown-keybinding = \ No newline at end of file +unknown-keybinding = +window-menu-minimize = Minimieren +window-menu-maximize = Maximieren +window-menu-tiled = Schwebendes Fenster +window-menu-screenshot = Bildschirmfoto aufnehmen +window-menu-move = Bewegen +window-menu-resize = Größe anpassen +window-menu-move-prev-workspace = Zur vorherigen Arbeitsfläche verschieben +window-menu-move-next-workspace = Zur nächsten Arbeitsfläche verschieben +window-menu-stack = Fensterstapel erstellen +window-menu-unstack-all = Fensterstapel auflösen +window-menu-unstack = Fenster aus Stapel lösen +window-menu-sticky = Klebendes Fenster +window-menu-close = Schließen +window-menu-close-all = Schließe alle Fenster +window-menu-resize-edge-top = Oben +window-menu-resize-edge-left = Links +window-menu-resize-edge-right = Rechts +window-menu-resize-edge-bottom = Unten \ No newline at end of file diff --git a/resources/i18n/en/cosmic_comp.ftl b/resources/i18n/en/cosmic_comp.ftl index aade9afe..f11267dc 100644 --- a/resources/i18n/en/cosmic_comp.ftl +++ b/resources/i18n/en/cosmic_comp.ftl @@ -1,3 +1,7 @@ +a11y-zoom-move-continuously = View moves continuously with pointer +a11y-zoom-move-onedge = View moves when pointer reaches edge +a11y-zoom-move-centered = View moves to keep pointer centered +a11y-zoom-settings = Magnifier settings... grow-window = Grow shrink-window = Shrink swap-windows = Swap Windows diff --git a/src/shell/zoom.rs b/src/shell/zoom.rs index 369ecc07..bf215ae3 100644 --- a/src/shell/zoom.rs +++ b/src/shell/zoom.rs @@ -8,6 +8,7 @@ use cosmic::{ Apply, }; use cosmic_comp_config::ZoomMovement; +use cosmic_config::ConfigSet; use keyframe::{ease, functions::EaseInOutCubic}; use smithay::{ backend::renderer::{element::AsRenderElements, ImportMem, Renderer}, @@ -28,6 +29,7 @@ use smithay::{ output::Output, utils::{IsAlive, Point, Rectangle, Serial, Size}, }; +use tracing::error; use crate::{ state::State, @@ -549,21 +551,38 @@ impl Program for ZoomProgram { start_data, &seat, vec![ - Item::new("View moves with pointer", move |handle| { - let _ = handle.insert_idle(move |state| { - state - .common - .config - .cosmic_conf - .accessibility_zoom - .view_moves = ZoomMovement::Continuously; - state.common.update_config(); - // TODO: Write config - }); - }) + Item::new( + crate::fl!("a11y-zoom-move-continuously"), + move |handle| { + let _ = handle.insert_idle(move |state| { + state + .common + .config + .cosmic_conf + .accessibility_zoom + .view_moves = ZoomMovement::Continuously; + if let Err(err) = + state.common.config.cosmic_helper.set( + "accessibility_zoom", + state + .common + .config + .cosmic_conf + .accessibility_zoom, + ) + { + error!( + ?err, + "Failed to update zoom config" + ); + state.common.update_config(); + } + }); + }, + ) .toggled(movement == ZoomMovement::Continuously), Item::new( - "View moves when pointer reaches edge", + crate::fl!("a11y-zoom-move-onedge"), move |handle| { let _ = handle.insert_idle(move |state| { state @@ -572,14 +591,28 @@ impl Program for ZoomProgram { .cosmic_conf .accessibility_zoom .view_moves = ZoomMovement::OnEdge; - state.common.update_config(); - // TODO: Write config + if let Err(err) = + state.common.config.cosmic_helper.set( + "accessibility_zoom", + state + .common + .config + .cosmic_conf + .accessibility_zoom, + ) + { + error!( + ?err, + "Failed to update zoom config" + ); + state.common.update_config(); + } }); }, ) .toggled(movement == ZoomMovement::OnEdge), Item::new( - "View moves to keep pointer centered", + crate::fl!("a11y-zoom-move-centered"), move |handle| { let _ = handle.insert_idle(move |state| { state @@ -588,13 +621,33 @@ impl Program for ZoomProgram { .cosmic_conf .accessibility_zoom .view_moves = ZoomMovement::Centered; - state.common.update_config(); - // TODO: Write config + if let Err(err) = + state.common.config.cosmic_helper.set( + "accessibility_zoom", + state + .common + .config + .cosmic_conf + .accessibility_zoom, + ) + { + error!( + ?err, + "Failed to update zoom config" + ); + state.common.update_config(); + } }); }, ) .toggled(movement == ZoomMovement::Centered), - Item::new("Magnifier settings...", |_| { /* TODO */ }), + Item::new(crate::fl!("a11y-zoom-settings"), |handle| { + let _ = handle.insert_idle(move |state| { + state.spawn_command( + "cosmic-settings page-accessibility".into(), + ); + }); + }), ] .into_iter(), position.to_global(&output).to_i32_round(),