Skip to content

Commit 4d74e73

Browse files
committed
fixup! events: Remove events unrelated to sliders
1 parent c7da788 commit 4d74e73

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/ui/components/trinary_input_string.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,8 @@ static void _render(component_t* component)
247247
}
248248
}
249249

250-
static void _on_keyboard_switch_cb(keyboard_mode_t mode, void* user_data)
250+
static void _input_char_set_alphabet(component_t* trinary_char, keyboard_mode_t mode)
251251
{
252-
component_t* self = (component_t*)user_data;
253-
data_t* data = (data_t*)self->data;
254-
component_t* trinary_char = data->trinary_char_component;
255252
switch (mode) {
256253
case LOWER_CASE:
257254
trinary_input_char_set_alphabet(trinary_char, _alphabet_lowercase, 1);
@@ -338,13 +335,20 @@ static void _set_alphabet(component_t* trinary_input_string, bool maybe_autocomp
338335
trinary_input_char_set_alphabet(trinary_char, charset, 1);
339336
} else if (data->number_input) {
340337
trinary_input_char_set_alphabet(trinary_char, _digits, 1);
341-
} else {
338+
} else if (data->keyboard_switch_component != NULL) {
342339
// Otherwise set the input charset based on the user selected keyboard mode.
343340
keyboard_mode_t keyboard_mode = keyboard_current_mode(data->keyboard_switch_component);
344-
_on_keyboard_switch_cb(keyboard_mode, trinary_input_string);
341+
_input_char_set_alphabet(trinary_char, keyboard_mode);
345342
}
346343
}
347344

345+
static void _on_keyboard_switch_cb(keyboard_mode_t mode, void* user_data)
346+
{
347+
component_t* self = (component_t*)user_data;
348+
data_t* data = (data_t*)self->data;
349+
_input_char_set_alphabet(data->trinary_char_component, mode);
350+
}
351+
348352
static void _confirm_button_cb(void* user_data)
349353
{
350354
component_t* self = (component_t*)user_data;

0 commit comments

Comments
 (0)