Skip to content

Commit

Permalink
Improve Performance
Browse files Browse the repository at this point in the history
  • Loading branch information
mdgaziur committed Nov 12, 2021
1 parent 51cacb9 commit 80364a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
5 changes: 0 additions & 5 deletions src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ fn on_key_press(qb: &Entry, ev: &EventKey) -> Inhibit {
fn on_text_changed(qb: &Entry, apps: &[AppInfo]) {
let text = regex::escape(&qb.text().to_lowercase());
if text.is_empty() {
let list_box = get_list_box(qb);
clear_listbox(&list_box);
for app in apps {
add_app_to_listbox(&list_box, app);
}
return;
}

Expand Down
7 changes: 4 additions & 3 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ pub fn init_window(app: &Application) {

let search_box = init_query(&desktop_entries);
let list_box = init_search_result();
for app in &desktop_entries {
add_app_to_listbox(&list_box, &app);
}

let scw = ScrolledWindow::builder()
.min_content_height(400)
Expand All @@ -81,4 +78,8 @@ pub fn init_window(app: &Application) {
);

win.show_all();

for app in &desktop_entries {
add_app_to_listbox(&list_box, &app);
}
}

0 comments on commit 80364a8

Please sign in to comment.