diff --git a/src/app/tile/elm.rs b/src/app/tile/elm.rs index b81bf8b..54132a0 100644 --- a/src/app/tile/elm.rs +++ b/src/app/tile/elm.rs @@ -153,7 +153,7 @@ pub fn view(tile: &Tile, wid: window::Id) -> Element<'_, Message> { let height = match tile.page { Page::ClipboardHistory | Page::Settings => 385, // Height of each emoji is EMOJI_HEIGHT + 20 for padding - Page::EmojiSearch => std::cmp::min(((tile.results.len() + 6 - 1) / 6) * 90, 290), + Page::EmojiSearch => std::cmp::min(tile.results.len().div_ceil(6) * 90, 290), _ => std::cmp::min(tile.results.len() * 60, 290), }; diff --git a/src/app/tile/update.rs b/src/app/tile/update.rs index 93e00ea..ff98f43 100644 --- a/src/app/tile/update.rs +++ b/src/app/tile/update.rs @@ -215,8 +215,16 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task { } Message::OpenFocused => { - // TODO: update ranking here - match tile.results.get(tile.focus_id as usize) { + info!("Open Focussed called"); + let results = if tile.page == Page::ClipboardHistory { + tile.clipboard_content + .iter() + .map(|x| x.to_app().to_owned()) + .collect() + } else { + tile.results.clone() + }; + match results.get(tile.focus_id as usize) { Some(App { search_name: name, open_command: AppCommand::Function(func),