config: Add zoom configuration
This commit is contained in:
parent
c01de20b2b
commit
55d1ce5e3b
2 changed files with 33 additions and 1 deletions
|
|
@ -48,6 +48,7 @@ pub struct CosmicCompConfig {
|
||||||
pub descale_xwayland: bool,
|
pub descale_xwayland: bool,
|
||||||
/// The threshold before windows snap themselves to output edges
|
/// The threshold before windows snap themselves to output edges
|
||||||
pub edge_snap_threshold: u32,
|
pub edge_snap_threshold: u32,
|
||||||
|
pub accessibility_zoom: ZoomConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for CosmicCompConfig {
|
impl Default for CosmicCompConfig {
|
||||||
|
|
@ -79,6 +80,7 @@ impl Default for CosmicCompConfig {
|
||||||
focus_follows_cursor_delay: 250,
|
focus_follows_cursor_delay: 250,
|
||||||
descale_xwayland: false,
|
descale_xwayland: false,
|
||||||
edge_snap_threshold: 0,
|
edge_snap_threshold: 0,
|
||||||
|
accessibility_zoom: ZoomConfig::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -124,3 +126,27 @@ fn default_repeat_rate() -> u32 {
|
||||||
fn default_repeat_delay() -> u32 {
|
fn default_repeat_delay() -> u32 {
|
||||||
600
|
600
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
|
pub struct ZoomConfig {
|
||||||
|
pub start_on_login: bool,
|
||||||
|
pub increment: u32,
|
||||||
|
pub view_moves: ZoomMovement,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Default for ZoomConfig {
|
||||||
|
fn default() -> Self {
|
||||||
|
ZoomConfig {
|
||||||
|
start_on_login: false,
|
||||||
|
increment: 100,
|
||||||
|
view_moves: ZoomMovement::OnEdge,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
|
pub enum ZoomMovement {
|
||||||
|
OnEdge,
|
||||||
|
Centered,
|
||||||
|
Continuously,
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ pub use self::types::*;
|
||||||
use cosmic::config::CosmicTk;
|
use cosmic::config::CosmicTk;
|
||||||
use cosmic_comp_config::{
|
use cosmic_comp_config::{
|
||||||
input::InputConfig, workspace::WorkspaceConfig, CosmicCompConfig, KeyboardConfig, TileBehavior,
|
input::InputConfig, workspace::WorkspaceConfig, CosmicCompConfig, KeyboardConfig, TileBehavior,
|
||||||
XkbConfig,
|
XkbConfig, ZoomConfig,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
@ -852,6 +852,12 @@ fn config_changed(config: cosmic_config::Config, keys: Vec<String>, state: &mut
|
||||||
state.common.config.cosmic_conf.edge_snap_threshold = new;
|
state.common.config.cosmic_conf.edge_snap_threshold = new;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
"accessibility_zoom" => {
|
||||||
|
let new = get_config::<ZoomConfig>(&config, "accessibility_zoom");
|
||||||
|
if new != state.common.config.cosmic_conf.accessibility_zoom {
|
||||||
|
state.common.config.cosmic_conf.accessibility_zoom = new;
|
||||||
|
}
|
||||||
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue