Changeset 3c54869 in mainline for uspace/lib/ui/src/pbutton.c
- Timestamp:
- 2023-01-04T20:24:44Z (16 months ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5d86797
- Parents:
- cdd6fc9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/pbutton.c
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 188 188 } 189 189 190 /** Get button light status. 191 * 192 * @param pbutton Button 193 * @return @c true iff light is on 194 */ 195 bool ui_pbutton_get_light(ui_pbutton_t *pbutton) 196 { 197 return pbutton->light; 198 } 199 200 /** Turn button light on or off. 201 * 202 * @param pbutton Button 203 * @param light @c true iff button should be lit 204 */ 205 void ui_pbutton_set_light(ui_pbutton_t *pbutton, bool light) 206 { 207 pbutton->light = light; 208 } 209 190 210 /** Set push button caption. 191 211 * … … 327 347 gfx_rect_t irect; 328 348 gfx_coord_t thickness; 349 gfx_color_t *color; 329 350 bool depressed; 330 351 errno_t rc; … … 338 359 rect.p1.y = pbutton->rect.p1.y - thickness; 339 360 340 rc = gfx_set_color(pbutton->res->gc, pbutton->res->btn_face_color); 361 color = pbutton->light ? pbutton->res->btn_face_lit_color : 362 pbutton->res->btn_face_color; 363 364 rc = gfx_set_color(pbutton->res->gc, color); 341 365 if (rc != EOK) 342 366 goto error;
Note:
See TracChangeset
for help on using the changeset viewer.