mirror of
https://github.com/figsoda/mmtc
synced 2024-11-22 07:03:05 +00:00
scrolling up now try to only move the selection
This commit is contained in:
parent
3221fcf1de
commit
25e6644f30
2 changed files with 7 additions and 4 deletions
|
@ -19,7 +19,7 @@ pub fn render(
|
|||
queue: &Vec<Track>,
|
||||
status: &Status,
|
||||
selected: usize,
|
||||
liststate: &ListState,
|
||||
liststate: &mut ListState,
|
||||
) {
|
||||
match widget {
|
||||
Widget::Rows(xs) => {
|
||||
|
@ -166,8 +166,11 @@ pub fn render(
|
|||
let mut chunks = layout.split(size).into_iter();
|
||||
let mut ws = ws.into_iter();
|
||||
|
||||
while let (Some(chunk), Some(w)) = (chunks.next(), ws.next()) {
|
||||
frame.render_stateful_widget(w, chunk, &mut liststate.clone());
|
||||
if let (Some(chunk), Some(w)) = (chunks.next(), ws.next()) {
|
||||
frame.render_stateful_widget(w, chunk, liststate);
|
||||
while let (Some(chunk), Some(w)) = (chunks.next(), ws.next()) {
|
||||
frame.render_stateful_widget(w, chunk, &mut liststate.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ async fn run() -> Result<()> {
|
|||
&queue,
|
||||
&status,
|
||||
selected,
|
||||
&liststate,
|
||||
&mut liststate,
|
||||
);
|
||||
})
|
||||
.context("Failed to draw to terminal")?,
|
||||
|
|
Loading…
Reference in a new issue