improve styling

This commit is contained in:
Ashley Wulber 2022-01-14 11:17:36 -05:00
parent 8737c39a70
commit 7ac16fb414
2 changed files with 9 additions and 3 deletions

View file

@ -1,10 +1,11 @@
listview row:hover {
listview row:selected {
transition: 100ms;
background: #888888;
border-radius: 8px;
}
listview row {
transition: 100ms;
background: #333333;
border-radius: 8px;
}

View file

@ -89,7 +89,12 @@ impl Window {
let model = gio::ListStore::new(SearchResultObject::static_type());
let slice_model = gtk4::SliceListModel::new(Some(&model), 0, NUM_LAUNCHER_ITEMS.into());
let selection_model = gtk4::NoSelection::new(Some(&slice_model));
let selection_model = gtk4::SingleSelection::builder()
.model(&slice_model)
.autoselect(false)
.can_unselect(true)
.selected(gtk4::INVALID_LIST_POSITION)
.build();
imp.model.set(model).expect("Could not set model");
// Wrap model with selection and pass it to the list view
@ -135,7 +140,7 @@ impl Window {
dbg!(i);
let model = list_view.model()
.expect("List view missing selection model")
.downcast::<gtk4::NoSelection>()
.downcast::<gtk4::SingleSelection>()
.expect("could not downcast listview model to no selection model");
if i >= model.n_items() {