mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 09:28:21 +00:00
tabs preview
This commit is contained in:
parent
e3a2987b53
commit
ecc3d10fdd
2 changed files with 22 additions and 11 deletions
|
|
@ -11,9 +11,9 @@ terminal ui (tui) frontend for git written in rust
|
|||
* [x] allow scrolling diff
|
||||
* [x] support staging
|
||||
* [x] show added files on working dir changes
|
||||
* [ ] support committing
|
||||
* [ ] allow selecting/diff index items
|
||||
* [ ] support unstaging
|
||||
* [ ] support committing
|
||||
* [ ] polling in thread
|
||||
* [ ] support push/pull
|
||||
* [ ] log view
|
||||
|
|
|
|||
31
src/app.rs
31
src/app.rs
|
|
@ -1,17 +1,15 @@
|
|||
use crate::clear::Clear;
|
||||
use crate::git_status::StatusLists;
|
||||
use crate::git_utils;
|
||||
use crate::git_utils::Diff;
|
||||
use crate::git_utils::DiffLine;
|
||||
use crate::{
|
||||
clear::Clear,
|
||||
git_status::StatusLists,
|
||||
git_utils::{self, Diff, DiffLine, DiffLineType},
|
||||
};
|
||||
use crossterm::event::{Event, KeyCode, MouseEvent};
|
||||
use git_utils::DiffLineType;
|
||||
use std::cmp;
|
||||
use std::path::Path;
|
||||
use std::{cmp, path::Path};
|
||||
use tui::{
|
||||
backend::Backend,
|
||||
layout::{Alignment, Constraint, Direction, Layout, Rect},
|
||||
style::{Color, Modifier, Style},
|
||||
widgets::{Block, Borders, Paragraph, SelectableList, Text, Widget},
|
||||
widgets::{Block, Borders, Paragraph, SelectableList, Tabs, Text, Widget},
|
||||
Frame,
|
||||
};
|
||||
|
||||
|
|
@ -65,10 +63,23 @@ impl App {
|
|||
|
||||
///
|
||||
pub fn draw<B: Backend>(&self, f: &mut Frame<B>) {
|
||||
let chunks_tabs = Layout::default()
|
||||
.direction(Direction::Vertical)
|
||||
.constraints([Constraint::Length(2), Constraint::Min(2)].as_ref())
|
||||
.split(f.size());
|
||||
|
||||
Tabs::default()
|
||||
.block(Block::default().borders(Borders::BOTTOM))
|
||||
.titles(&["Status", "Log", "Misc"])
|
||||
.style(Style::default().fg(Color::White))
|
||||
.highlight_style(Style::default().fg(Color::Yellow))
|
||||
.divider(" | ")
|
||||
.render(f, chunks_tabs[0]);
|
||||
|
||||
let chunks = Layout::default()
|
||||
.direction(Direction::Horizontal)
|
||||
.constraints([Constraint::Percentage(50), Constraint::Percentage(50)].as_ref())
|
||||
.split(f.size());
|
||||
.split(chunks_tabs[1]);
|
||||
|
||||
let left_chunks = Layout::default()
|
||||
.direction(Direction::Vertical)
|
||||
|
|
|
|||
Loading…
Reference in a new issue