Changeset c88d7f99 in mainline for uspace/lib/ui/src/menuentry.c
- Timestamp:
- 2022-03-10T17:44:35Z (3 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c38ab6c
- Parents:
- 96c6a00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/menuentry.c
r96c6a00 rc88d7f99 43 43 #include <stdlib.h> 44 44 #include <str.h> 45 #include <ui/accel.h> 45 46 #include <ui/control.h> 46 47 #include <ui/paint.h> … … 245 246 res = ui_window_get_res(mentry->menu->mbar->window); 246 247 247 *caption_w = gfx_text_width(res->font, mentry->caption);248 *shortcut_w = gfx_text_width(res->font, mentry->shortcut);248 *caption_w = ui_text_width(res->font, mentry->caption); 249 *shortcut_w = ui_text_width(res->font, mentry->shortcut); 249 250 } 250 251 … … 331 332 } 332 333 334 /** Get menu entry accelerator character. 335 * 336 * @param mentry Menu entry 337 * @return Accelerator character (lowercase) or the null character if 338 * the menu entry has no accelerator. 339 */ 340 char32_t ui_menu_entry_get_accel(ui_menu_entry_t *mentry) 341 { 342 return ui_accel_get(mentry->caption); 343 } 344 333 345 /** Paint menu entry. 334 346 * … … 340 352 { 341 353 ui_resource_t *res; 342 gfx_text_fmt_t fmt;354 ui_text_fmt_t fmt; 343 355 gfx_color_t *bg_color; 344 356 ui_menu_entry_geom_t geom; … … 350 362 ui_menu_entry_get_geom(mentry, pos, &geom); 351 363 352 gfx_text_fmt_init(&fmt);364 ui_text_fmt_init(&fmt); 353 365 fmt.font = res->font; 354 366 fmt.halign = gfx_halign_left; … … 358 370 mentry == mentry->menu->selected) { 359 371 fmt.color = res->wnd_sel_text_color; 372 fmt.hgl_color = res->wnd_sel_text_hgl_color; 360 373 bg_color = res->wnd_sel_text_bg_color; 361 374 } else { 362 375 fmt.color = res->wnd_text_color; 376 fmt.hgl_color = res->wnd_text_hgl_color; 363 377 bg_color = res->wnd_face_color; 364 378 } … … 372 386 goto error; 373 387 374 rc = gfx_puttext(&geom.caption_pos, &fmt, mentry->caption);388 rc = ui_paint_text(&geom.caption_pos, &fmt, mentry->caption); 375 389 if (rc != EOK) 376 390 goto error; … … 378 392 fmt.halign = gfx_halign_right; 379 393 380 rc = gfx_puttext(&geom.shortcut_pos, &fmt, mentry->shortcut);394 rc = ui_paint_text(&geom.shortcut_pos, &fmt, mentry->shortcut); 381 395 if (rc != EOK) 382 396 goto error;
Note:
See TracChangeset
for help on using the changeset viewer.