R9.5: merge PR #6, ElyTable completion keys and overlay clicks
Enter and Tab are resolved by the worker against the kernel's current candidates, after the typing queued before them. The dropdown arrow's mouse blocker is at least as tall as the button.
This commit is contained in:
22 files changed
+696
-48
No files matched your search
@@ -76,12 +76,26 @@ impl Doc {
|
||||
Unpack::new(&payload).str()
|
||||
}
|
||||
|
||||
/// Completes the function name being typed (TABLE-03).
|
||||
pub fn complete_function(&self, worker: &mut Worker, name: &str) -> io::Result<()> {
|
||||
log::info!("lok: completes a function");
|
||||
let request = Pack::new().u64(worker.doc_id(self)?).str(name).bytes();
|
||||
worker.request(tag::COMPLETE_FUNCTION, &request)?;
|
||||
Ok(())
|
||||
/// Completes `name` if offered; a key takes any, else goes in (TABLE-03).
|
||||
pub fn complete_function(
|
||||
&self,
|
||||
worker: &mut Worker,
|
||||
name: Option<&str>,
|
||||
key: Option<(u32, i32)>,
|
||||
) -> io::Result<bool> {
|
||||
let pack = Pack::new().u64(worker.doc_id(self)?);
|
||||
let pack = match name {
|
||||
Some(name) => pack.u64(1).str(name),
|
||||
None => pack.u64(0),
|
||||
};
|
||||
// Key code 0: no key, as for a click.
|
||||
let (char_code, key_code) = key.unwrap_or((0, 0));
|
||||
let request = pack
|
||||
.i64(i64::from(char_code))
|
||||
.i64(i64::from(key_code))
|
||||
.bytes();
|
||||
let reply = worker.request(tag::COMPLETE_FUNCTION, &request)?;
|
||||
Ok(Unpack::new(&reply).u64()? == 1)
|
||||
}
|
||||
|
||||
/// Shows sheet `part`, from 0.
|
||||
|
||||
Reference in new issue
Block a user