gyscos / gyscos/cursive

Moving between buttons from one linear layout to another

Open
#315 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
4.8k
Forks
270
Avg merge
5d 19h
Merged PRs (30d)
2

Description

This is a minimal version, of what I'm trying to achieve,

>
> fn main() {
> let mut siv = Cursive::default();
> let mut l = LinearLayout::new(Orientation::Vertical);
>
> for _ in 1..5 {
> let mut h = LinearLayout::new(Orientation::Horizontal);
>
> let b1 = Button::new("A", |_| {});
> let b2 = Button::new("B", |_| {});
> let b3 = Button::new("C", |_| {});
>
> h.add_child(b1);
> h.add_child(b2);
> h.add_child(b3);
>
> l.add_child(h);
> }
>
> siv.add_layer(ScrollView::new(l));
> siv.set_fps(30);
> siv.run();
> }
>

However, when I try to move between the buttons from one horizontal layout to another (by pressing up/down keys) , the movement is not always natural. Sometimes it moves diagonally up (or down), which is not desired. I'm on v0.10.0. (rustc v1.31)

Is this expected?, as in do I need to write my own wrapper view to handle this?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.