bin: Use textview on all help pages

This commit is contained in:
Erik Kundt
2024-06-27 16:32:09 +02:00
parent 24da1d01c4
commit 5138f419f2
2 changed files with 7 additions and 8 deletions
-1
View File
@@ -314,7 +314,6 @@ fn help_page(_state: &State, channel: &Channel<Message>) -> Widget<State, Messag
TextViewProps::default()
.content(help_text())
.cursor(state.help.cursor)
.show_scroll_progress(true)
.to_boxed_any()
.into()
}),
+7 -7
View File
@@ -19,7 +19,7 @@ use termion::event::Key;
use tui::store;
use tui::ui::span;
use tui::ui::widget::container::{Column, Container, Footer, FooterProps, Header, HeaderProps};
use tui::ui::widget::input::{TextArea, TextAreaProps};
use tui::ui::widget::input::{TextView, TextViewProps};
use tui::ui::widget::window::{Page, PageProps, Shortcuts, ShortcutsProps, Window, WindowProps};
use tui::ui::widget::{ToWidget, Widget};
@@ -298,18 +298,18 @@ fn help_page(_state: &State, channel: &Channel<Message>) -> Widget<State, Messag
.into()
}))
.content(
TextArea::default()
TextView::default()
.to_widget(tx.clone())
.on_event(|_, view_state, _| {
view_state
.and_then(|tv| tv.unwrap_textarea())
.map(|tas| Message::ScrollHelp {
scroll: tas.scroll,
cursor: tas.cursor,
.and_then(|tv| tv.unwrap_textview())
.map(|tvs| Message::ScrollHelp {
scroll: tvs.scroll,
cursor: tvs.cursor,
})
})
.on_update(|state: &State| {
TextAreaProps::default()
TextViewProps::default()
.content(help_text())
.cursor(state.help.cursor)
.to_boxed_any()