disable word selection if is_secure == true

This commit is contained in:
FabianLars 2020-02-27 12:13:47 +01:00
parent 1ad83889be
commit 767096b9bb

View file

@ -214,14 +214,18 @@ where
match self.state.mouse.update(cursor_position) { match self.state.mouse.update(cursor_position) {
Interaction::DoubleClick(_) => { Interaction::DoubleClick(_) => {
let end = self.state.cursor.end(); if self.is_secure {
self.state.cursor.select_range( self.state.cursor.select_all(&self.value);
self.value.previous_start_of_word(end), } else {
self.value.next_end_of_word(end), let end = self.state.cursor.end();
) self.state.cursor.select_range(
self.value.previous_start_of_word(end),
self.value.next_end_of_word(end),
);
}
} }
Interaction::TripleClick(_) => { Interaction::TripleClick(_) => {
self.state.cursor.select_all(&self.value) self.state.cursor.select_all(&self.value);
} }
Interaction::Click(_) => { Interaction::Click(_) => {
if target > 0.0 { if target > 0.0 {