launcher: Show and return failed match strings
This commit is contained in:
+16
-2
@@ -67,9 +67,19 @@ impl ModuleImpl for Launcher {
|
||||
|
||||
let mut x_off: i32 = 0;
|
||||
let mut width_remaining: i32 = 1280 - 64;
|
||||
if self.matches.len() == 0 && self.cur.len() > 0 {
|
||||
draw_text(
|
||||
ROBOTO_REGULAR,
|
||||
&mut buf.subdimensions((64, 0, width_remaining as u32, 32)).unwrap(),
|
||||
bg,
|
||||
&Color::new(1.0, 0.5, 0.5, 1.0),
|
||||
32.0,
|
||||
&self.cur,
|
||||
)?;
|
||||
} else {
|
||||
for (idx, m) in self.matches.iter().enumerate() {
|
||||
let mut b = match buf.subdimensions((64 + x_off as u32, 0, width_remaining as u32, 32))
|
||||
{
|
||||
let mut b =
|
||||
match buf.subdimensions((64 + x_off as u32, 0, width_remaining as u32, 32)) {
|
||||
Ok(b) => b,
|
||||
Err(_) => break,
|
||||
};
|
||||
@@ -103,6 +113,7 @@ impl ModuleImpl for Launcher {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(vec![buf.get_signed_bounds()])
|
||||
}
|
||||
@@ -153,6 +164,9 @@ impl ModuleImpl for Launcher {
|
||||
if self.matches.len() > self.offset {
|
||||
println!("{}", self.matches[self.offset]);
|
||||
std::process::exit(0);
|
||||
} else {
|
||||
println!("{}", self.cur);
|
||||
std::process::exit(0);
|
||||
}
|
||||
}
|
||||
keysyms::XKB_KEY_Right => {
|
||||
|
||||
Reference in New Issue
Block a user