Add complete keyboard navigation.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
use crate::components::keyboard;
|
||||
use iced::widget::button;
|
||||
use iced::widget::text::Shaping;
|
||||
use iced::widget::{Column, Space, button, column, container, row, scrollable, text};
|
||||
use iced::widget::{Column, Space, column, container, row, scrollable, text};
|
||||
use iced::{Background, Border, Color, Element, Length, Radians, Theme, gradient};
|
||||
|
||||
use bds_core::i18n::UiLocale;
|
||||
@@ -220,7 +222,7 @@ fn swatch(background: Background, width_portion: u16) -> Element<'static, Messag
|
||||
fn theme_button<'a>(theme: &StyleTheme, selected_theme: &str) -> Element<'a, Message> {
|
||||
let selected = theme.name == selected_theme;
|
||||
let theme_name = theme.name.to_string();
|
||||
button(
|
||||
keyboard::button(
|
||||
column![
|
||||
row![
|
||||
swatch(theme_accent_background(theme), 2),
|
||||
@@ -318,13 +320,13 @@ pub fn view<'a>(
|
||||
.size(13)
|
||||
.shaping(Shaping::Advanced);
|
||||
let apply_button: Element<'a, Message> = if state.can_apply() {
|
||||
button(apply_label)
|
||||
keyboard::button(apply_label)
|
||||
.on_press(Message::Style(StyleMsg::Apply))
|
||||
.padding([8, 16])
|
||||
.style(inputs::primary_button)
|
||||
.into()
|
||||
} else {
|
||||
button(apply_label)
|
||||
keyboard::button(apply_label)
|
||||
.padding([8, 16])
|
||||
.style(inputs::primary_button)
|
||||
.into()
|
||||
|
||||
Reference in New Issue
Block a user