summaryrefslogtreecommitdiff
path: root/src/event.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/event.rs')
-rw-r--r--src/event.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/event.rs b/src/event.rs
index 121c0c42..76e7e111 100644
--- a/src/event.rs
+++ b/src/event.rs
@@ -10,7 +10,7 @@ use std::env;
use serde_json as json;
use parking_lot::MutexGuard;
-use glutin::{self, ModifiersState, Event, ElementState, MouseButton};
+use glutin::{self, ModifiersState, Event, ElementState, MouseButton, MouseCursor};
use copypasta::{Clipboard, Load, Store, Buffer as ClipboardBuffer};
use glutin::dpi::PhysicalSize;
@@ -222,6 +222,13 @@ pub enum ClickState {
TripleClick,
}
+/// Temporary save state for restoring mouse cursor and underline after unhovering a URL.
+pub struct UrlHoverSaveState {
+ pub mouse_cursor: MouseCursor,
+ pub underlined: Vec<bool>,
+ pub start: Point<usize>,
+}
+
/// State of the mouse
pub struct Mouse {
pub x: usize,
@@ -238,6 +245,7 @@ pub struct Mouse {
pub lines_scrolled: f32,
pub block_url_launcher: bool,
pub last_button: MouseButton,
+ pub url_hover_save: Option<UrlHoverSaveState>,
}
impl Default for Mouse {
@@ -257,6 +265,7 @@ impl Default for Mouse {
lines_scrolled: 0.0,
block_url_launcher: false,
last_button: MouseButton::Other(0),
+ url_hover_save: None,
}
}
}