summaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/config/visual_bell.rs
diff options
context:
space:
mode:
Diffstat (limited to 'alacritty_terminal/src/config/visual_bell.rs')
-rw-r--r--alacritty_terminal/src/config/visual_bell.rs76
1 files changed, 0 insertions, 76 deletions
diff --git a/alacritty_terminal/src/config/visual_bell.rs b/alacritty_terminal/src/config/visual_bell.rs
deleted file mode 100644
index 1a0a327b..00000000
--- a/alacritty_terminal/src/config/visual_bell.rs
+++ /dev/null
@@ -1,76 +0,0 @@
-use std::time::Duration;
-
-use serde::Deserialize;
-
-use crate::config::failure_default;
-use crate::term::color::Rgb;
-
-#[serde(default)]
-#[derive(Deserialize, Clone, Debug, PartialEq, Eq)]
-pub struct VisualBellConfig {
- /// Visual bell animation function.
- #[serde(deserialize_with = "failure_default")]
- pub animation: VisualBellAnimation,
-
- /// Visual bell duration in milliseconds.
- #[serde(deserialize_with = "failure_default")]
- pub duration: u16,
-
- /// Visual bell flash color.
- #[serde(deserialize_with = "failure_default")]
- pub color: Rgb,
-}
-
-impl Default for VisualBellConfig {
- fn default() -> VisualBellConfig {
- VisualBellConfig {
- animation: Default::default(),
- duration: Default::default(),
- color: default_visual_bell_color(),
- }
- }
-}
-
-impl VisualBellConfig {
- /// Visual bell duration in milliseconds.
- #[inline]
- pub fn duration(&self) -> Duration {
- Duration::from_millis(u64::from(self.duration))
- }
-}
-
-/// `VisualBellAnimations` are modeled after a subset of CSS transitions and Robert
-/// Penner's Easing Functions.
-#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Eq)]
-pub enum VisualBellAnimation {
- // CSS animation.
- Ease,
- // CSS animation.
- EaseOut,
- // Penner animation.
- EaseOutSine,
- // Penner animation.
- EaseOutQuad,
- // Penner animation.
- EaseOutCubic,
- // Penner animation.
- EaseOutQuart,
- // Penner animation.
- EaseOutQuint,
- // Penner animation.
- EaseOutExpo,
- // Penner animation.
- EaseOutCirc,
- // Penner animation.
- Linear,
-}
-
-impl Default for VisualBellAnimation {
- fn default() -> Self {
- VisualBellAnimation::EaseOutExpo
- }
-}
-
-fn default_visual_bell_color() -> Rgb {
- Rgb { r: 255, g: 255, b: 255 }
-}