summaryrefslogtreecommitdiffstats
path: root/src/interactive/widgets/main.rs
diff options
context:
space:
mode:
authorSebastian Thiel <sthiel@thoughtworks.com>2019-06-05 14:58:43 +0530
committerSebastian Thiel <sthiel@thoughtworks.com>2019-06-05 14:58:43 +0530
commitb2f518764a28800ac911904f7b1e59daa08e6948 (patch)
treeb15846c6ece7c460f46ddce0d2fd505016c0c9e5 /src/interactive/widgets/main.rs
parent9a5ffd238470b511c4818e917f55ba4dafaf212c (diff)
support for mutable props - useful for iterators for example
Diffstat (limited to 'src/interactive/widgets/main.rs')
-rw-r--r--src/interactive/widgets/main.rs14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/interactive/widgets/main.rs b/src/interactive/widgets/main.rs
index 977e79f..f5a2fac 100644
--- a/src/interactive/widgets/main.rs
+++ b/src/interactive/widgets/main.rs
@@ -7,7 +7,7 @@ use crate::interactive::{
FocussedPane, TerminalApp,
};
use dua::traverse::Traversal;
-use std::borrow::Borrow;
+use std::borrow::{Borrow, BorrowMut};
use tui::style::{Color, Style};
use tui::{
buffer::Buffer,
@@ -31,8 +31,15 @@ pub struct ReactMainWindow {
impl<'a, 'b> Component for ReactMainWindow {
type Props = TerminalApp;
+ type PropsMut = ();
- fn render(&mut self, props: impl Borrow<TerminalApp>, area: Rect, buf: &mut Buffer) {
+ fn render(
+ &mut self,
+ props: impl Borrow<TerminalApp>,
+ _props_mut: impl BorrowMut<Self::PropsMut>,
+ area: Rect,
+ buf: &mut Buffer,
+ ) {
let TerminalApp {
traversal:
Traversal {
@@ -104,7 +111,7 @@ impl<'a, 'b> Component for ReactMainWindow {
let props = ReactHelpPaneProps {
border_style: help_style,
};
- pane.render(props, help_area, buf);
+ pane.render(props, (), help_area, buf);
}
ReactFooter.render(
@@ -114,6 +121,7 @@ impl<'a, 'b> Component for ReactMainWindow {
format: display.byte_format,
message: state.message.clone(),
},
+ (),
footer_area,
buf,
);