Skip to content

Commit 551b01f

Browse files
committed
fix(ui): update code for compatibility with latest libcosmic API
1 parent 629fdb5 commit 551b01f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ui/components.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn interval_controls(interval: f64, app_data: &AppData) -> Column<'static, M
1919
let interval_input = MouseArea::new(
2020
TextInput::new("", interval_value.clone())
2121
.on_input(Message::UpdateInterval)
22-
.on_submit(Message::UpdateInterval(interval_value))
22+
.on_submit(|value| Message::UpdateInterval(value))
2323
.padding(5)
2424
.width(Length::Fixed(60.0))
2525
.size(16)
@@ -85,16 +85,16 @@ fn build_generic_dropdown<T, F>(
8585
choices: &'static [&'static str],
8686
current_mode: T,
8787
map_fn: F,
88-
) -> Dropdown<'static, &'static str, Message>
88+
) -> Dropdown<'static, &'static str, Message, Message>
8989
where
9090
T: ToString,
91-
F: Fn(usize) -> Message + 'static,
91+
F: Fn(usize) -> Message + 'static + Send + Sync,
9292
{
9393
let selected_index = choices.iter().position(|&mode| mode == current_mode.to_string());
9494
Dropdown::new(choices, selected_index, map_fn)
9595
}
9696

97-
pub fn build_key_behavior_dropdown(current_mode: KeyBehaviorMode) -> Dropdown<'static, &'static str, Message> {
97+
pub fn build_key_behavior_dropdown(current_mode: KeyBehaviorMode) -> Dropdown<'static, &'static str, Message, Message> {
9898
const KEY_BEHAVIORS: [&str; 2] = ["Click", "Hold"];
9999
build_generic_dropdown(
100100
&KEY_BEHAVIORS,
@@ -107,7 +107,7 @@ pub fn build_key_behavior_dropdown(current_mode: KeyBehaviorMode) -> Dropdown<'s
107107
)
108108
}
109109

110-
pub fn build_modifier_behavior_dropdown(current_mode: ModifierBehaviorMode) -> Dropdown<'static, &'static str, Message> {
110+
pub fn build_modifier_behavior_dropdown(current_mode: ModifierBehaviorMode) -> Dropdown<'static, &'static str, Message, Message> {
111111
const MODIFIER_BEHAVIOR_MODES: [&str; 2] = ["Click", "Hold"];
112112
build_generic_dropdown(
113113
&MODIFIER_BEHAVIOR_MODES,

0 commit comments

Comments
 (0)