Changeset 12dd36c in mainline
- Timestamp:
- 2024-11-12T10:04:38Z (3 weeks ago)
- Branches:
- master
- Children:
- 1eeddb3, 5ce0438, 9bfb74a, ad85592, b718826, ed19604b
- Parents:
- 9a07ee3
- Location:
- uspace/lib/ui/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/filedialog.c
r9a07ee3 r12dd36c 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2024 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 396 396 * 397 397 * @param window Window 398 * @param arg Argument (ui_ prompt_dialog_t *)398 * @param arg Argument (ui_file_dialog_t *) 399 399 * @param event Keyboard event 400 400 */ … … 427 427 } 428 428 } 429 430 429 } 431 430 -
uspace/lib/ui/src/msgdialog.c
r9a07ee3 r12dd36c 47 47 48 48 static void ui_msg_dialog_wnd_close(ui_window_t *, void *); 49 static void ui_msg_dialog_wnd_kbd(ui_window_t *, void *, kbd_event_t *); 49 50 50 51 ui_window_cb_t ui_msg_dialog_wnd_cb = { 51 .close = ui_msg_dialog_wnd_close 52 .close = ui_msg_dialog_wnd_close, 53 .kbd = ui_msg_dialog_wnd_kbd 52 54 }; 53 55 … … 281 283 } 282 284 285 /** Message dialog window keyboard event handler. 286 * 287 * @param window Window 288 * @param arg Argument (ui_msg_dialog_t *) 289 * @param event Keyboard event 290 */ 291 static void ui_msg_dialog_wnd_kbd(ui_window_t *window, void *arg, 292 kbd_event_t *event) 293 { 294 ui_msg_dialog_t *dialog = (ui_msg_dialog_t *) arg; 295 ui_evclaim_t claim; 296 297 claim = ui_window_def_kbd(window, event); 298 if (claim == ui_claimed) 299 return; 300 301 if (event->type == KEY_PRESS && 302 (event->mods & (KM_CTRL | KM_SHIFT | KM_ALT)) == 0) { 303 if (event->key == KC_ENTER) { 304 /* OK / default button */ 305 if (dialog->cb != NULL && dialog->cb->button != NULL) { 306 dialog->cb->button(dialog, dialog->arg, 0); 307 return; 308 } 309 } else if (event->key == KC_ESCAPE) { 310 /* Cancel */ 311 if (dialog->cb != NULL && dialog->cb->close != NULL) { 312 dialog->cb->close(dialog, dialog->arg); 313 return; 314 } 315 } 316 } 317 318 } 319 283 320 /** Message dialog button click handler. 284 321 *
Note:
See TracChangeset
for help on using the changeset viewer.