Merge pull request #455 from justintime4tea/feature/item_zoom_on_scroll

feature(convenience): item view zoom on scroll + ctrl
This commit is contained in:
Jeremy Soller 2024-09-16 09:20:10 -06:00 • committed by GitHub
commit 1ee0201596
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 187 additions and 10 deletions

View file

@ -3762,6 +3762,23 @@ pub(crate) mod test_utils {
);
}
pub fn assert_zoom_affects_item_size(
tab: &mut Tab,
message: tab::Message,
should_zoom: bool,
) {
let grid_icon_size = tab.config.icon_sizes.grid;
let list_icon_size = tab.config.icon_sizes.list;
debug!("Emitting {:?}", message);
tab.update(message, Modifiers::empty());
let grid_size_changed = grid_icon_size != tab.config.icon_sizes.grid;
let list_size_changed = list_icon_size != tab.config.icon_sizes.list;
assert_eq!(grid_size_changed || list_size_changed, should_zoom);
}
/// Assert that tab's items are equal to a path's entries.
pub fn assert_eq_tab_path_contents(tab: &Tab, path: &Path) {
let Location::Path(ref tab_path) = tab.location else {