Changeset 25f26600 in mainline for uspace/lib/ui/src/wdecor.c


Ignore:
Timestamp:
2020-12-07T23:44:20Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
13d20e5, 4db4718d, e9c1639
Parents:
7e38970d
Message:

Resize application GC when resizing window (and app GC is being used)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/wdecor.c

    r7e38970d r25f26600  
    359359}
    360360
     361/** Application area rectangle from window rectangle.
     362 *
     363 * Note that this needs to work just based on a UI, without having an actual
     364 * window decoration, since we need it in process of resizing the window,
     365 * before it is actually resized.
     366 *
     367 * @param style Decoration style
     368 * @param rect Window decoration rectangle
     369 * @param app Place to store application area rectangle
     370 */
     371void ui_wdecor_app_from_rect(ui_wdecor_style_t style, gfx_rect_t *rect,
     372    gfx_rect_t *app)
     373{
     374        *app = *rect;
     375
     376        if ((style & ui_wds_frame) != 0) {
     377                app->p0.x += wdecor_edge_w;
     378                app->p0.y += wdecor_edge_h;
     379                app->p1.x -= wdecor_edge_w;
     380                app->p1.y -= wdecor_edge_h;
     381        }
     382
     383        if ((style & ui_wds_titlebar) != 0)
     384                app->p0.y += 22;
     385}
     386
    361387/** Get resize type for pointer at the specified position.
    362388 *
Note: See TracChangeset for help on using the changeset viewer.