Changes in uspace/lib/ui/src/menuentry.c [6a0b2cc:71edd430] in mainline
- File:
-
- 1 edited
-
uspace/lib/ui/src/menuentry.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/menuentry.c
r6a0b2cc r71edd430 1 1 /* 2 * Copyright (c) 202 3Jiri Svoboda2 * Copyright (c) 2022 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 163 163 } 164 164 165 /** Set menu entry disabled flag.166 *167 * @param mentry Menu entry168 * @param disabled @c true iff entry is to be disabled, @c false otherwise169 */170 void ui_menu_entry_set_disabled(ui_menu_entry_t *mentry, bool disabled)171 {172 mentry->disabled = disabled;173 }174 175 /** Get menu entry disabled flag.176 *177 * @param mentry Menu entry178 * @return disabled @c true iff entry is disabled, @c false otherwise179 */180 bool ui_menu_entry_is_disabled(ui_menu_entry_t *mentry)181 {182 return mentry->disabled;183 }184 185 165 /** Get first menu entry in menu. 186 166 * … … 261 241 * This needs to work even if the menu is not open, so we cannot 262 242 * use the menu's resource, which is only created after the menu 263 * is open (and its window is created). Use the parent window's243 * is open (and its window is created). Use the menu bar's 264 244 * resource instead. 265 245 */ 266 res = ui_window_get_res(mentry->menu-> parent);246 res = ui_window_get_res(mentry->menu->mbar->window); 267 247 268 248 *caption_w = ui_text_width(res->font, mentry->caption); … … 287 267 * This needs to work even if the menu is not open, so we cannot 288 268 * use the menu's resource, which is only created after the menu 289 * is open (and its window is created). Use the parent window's269 * is open (and its window is created). Use the menu bar's 290 270 * resource instead. 291 271 */ 292 res = ui_window_get_res(menu-> parent);272 res = ui_window_get_res(menu->mbar->window); 293 273 294 274 if (res->textmode) … … 326 306 * This needs to work even if the menu is not open, so we cannot 327 307 * use the menu's resource, which is only created after the menu 328 * is open (and its window is created). Use the parent window's308 * is open (and its window is created). Use the menu bar's 329 309 * resource instead. 330 310 */ 331 res = ui_window_get_res(mentry->menu-> parent);311 res = ui_window_get_res(mentry->menu->mbar->window); 332 312 333 313 if (res->textmode) { … … 392 372 fmt.hgl_color = res->wnd_sel_text_hgl_color; 393 373 bg_color = res->wnd_sel_text_bg_color; 394 } else if (mentry->disabled) {395 fmt.color = res->wnd_dis_text_color;396 fmt.hgl_color = res->wnd_dis_text_color;397 bg_color = res->wnd_face_color;398 374 } else { 399 375 fmt.color = res->wnd_text_color; … … 469 445 return; 470 446 471 if (mentry->separator || mentry->disabled)447 if (mentry->separator) 472 448 return; 473 449 … … 498 474 void ui_menu_entry_activate(ui_menu_entry_t *mentry) 499 475 { 500 /* Close menu */501 ui_menu_ close_req(mentry->menu);476 /* Deactivate menu bar, close menu */ 477 ui_menu_bar_deactivate(mentry->menu->mbar); 502 478 503 479 /* Call back */
Note:
See TracChangeset
for help on using the changeset viewer.
