mirror of
https://seed.radicle.dev/rad:z39mP9rQAaGmERfUMPULfPUi473tY.git
synced 2026-11-21 10:30:48 +08:00
bin: Use textview on all help pages
This commit is contained in:
@@ -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()
|
||||
}),
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user