1 use std::time::Duration;
2 
3 use alacritty_config_derive::ConfigDeserialize;
4 
5 #[derive(ConfigDeserialize, Default, Clone, Debug, PartialEq, Eq)]
6 pub struct Mouse {
7     pub double_click: ClickHandler,
8     pub triple_click: ClickHandler,
9     pub hide_when_typing: bool,
10     #[config(deprecated = "use `hints` section instead")]
11     pub url: Option<serde_yaml::Value>,
12 }
13 
14 #[derive(ConfigDeserialize, Clone, Debug, PartialEq, Eq)]
15 pub struct ClickHandler {
16     threshold: u16,
17 }
18 
19 impl Default for ClickHandler {
default() -> Self20     fn default() -> Self {
21         Self { threshold: 300 }
22     }
23 }
24 
25 impl ClickHandler {
threshold(&self) -> Duration26     pub fn threshold(&self) -> Duration {
27         Duration::from_millis(self.threshold as u64)
28     }
29 }
30