mirror of
https://github.com/xvxx/phetch
synced 2024-11-10 13:10:54 +00:00
scroll to on select
This commit is contained in:
parent
ba28a264d7
commit
8137961833
@ -431,16 +431,14 @@ impl Menu {
|
||||
}
|
||||
|
||||
fn action_select_link(&mut self, link: usize) -> Action {
|
||||
if link < self.links.len() {
|
||||
if let Some(&line) = self.links.get(link) {
|
||||
if let Some(&pos) = self.links.get(link) {
|
||||
if self.link_visibility(link) != Some(LinkDir::Visible) {
|
||||
if line > SCROLL_LINES {
|
||||
self.scroll = line - SCROLL_LINES;
|
||||
if pos > 5 {
|
||||
self.scroll = pos - 5;
|
||||
} else {
|
||||
self.scroll = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
self.link = link;
|
||||
Action::Redraw
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user