Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/app/tile/elm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,7 @@ pub fn view(tile: &Tile, wid: window::Id) -> Element<'_, Message> {
.padding(20);

let scrollbar_direction = if tile.config.theme.show_scroll_bar {
let anchor = if tile.focus_id > 4 {
Anchor::End
} else {
Anchor::Start
};
Direction::Vertical(Scrollbar::new().width(2).scroller_width(2).anchor(anchor))
Direction::Vertical(Scrollbar::new().width(2).scroller_width(2))
} else {
Direction::Vertical(Scrollbar::hidden())
};
Expand All @@ -141,7 +136,7 @@ pub fn view(tile: &Tile, wid: window::Id) -> Element<'_, Message> {
clipboard_history
}
};
let scrollable = Scrollable::with_direction(results, scrollbar_direction);
let scrollable = Scrollable::with_direction(results, scrollbar_direction).id("results");
let contents = Column::new().push(title_input).push(scrollable);

container(contents)
Expand Down
9 changes: 8 additions & 1 deletion src/app/tile/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use global_hotkey::hotkey::HotKey;
use iced::Task;
use iced::widget::image::Handle;
use iced::widget::operation;
use iced::widget::operation::AbsoluteOffset;
use iced::window;
use rayon::iter::IntoParallelRefIterator;
use rayon::iter::ParallelIterator;
Expand Down Expand Up @@ -219,7 +220,13 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task<Message> {
_ => {}
}

operation::focus(format!("result-{}", tile.focus_id))
operation::scroll_to(
"results",
AbsoluteOffset {
x: None,
y: Some(tile.focus_id as f32 * 55.),
},
)
} else {
Task::none()
}
Expand Down