mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-06 10:58:28 +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 {
|
match logical_key {
|
||||||
Key::Named(NamedKey::ArrowDown) => {
|
Key::Named(NamedKey::ArrowDown) => {
|
||||||
if self.ops.selected < self.ops.operations.len() {
|
self.ops.select_next();
|
||||||
self.ops.selected += 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Key::Named(NamedKey::ArrowUp) => {
|
Key::Named(NamedKey::ArrowUp) => {
|
||||||
self.ops.selected = self.ops.selected.saturating_sub(1);
|
self.ops.selected = self.ops.selected.saturating_sub(1);
|
||||||
|
@ -54,6 +54,12 @@ impl OpsLog {
|
|||||||
pub fn select_last(&mut self) {
|
pub fn select_last(&mut self) {
|
||||||
self.selected = self.operations.len().saturating_sub(1);
|
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 {
|
impl fmt::Display for OpsLog {
|
||||||
|
Loading…
Reference in New Issue
Block a user