fix: disable ScrollView
All checks were successful
Rust / build (map[name:nightly]) (push) Successful in 12m38s
Rust / build (map[name:stable]) (push) Successful in 13m3s
Release Please / Release-plz (push) Successful in 1m57s

Current version is incompatible with latest Ratatui. Backout this change
when compatibility is restore.
This commit is contained in:
Paul Campbell 2024-10-22 07:20:08 +01:00
parent 9d6271a176
commit 23de987444

View file

@ -1,12 +1,13 @@
//
use std::collections::BTreeMap; use std::collections::BTreeMap;
use git_next_core::ForgeAlias; use git_next_core::ForgeAlias;
use ratatui::{ use ratatui::{
buffer::Buffer, buffer::Buffer,
layout::{Direction, Layout, Rect, Size}, layout::{Direction, Layout, Rect},
widgets::StatefulWidget, widgets::{StatefulWidget, Widget},
}; };
use tui_scrollview::{ScrollView, ScrollViewState}; use tui_scrollview::ScrollViewState;
use crate::tui::actor::ForgeState; use crate::tui::actor::ForgeState;
@ -27,16 +28,10 @@ impl<'a> HeightContraintLength for ConfiguredAppWidget<'a> {
impl<'a> StatefulWidget for ConfiguredAppWidget<'a> { impl<'a> StatefulWidget for ConfiguredAppWidget<'a> {
type State = ScrollViewState; 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 where
Self: Sized, 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() let layout_forge_list = Layout::default()
.direction(Direction::Vertical) .direction(Direction::Vertical)
.constraints( .constraints(
@ -44,14 +39,12 @@ impl<'a> StatefulWidget for ConfiguredAppWidget<'a> {
.iter() .iter()
.map(HeightContraintLength::height_constraint_length), .map(HeightContraintLength::height_constraint_length),
) )
.split(scroll.area()); .split(area);
self.children() self.children()
.into_iter() .into_iter()
.enumerate() .enumerate()
.for_each(|(i, w)| scroll.render_widget(w, layout_forge_list[i])); .for_each(|(i, w)| w.render(layout_forge_list[i], buf));
scroll.render(area, buf, state);
} }
} }
impl<'a> ConfiguredAppWidget<'a> { impl<'a> ConfiguredAppWidget<'a> {