Add complete keyboard navigation.
This commit is contained in:
@@ -5,6 +5,8 @@ use iced::widget::{
|
||||
};
|
||||
use iced::{Alignment, Background, Border, Color, Element, Length, Shadow, Theme, Vector};
|
||||
|
||||
use super::keyboard;
|
||||
|
||||
/// Standard form field label color.
|
||||
pub const LABEL_COLOR: Color = rgb8(0xB5, 0xBA, 0xC4);
|
||||
pub const SECTION_COLOR: Color = rgb8(0x9D, 0xA5, 0xB4);
|
||||
@@ -243,10 +245,13 @@ where
|
||||
.size(12)
|
||||
.color(LABEL_COLOR)
|
||||
.shaping(Shaping::Advanced),
|
||||
pick_list(list, selected.cloned(), on_select)
|
||||
.padding([8, 10])
|
||||
.width(Length::Fill)
|
||||
.style(select_style),
|
||||
keyboard::focusable(
|
||||
pick_list(list, selected.cloned(), on_select)
|
||||
.padding([8, 10])
|
||||
.width(Length::Fill)
|
||||
.style(select_style),
|
||||
true,
|
||||
),
|
||||
]
|
||||
.spacing(6)
|
||||
.width(Length::Fill)
|
||||
@@ -259,11 +264,14 @@ pub fn labeled_checkbox<'a, Message: Clone + 'a>(
|
||||
is_checked: bool,
|
||||
on_toggle: impl Fn(bool) -> Message + 'a,
|
||||
) -> Element<'a, Message> {
|
||||
checkbox(label, is_checked)
|
||||
.on_toggle(on_toggle)
|
||||
.size(16)
|
||||
.text_size(14)
|
||||
.into()
|
||||
keyboard::focusable(
|
||||
checkbox(label, is_checked)
|
||||
.on_toggle(on_toggle)
|
||||
.size(16)
|
||||
.text_size(14),
|
||||
true,
|
||||
)
|
||||
.into()
|
||||
}
|
||||
|
||||
/// A section header with optional separator line.
|
||||
|
||||
1329
crates/bds-ui/src/components/keyboard.rs
Normal file
1329
crates/bds-ui/src/components/keyboard.rs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
||||
pub mod inputs;
|
||||
pub mod keyboard;
|
||||
pub mod native_edit;
|
||||
pub mod popover;
|
||||
pub mod webview;
|
||||
|
||||
Reference in New Issue
Block a user