Replaced Entry with SearchEntry
This allows the search field to be cleared with a button.
This commit is contained in:
parent
0a91ca0ccd
commit
d4e14aac95
1 changed files with 2 additions and 2 deletions
|
|
@ -51,7 +51,7 @@ fn main() {
|
||||||
vbox.set_margin_bottom(16);
|
vbox.set_margin_bottom(16);
|
||||||
window.set_child(Some(&vbox));
|
window.set_child(Some(&vbox));
|
||||||
|
|
||||||
let search = gtk::Entry::new();
|
let search = gtk::SearchEntry::new();
|
||||||
search.set_placeholder_text(Some(" Type to search apps, or type '?' for more options."));
|
search.set_placeholder_text(Some(" Type to search apps, or type '?' for more options."));
|
||||||
vbox.append(&search);
|
vbox.append(&search);
|
||||||
|
|
||||||
|
|
@ -60,7 +60,7 @@ fn main() {
|
||||||
|
|
||||||
{
|
{
|
||||||
let launcher = launcher.clone();
|
let launcher = launcher.clone();
|
||||||
let search_changed = move |search: >k::Entry| {
|
let search_changed = move |search: >k::SearchEntry| {
|
||||||
//TODO: is this the best way to clear a listbox?
|
//TODO: is this the best way to clear a listbox?
|
||||||
while let Some(child) = listbox.last_child() {
|
while let Some(child) = listbox.last_child() {
|
||||||
listbox.remove(&child);
|
listbox.remove(&child);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue