This commit is contained in:
Stephan Dilly 2021-12-01 09:12:39 +01:00
parent 8fb506520c
commit 5a7c85daee
5 changed files with 17 additions and 18 deletions

View file

@ -1,5 +1,5 @@
use super::{
filetree::FileTreeComponent,
filetree::StatusTreeComponent,
utils::filetree::{FileTreeItem, FileTreeItemKind},
CommandBlocking, DrawableComponent, SharedOptions,
};
@ -18,7 +18,7 @@ use tui::{backend::Backend, layout::Rect, Frame};
///
pub struct ChangesComponent {
files: FileTreeComponent,
files: StatusTreeComponent,
is_working_dir: bool,
queue: Queue,
key_config: SharedKeyConfig,
@ -37,7 +37,7 @@ impl ChangesComponent {
options: SharedOptions,
) -> Self {
Self {
files: FileTreeComponent::new(
files: StatusTreeComponent::new(
title,
focus,
Some(queue.clone()),

View file

@ -4,7 +4,7 @@ mod style;
use super::{
command_pump, event_pump, CommandBlocking, CommandInfo,
Component, DrawableComponent, EventState, FileTreeComponent,
Component, DrawableComponent, EventState, StatusTreeComponent,
};
use crate::{
accessors, keys::SharedKeyConfig, queue::Queue, strings,
@ -29,7 +29,7 @@ pub struct CommitDetailsComponent {
commit: Option<CommitFilesParams>,
single_details: DetailsComponent,
compare_details: CompareDetailsComponent,
file_tree: FileTreeComponent,
file_tree: StatusTreeComponent,
git_commit_files: AsyncCommitFiles,
visible: bool,
key_config: SharedKeyConfig,
@ -56,7 +56,7 @@ impl CommitDetailsComponent {
false,
),
git_commit_files: AsyncCommitFiles::new(sender),
file_tree: FileTreeComponent::new(
file_tree: StatusTreeComponent::new(
"",
false,
Some(queue.clone()),
@ -126,7 +126,7 @@ impl CommitDetailsComponent {
}
///
pub const fn files(&self) -> &FileTreeComponent {
pub const fn files(&self) -> &StatusTreeComponent {
&self.file_tree
}

View file

@ -19,11 +19,10 @@ use crossterm::event::Event;
use std::{borrow::Cow, cell::Cell, convert::From, path::Path};
use tui::{backend::Backend, layout::Rect, text::Span, Frame};
//TODO: rename so that its clear this only works for Statuses
//TODO: use new `filetreelist` crate
///
pub struct FileTreeComponent {
pub struct StatusTreeComponent {
title: String,
tree: StatusTree,
pending: bool,
@ -36,7 +35,7 @@ pub struct FileTreeComponent {
scroll_top: Cell<usize>,
}
impl FileTreeComponent {
impl StatusTreeComponent {
///
pub fn new(
title: &str,
@ -308,7 +307,7 @@ struct TextDrawInfo<'a> {
item_kind: &'a FileTreeItemKind,
}
impl DrawableComponent for FileTreeComponent {
impl DrawableComponent for StatusTreeComponent {
fn draw<B: Backend>(
&self,
f: &mut Frame<B>,
@ -377,7 +376,7 @@ impl DrawableComponent for FileTreeComponent {
}
}
impl Component for FileTreeComponent {
impl Component for StatusTreeComponent {
fn commands(
&self,
out: &mut Vec<CommandInfo>,
@ -496,7 +495,7 @@ mod tests {
let mut frame = terminal.get_frame();
// set up file tree
let mut ftc = FileTreeComponent::new(
let mut ftc = StatusTreeComponent::new(
"title",
true,
None,
@ -537,7 +536,7 @@ mod tests {
let mut frame = terminal.get_frame();
// set up file tree
let mut ftc = FileTreeComponent::new(
let mut ftc = StatusTreeComponent::new(
"title",
true,
None,

View file

@ -31,7 +31,7 @@ mod taglist;
mod textinput;
mod utils;
pub use self::filetree::FileTreeComponent;
pub use self::filetree::StatusTreeComponent;
pub use blame_file::BlameFileComponent;
pub use branchlist::BranchListComponent;
pub use changes::ChangesComponent;

View file

@ -3,7 +3,7 @@ use crate::{
components::{
command_pump, event_pump, visibility_blocking,
CommandBlocking, CommandInfo, Component, DrawableComponent,
EventState, FileTreeComponent,
EventState, StatusTreeComponent,
},
keys::SharedKeyConfig,
queue::{InternalEvent, Queue},
@ -31,7 +31,7 @@ pub struct StashingOptions {
}
pub struct Stashing {
index: FileTreeComponent,
index: StatusTreeComponent,
visible: bool,
options: StashingOptions,
theme: SharedTheme,
@ -51,7 +51,7 @@ impl Stashing {
key_config: SharedKeyConfig,
) -> Self {
Self {
index: FileTreeComponent::new(
index: StatusTreeComponent::new(
&strings::stashing_files_title(&key_config),
true,
Some(queue.clone()),