Changeset 0576df9 in mainline for uspace/lib/ui/src/window.c
- Timestamp:
- 2020-11-14T21:28:35Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63b35c7
- Parents:
- 38f5598
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/window.c
r38f5598 r0576df9 215 215 } 216 216 217 /** Resize/move window. 218 * 219 * Resize window to the dimensions of @a rect. If @a rect.p0 is not 0,0, 220 * the top-left corner of the window will move on the screen accordingly. 221 * 222 * @param window Window 223 * @param rect Rectangle 224 * 225 * @return EOK on success or an error code 226 */ 227 errno_t ui_window_resize(ui_window_t *window, gfx_rect_t *rect) 228 { 229 gfx_coord2_t offs; 230 gfx_rect_t nrect; 231 errno_t rc; 232 233 /* 234 * Move rect so that p0=0,0 - keep window's coordinate system origin 235 * locked to top-left corner of the window. 236 */ 237 offs = rect->p0; 238 gfx_rect_rtranslate(&offs, rect, &nrect); 239 240 /* dwindow can be NULL in case of unit tests */ 241 if (window->dwindow != NULL) { 242 rc = display_window_resize(window->dwindow, &offs, &nrect); 243 if (rc != EOK) 244 return rc; 245 } 246 247 ui_wdecor_set_rect(window->wdecor, &nrect); 248 ui_wdecor_paint(window->wdecor); 249 return EOK; 250 } 251 217 252 /** Set window callbacks. 218 253 *
Note:
See TracChangeset
for help on using the changeset viewer.