forked from kemitix/git-next
fix: disable ScrollView
Current version is incompatible with latest Ratatui. Backout this change when compatibility is restore.
This commit is contained in:
parent
9d6271a176
commit
23de987444
1 changed files with 7 additions and 14 deletions
|
@ -1,12 +1,13 @@
|
|||
//
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use git_next_core::ForgeAlias;
|
||||
use ratatui::{
|
||||
buffer::Buffer,
|
||||
layout::{Direction, Layout, Rect, Size},
|
||||
widgets::StatefulWidget,
|
||||
layout::{Direction, Layout, Rect},
|
||||
widgets::{StatefulWidget, Widget},
|
||||
};
|
||||
use tui_scrollview::{ScrollView, ScrollViewState};
|
||||
use tui_scrollview::ScrollViewState;
|
||||
|
||||
use crate::tui::actor::ForgeState;
|
||||
|
||||
|
@ -27,16 +28,10 @@ impl<'a> HeightContraintLength for ConfiguredAppWidget<'a> {
|
|||
impl<'a> StatefulWidget for ConfiguredAppWidget<'a> {
|
||||
type State = ScrollViewState;
|
||||
|
||||
fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State)
|
||||
fn render(self, area: Rect, buf: &mut Buffer, _state: &mut Self::State)
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
let height = self
|
||||
.children()
|
||||
.iter()
|
||||
.map(HeightContraintLength::height_constraint_length)
|
||||
.sum::<u16>();
|
||||
let mut scroll = ScrollView::new(Size::new(area.width - 1, height));
|
||||
let layout_forge_list = Layout::default()
|
||||
.direction(Direction::Vertical)
|
||||
.constraints(
|
||||
|
@ -44,14 +39,12 @@ impl<'a> StatefulWidget for ConfiguredAppWidget<'a> {
|
|||
.iter()
|
||||
.map(HeightContraintLength::height_constraint_length),
|
||||
)
|
||||
.split(scroll.area());
|
||||
.split(area);
|
||||
|
||||
self.children()
|
||||
.into_iter()
|
||||
.enumerate()
|
||||
.for_each(|(i, w)| scroll.render_widget(w, layout_forge_list[i]));
|
||||
|
||||
scroll.render(area, buf, state);
|
||||
.for_each(|(i, w)| w.render(layout_forge_list[i], buf));
|
||||
}
|
||||
}
|
||||
impl<'a> ConfiguredAppWidget<'a> {
|
||||
|
|
Loading…
Reference in a new issue