mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-05 10:28:27 +00:00
Add OpsLog::select_next
This commit is contained in:
parent
de37322aa7
commit
29527442dc
@ -95,9 +95,7 @@ impl ApplicationHandler for App {
|
||||
|
||||
match logical_key {
|
||||
Key::Named(NamedKey::ArrowDown) => {
|
||||
if self.ops.selected < self.ops.operations.len() {
|
||||
self.ops.selected += 1;
|
||||
}
|
||||
self.ops.select_next();
|
||||
}
|
||||
Key::Named(NamedKey::ArrowUp) => {
|
||||
self.ops.selected = self.ops.selected.saturating_sub(1);
|
||||
|
@ -54,6 +54,12 @@ impl OpsLog {
|
||||
pub fn select_last(&mut self) {
|
||||
self.selected = self.operations.len().saturating_sub(1);
|
||||
}
|
||||
|
||||
pub fn select_next(&mut self) {
|
||||
if self.selected < self.operations.len() {
|
||||
self.selected += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for OpsLog {
|
||||
|
Loading…
Reference in New Issue
Block a user