Skip to content

Commit

Permalink
Fixed go up button beyond initial start.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrueger committed Jan 6, 2025
1 parent b874146 commit 612e9e1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion crates/icy_view_gui/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::{
time::Duration,
};

use crate::ItemType;
use crate::{ItemFolder, ItemType};

use self::{
file_view::{FileView, Message},
Expand Down Expand Up @@ -691,6 +691,15 @@ impl<'a> MainWindow<'a> {
self.reset_state();
self.file_view.refresh();
self.handle_command(ctx, Some(Message::Select(0, false)));
} else {
if let Some(parent) = self.file_view.parents.pop() {
if let Some(parent) = parent.get_file_path().parent() {
self.file_view.parents.push(Box::new(ItemFolder::new(parent.to_path_buf())));
self.reset_state();
self.file_view.refresh();
self.handle_command(ctx, Some(Message::Select(0, false)));
}
}
}
}
Message::ToggleAutoScroll => {
Expand Down

0 comments on commit 612e9e1

Please sign in to comment.