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
14
src/menu.rs
14
src/menu.rs
@ -431,14 +431,12 @@ impl Menu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn action_select_link(&mut self, link: usize) -> Action {
|
fn action_select_link(&mut self, link: usize) -> Action {
|
||||||
if link < self.links.len() {
|
if let Some(&pos) = self.links.get(link) {
|
||||||
if let Some(&line) = self.links.get(link) {
|
if self.link_visibility(link) != Some(LinkDir::Visible) {
|
||||||
if self.link_visibility(link) != Some(LinkDir::Visible) {
|
if pos > 5 {
|
||||||
if line > SCROLL_LINES {
|
self.scroll = pos - 5;
|
||||||
self.scroll = line - SCROLL_LINES;
|
} else {
|
||||||
} else {
|
self.scroll = 0;
|
||||||
self.scroll = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.link = link;
|
self.link = link;
|
||||||
|
Loading…
Reference in New Issue
Block a user