Changeset b769ca0 in mainline for uspace/lib/ui/src/pbutton.c
- Timestamp:
- 2026-02-19T00:01:36Z (45 hours ago)
- Branches:
- master
- Children:
- 08fcaf2
- Parents:
- 39f67f1
- File:
-
- 1 edited
-
uspace/lib/ui/src/pbutton.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/pbutton.c
r39f67f1 rb769ca0 1 1 /* 2 * Copyright (c) 202 3Jiri Svoboda2 * Copyright (c) 2026 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 142 142 } 143 143 144 /** Set push button decoration ops. 145 * 146 * @param pbutton Push button 147 * @param ops Push button decoration callbacks 144 /** Set push button ops. 145 * 146 * These allow overriding the function for painting the button or 147 * painting the button decoration. 148 * 149 * @param pbutton Push button 150 * @param ops Push button ops 148 151 * @param arg Decoration ops argument 149 152 */ 150 void ui_pbutton_set_decor_ops(ui_pbutton_t *pbutton, 151 ui_pbutton_decor_ops_t *ops, void *arg) 152 { 153 pbutton->decor_ops = ops; 154 pbutton->decor_arg = arg; 153 void ui_pbutton_set_ops(ui_pbutton_t *pbutton, ui_pbutton_ops_t *ops, void *arg) 154 { 155 pbutton->ops = ops; 156 pbutton->ops_arg = arg; 155 157 } 156 158 … … 379 381 } 380 382 381 if (pbutton-> decor_ops != NULL && pbutton->decor_ops->paint != NULL) {383 if (pbutton->ops != NULL && pbutton->ops->decor_paint != NULL) { 382 384 /* Custom decoration */ 383 rc = pbutton-> decor_ops->paint(pbutton, pbutton->decor_arg,385 rc = pbutton->ops->decor_paint(pbutton, pbutton->ops_arg, 384 386 &pos); 385 387 if (rc != EOK) … … 503 505 errno_t ui_pbutton_paint(ui_pbutton_t *pbutton) 504 506 { 505 if (pbutton->res->textmode) 507 if (pbutton->ops != NULL && pbutton->ops->paint != NULL) { 508 /* Custom paint routine */ 509 return pbutton->ops->paint(pbutton, pbutton->ops_arg); 510 } else if (pbutton->res->textmode) { 506 511 return ui_pbutton_paint_text(pbutton); 507 else512 } else { 508 513 return ui_pbutton_paint_gfx(pbutton); 514 } 509 515 } 510 516
Note:
See TracChangeset
for help on using the changeset viewer.
