mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 09:28:21 +00:00
Merge 766f160f84 into 8619c07f3f
This commit is contained in:
commit
4bca1e4097
2 changed files with 23 additions and 22 deletions
|
|
@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
* Give more space to right-side diff view [[@hongquan](https://github.com/hongquan)] ([#2772](https://github.com/gitui-org/gitui/pull/2772))
|
||||||
* use [tombi](https://github.com/tombi-toml/tombi) for all toml file formatting
|
* use [tombi](https://github.com/tombi-toml/tombi) for all toml file formatting
|
||||||
* open the external editor from the status diff view [[@WaterWhisperer](https://github.com/WaterWhisperer)] ([#2805](https://github.com/gitui-org/gitui/issues/2805))
|
* open the external editor from the status diff view [[@WaterWhisperer](https://github.com/WaterWhisperer)] ([#2805](https://github.com/gitui-org/gitui/issues/2805))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,29 +67,29 @@ pub struct InspectCommitPopup {
|
||||||
|
|
||||||
impl DrawableComponent for InspectCommitPopup {
|
impl DrawableComponent for InspectCommitPopup {
|
||||||
fn draw(&self, f: &mut Frame, rect: Rect) -> Result<()> {
|
fn draw(&self, f: &mut Frame, rect: Rect) -> Result<()> {
|
||||||
if self.is_visible() {
|
if !self.is_visible() {
|
||||||
let percentages = if self.diff.focused() {
|
return Ok(());
|
||||||
(0, 100)
|
|
||||||
} else {
|
|
||||||
(50, 50)
|
|
||||||
};
|
|
||||||
|
|
||||||
let chunks = Layout::default()
|
|
||||||
.direction(Direction::Horizontal)
|
|
||||||
.constraints(
|
|
||||||
[
|
|
||||||
Constraint::Percentage(percentages.0),
|
|
||||||
Constraint::Percentage(percentages.1),
|
|
||||||
]
|
|
||||||
.as_ref(),
|
|
||||||
)
|
|
||||||
.split(rect);
|
|
||||||
|
|
||||||
f.render_widget(Clear, rect);
|
|
||||||
|
|
||||||
self.details.draw(f, chunks[0])?;
|
|
||||||
self.diff.draw(f, chunks[1])?;
|
|
||||||
}
|
}
|
||||||
|
let constraints = match rect.width {
|
||||||
|
..64 => [
|
||||||
|
Constraint::Percentage(50),
|
||||||
|
Constraint::Percentage(50),
|
||||||
|
],
|
||||||
|
64..100 => [Constraint::Max(32), Constraint::Fill(1)],
|
||||||
|
100..120 => [Constraint::Max(38), Constraint::Fill(1)],
|
||||||
|
120..152 => [Constraint::Max(42), Constraint::Fill(1)],
|
||||||
|
_ => [Constraint::Max(50), Constraint::Fill(1)],
|
||||||
|
};
|
||||||
|
|
||||||
|
let chunks = Layout::default()
|
||||||
|
.direction(Direction::Horizontal)
|
||||||
|
.constraints(constraints)
|
||||||
|
.split(rect);
|
||||||
|
|
||||||
|
f.render_widget(Clear, rect);
|
||||||
|
|
||||||
|
self.details.draw(f, chunks[0])?;
|
||||||
|
self.diff.draw(f, chunks[1])?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue