Skip to content

Commit b12a96d

Browse files
authored
Merge pull request #213 from unsecretised/clipboard-bug-fix
Clipboard bug fix
2 parents 245d867 + 1056b8b commit b12a96d

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/app/tile/elm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ pub fn view(tile: &Tile, wid: window::Id) -> Element<'_, Message> {
153153
let height = match tile.page {
154154
Page::ClipboardHistory | Page::Settings => 385,
155155
// Height of each emoji is EMOJI_HEIGHT + 20 for padding
156-
Page::EmojiSearch => std::cmp::min(((tile.results.len() + 6 - 1) / 6) * 90, 290),
156+
Page::EmojiSearch => std::cmp::min(tile.results.len().div_ceil(6) * 90, 290),
157157
_ => std::cmp::min(tile.results.len() * 60, 290),
158158
};
159159

src/app/tile/update.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,16 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task<Message> {
215215
}
216216

217217
Message::OpenFocused => {
218-
// TODO: update ranking here
219-
match tile.results.get(tile.focus_id as usize) {
218+
info!("Open Focussed called");
219+
let results = if tile.page == Page::ClipboardHistory {
220+
tile.clipboard_content
221+
.iter()
222+
.map(|x| x.to_app().to_owned())
223+
.collect()
224+
} else {
225+
tile.results.clone()
226+
};
227+
match results.get(tile.focus_id as usize) {
220228
Some(App {
221229
search_name: name,
222230
open_command: AppCommand::Function(func),

0 commit comments

Comments
 (0)