Skip to content

Commit

Permalink
make scrolling more efficient
Browse files Browse the repository at this point in the history
  • Loading branch information
hiimsergey authored Oct 13, 2023
1 parent 1250baf commit 290039b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mod util;
use cursive::{
event::Key,
theme::{BaseColor, Color},
view::{Nameable, Resizable},
view::{Nameable, Resizable, ScrollStrategy},
views::{
Button, Dialog, DummyView, EditView, LinearLayout, ListView, OnEventView, Panel,
ScrollView, TextView,
Expand Down Expand Up @@ -68,7 +68,7 @@ Utilizes the \"cursive\" crate for building TUIs.
.child(
TextView::new(
"
v. 0.2.7 - GPLv3 License ",
v. 0.2.9 - GPLv3 License ",
)
.style(Color::Dark(BaseColor::Blue)),
),
Expand Down Expand Up @@ -115,7 +115,7 @@ Code length: {pass_len}"
.fixed_width(pass_len as usize + 1),
);

let list = Panel::new(ScrollView::new(ListView::new()).with_name("list"))
let list = Panel::new(ScrollView::new(ListView::new()).scroll_strategy(ScrollStrategy::StickToBottom).with_name("list"))
.fixed_height(12)
.fixed_width(2 * (pass_len as usize) + 14);
let game_sidebar = LinearLayout::vertical()
Expand Down
1 change: 0 additions & 1 deletion src/logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ fn print_feedback(s: &mut Cursive, guess: &str, feedback: String) {
len_fmt = guess.len() + 4
)),
);
v.scroll_to_bottom();
});

if feedback.chars().all(|c| c == '!') {
Expand Down

0 comments on commit 290039b

Please sign in to comment.