2020-07-22 12:16:15 +08:00
|
|
|
use zero_ui::{core::focus::TabIndex, prelude::*};
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
App::default().run_window(|_| {
|
|
|
|
window! {
|
2020-07-26 07:11:25 +08:00
|
|
|
title: "Focus Example";
|
2020-07-22 12:16:15 +08:00
|
|
|
content: v_stack! {
|
|
|
|
spacing: 5.0;
|
|
|
|
items: ui_vec![
|
2020-07-23 02:38:38 +08:00
|
|
|
example("Button 5", TabIndex(5)),
|
2020-07-22 12:16:15 +08:00
|
|
|
example("Button 4", TabIndex(3)),
|
|
|
|
example("Button 3", TabIndex(2)),
|
|
|
|
example("Button 1", TabIndex(0)),
|
|
|
|
example("Button 2", TabIndex(0)),
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
fn example(content: impl Into<Text>, tab_index: TabIndex) -> impl Widget {
|
|
|
|
button! {
|
|
|
|
content: text(content.into());
|
|
|
|
tab_index;
|
|
|
|
}
|
|
|
|
}
|