word selection
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use super::*;
|
||||
|
||||
pub fn error(ui: &mut Ui, msg: &str) -> WidgetId {
|
||||
@@ -49,10 +51,13 @@ impl WidgetAttr<TextEdit> for Selectable {
|
||||
}
|
||||
|
||||
fn select(id: WidgetId<TextEdit>, client: &mut Client, data: CursorData) {
|
||||
let now = Instant::now();
|
||||
let recent = (now - client.last_click) < Duration::from_millis(300);
|
||||
client.last_click = now;
|
||||
client
|
||||
.ui
|
||||
.text(&id)
|
||||
.select(data.cursor, data.size, data.sense.is_dragging());
|
||||
.select(data.cursor, data.size, data.sense.is_dragging(), recent);
|
||||
if let Some(region) = client.ui.window_region(&id) {
|
||||
client.handle.window.set_ime_allowed(true);
|
||||
client.handle.window.set_ime_cursor_area(
|
||||
|
||||
Reference in New Issue
Block a user