diff options
author | Ricky Kresslein <ricky@unobserved.io> | 2023-10-15 11:18:48 +0200 |
---|---|---|
committer | Ricky Kresslein <ricky@unobserved.io> | 2023-10-15 11:18:48 +0200 |
commit | a7259d8cabadf9f35c29368837d90cdaa8b6bdd1 (patch) | |
tree | c78e9cdcd69b1e23cfc12e500d1b6050b6a61d84 /src/ui/window.rs | |
parent | 17c269b9d51850e09087653f24e02825fd2079f3 (diff) | |
download | Furtherance-a7259d8cabadf9f35c29368837d90cdaa8b6bdd1.tar.zst |
Fix autocomplete preference bugs
Diffstat (limited to 'src/ui/window.rs')
-rw-r--r-- | src/ui/window.rs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/ui/window.rs b/src/ui/window.rs index 6160bdc..8591038 100644 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -163,6 +163,15 @@ impl FurtheranceWindow { imp.history_box.create_tasks_page(); } + pub fn reset_autocomplete(&self) { + let imp = imp::FurtheranceWindow::from_obj(self); + if settings_manager::get_bool("autocomplete") { + imp.task_input.set_completion(Some(&FurtheranceWindow::create_autocomplete())); + } else { + imp.task_input.set_completion(None); + } + } + fn setup_widgets(&self) { let imp = imp::FurtheranceWindow::from_obj(self); @@ -214,10 +223,12 @@ impl FurtheranceWindow { imp2.start_button.set_sensitive(true); } - if task_input.text().len() >= FurtheranceWindow::MIN_PREFIX_LENGTH.try_into().unwrap() { - let task_autocomplete = task_input.completion().unwrap(); - let model = Self::update_list_model(task_name.to_string(), split_tags).unwrap(); - task_autocomplete.set_model(Some(&model)); + if settings_manager::get_bool("autocomplete") { + if task_input.text().len() >= FurtheranceWindow::MIN_PREFIX_LENGTH.try_into().unwrap() { + let task_autocomplete = task_input.completion().unwrap(); + let model = Self::update_list_model(task_name.to_string(), split_tags).unwrap(); + task_autocomplete.set_model(Some(&model)); + } } })); |