mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-24 11:31:28 +01:00
Pass selection to grid tile actions
This commit is contained in:
1 file changed
+1
-1
@@ -996,7 +996,7 @@ impl<K: Clone + Eq + Hash + Send + Sync + 'static> Collection for TileGrid<'_, K
|
||||
/// Every tile gets the grid's caption place, detail line and actions' place, the card look, and its row's rename
|
||||
/// state. Under `checks` a tile's check is its own selection, so the app keeps no second copy of it.
|
||||
fn dress<'r>(&self, tile: Self::Item<'r>, row: &RowState) -> Self::Item<'r> {
|
||||
let tile = tile.caption(self.caption).detail_line(self.detail_line).action_place(self.action_place).renaming(row.renaming);
|
||||
let tile = tile.caption(self.caption).detail_line(self.detail_line).action_place(self.action_place).renaming(row.renaming).selected(row.selected);
|
||||
let tile = if self.checks { tile.check(if row.selected { ToggleState::On } else { ToggleState::Off }) } else { tile };
|
||||
if self.card { tile.card() } else { tile }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user