Changes in uspace/lib/ui/src/entry.c [b987eb4:6df564c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/entry.c
rb987eb4 r6df564c 314 314 315 315 gfx_text_fmt_init(&fmt); 316 fmt.font = res->font;317 316 fmt.color = res->entry_fg_color; 318 317 fmt.halign = gfx_halign_left; … … 330 329 entry->text[off1] = '\0'; 331 330 332 rc = gfx_puttext( &pos, &fmt, entry->text);331 rc = gfx_puttext(res->font, &pos, &fmt, entry->text); 333 332 if (rc != EOK) { 334 333 (void) gfx_set_clip_rect(res->gc, NULL); … … 336 335 } 337 336 338 gfx_text_cont( &pos, &fmt, entry->text, &cpos, &cfmt);337 gfx_text_cont(res->font, &pos, &fmt, entry->text, &cpos, &cfmt); 339 338 entry->text[off1] = c; 340 339 … … 346 345 cfmt.color = res->entry_sel_text_fg_color; 347 346 348 gfx_text_rect( &cpos, &cfmt, entry->text + off1, &sel);347 gfx_text_rect(res->font, &cpos, &cfmt, entry->text + off1, &sel); 349 348 sel.p0.x -= ui_entry_sel_hpad; 350 349 sel.p0.y -= ui_entry_sel_vpad; … … 360 359 goto error; 361 360 362 rc = gfx_puttext( &cpos, &cfmt, entry->text + off1);361 rc = gfx_puttext(res->font, &cpos, &cfmt, entry->text + off1); 363 362 if (rc != EOK) { 364 363 (void) gfx_set_clip_rect(res->gc, NULL); … … 366 365 } 367 366 368 gfx_text_cont(&cpos, &cfmt, entry->text + off1, &cpos, &cfmt); 367 gfx_text_cont(res->font, &cpos, &cfmt, entry->text + off1, 368 &cpos, &cfmt); 369 369 370 370 entry->text[off2] = c; … … 374 374 cfmt.color = res->entry_fg_color; 375 375 376 rc = gfx_puttext( &cpos, &cfmt, entry->text + off2);376 rc = gfx_puttext(res->font, &cpos, &cfmt, entry->text + off2); 377 377 if (rc != EOK) { 378 378 (void) gfx_set_clip_rect(res->gc, NULL); … … 421 421 422 422 gfx_text_fmt_init(&fmt); 423 fmt.font = res->font;424 423 fmt.halign = gfx_halign_left; 425 424 fmt.valign = gfx_valign_top; 426 425 427 return gfx_text_find_pos(&geom.text_pos, &fmt, entry->text, fpos); 426 return gfx_text_find_pos(res->font, &geom.text_pos, &fmt, 427 entry->text, fpos); 428 428 } 429 429 … … 664 664 break; 665 665 } 666 666 667 return ui_claimed; 667 668 } … … 742 743 if (!entry->active) 743 744 return ui_unclaimed; 745 746 if (event->type == KEY_PRESS && event->c >= ' ') { 747 off = 0; 748 rc = chr_encode(event->c, buf, &off, sizeof(buf)); 749 if (rc == EOK) { 750 buf[off] = '\0'; 751 (void) ui_entry_insert_str(entry, buf); 752 } 753 } 744 754 745 755 /* … … 758 768 if (event->type == KEY_RELEASE && event->key == KC_RSHIFT) 759 769 entry->rshift_held = false; 760 761 if (event->type == KEY_PRESS &&762 (event->mods & (KM_CTRL | KM_ALT)) == 0 && event->c >= ' ') {763 off = 0;764 rc = chr_encode(event->c, buf, &off, sizeof(buf));765 if (rc == EOK) {766 buf[off] = '\0';767 (void) ui_entry_insert_str(entry, buf);768 }769 }770 770 771 771 if (event->type == KEY_PRESS && … … 1111 1111 anchor.y = 0; 1112 1112 gfx_text_fmt_init(&fmt); 1113 fmt.font = res->font;1114 1113 fmt.halign = entry->halign; 1115 gfx_text_start_pos(&anchor, &fmt, entry->text, &tpos); 1114 gfx_text_start_pos(res->font, &anchor, &fmt, entry->text, 1115 &tpos); 1116 1116 entry->scroll_pos = tpos.x - geom.text_rect.p0.x; 1117 1117 } else if (geom.text_pos.x + width < geom.text_rect.p1.x &&
Note:
See TracChangeset
for help on using the changeset viewer.