summaryrefslogtreecommitdiffstats
path: root/widget
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-07-29 00:54:23 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-07-29 00:54:23 +0200
commit6734d183594ebf89b8e6c030ea69d53ecb6b72db (patch)
treefa16d5560ba2eb92d37ae11905b87ce0308cdc56 /widget
parent695721e120a173817125265a35afbc49813db716 (diff)
downloadiced-6734d183594ebf89b8e6c030ea69d53ecb6b72db.tar.gz
iced-6734d183594ebf89b8e6c030ea69d53ecb6b72db.tar.bz2
iced-6734d183594ebf89b8e6c030ea69d53ecb6b72db.zip
Simplify `focus` method in `text_editor`
Diffstat (limited to 'widget')
-rw-r--r--widget/src/text_editor.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs
index bc391be3..a264ba06 100644
--- a/widget/src/text_editor.rs
+++ b/widget/src/text_editor.rs
@@ -424,13 +424,7 @@ impl<Highlighter: text::Highlighter> operation::Focusable
}
fn focus(&mut self) {
- let now = Instant::now();
-
- self.focus = Some(Focus {
- updated_at: now,
- now,
- is_window_focused: true,
- });
+ self.focus = Some(Focus::now());
}
fn unfocus(&mut self) {