|
|
|
@ -167,6 +167,17 @@ impl Config { |
|
|
|
|
.expect("No focus.lockin_delay defined."), |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pub fn get_focus_sequence_timeout(&self) -> Option<Duration> { |
|
|
|
|
self.focus |
|
|
|
|
.as_ref() |
|
|
|
|
.and_then(|f| f.sequence_timeout) |
|
|
|
|
.or_else(|| Focus::default().sequence_timeout) |
|
|
|
|
.and_then(|d| match d { |
|
|
|
|
0 => None, |
|
|
|
|
_ => Some(Duration::from_millis(d)), |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize)] |
|
|
|
@ -214,6 +225,7 @@ impl Layout { |
|
|
|
|
#[derive(Debug, Serialize, Deserialize)] |
|
|
|
|
pub struct Focus { |
|
|
|
|
lockin_delay: Option<u64>, |
|
|
|
|
sequence_timeout: Option<u64>, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
impl Default for Menu { |
|
|
|
@ -311,6 +323,7 @@ impl Default for Focus { |
|
|
|
|
fn default() -> Self { |
|
|
|
|
Self { |
|
|
|
|
lockin_delay: Some(750), |
|
|
|
|
sequence_timeout: None, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|