Ignore:
File:
1 edited

Legend:

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

    rec50d65e r0d00e53  
    189189        switch (params->placement) {
    190190        case ui_wnd_place_default:
    191                 assert(ui_is_fullscreen(window->ui));
     191        case ui_wnd_place_center:
     192                assert(params->placement != ui_wnd_place_default ||
     193                    ui_is_fullscreen(window->ui));
    192194                /* Center window */
    193195                gfx_rect_dims(&params->rect, &dims);
     
    343345        dparams.rect = params->rect;
    344346        dparams.caption = params->caption;
    345         /* Only allow making the window larger */
    346         gfx_rect_dims(&params->rect, &dparams.min_size);
     347        dparams.min_size = params->min_size;
    347348
    348349        /*
     
    358359        if ((params->flags & ui_wndf_popup) != 0)
    359360                dparams.flags |= wndf_popup;
     361        if ((params->flags & ui_wndf_nofocus) != 0)
     362                dparams.flags |= wndf_nofocus;
    360363        if ((params->flags & ui_wndf_topmost) != 0)
    361364                dparams.flags |= wndf_topmost;
     
    10471050        ui_lock(ui);
    10481051        (void) ui_window_resize(window, rect);
    1049         (void) ui_window_paint(window);
     1052        ui_window_send_resize(window);
    10501053        ui_unlock(ui);
    10511054}
     
    12951298void ui_window_send_minimize(ui_window_t *window)
    12961299{
    1297         if (window->cb != NULL && window->cb->maximize != NULL)
     1300        if (window->cb != NULL && window->cb->minimize != NULL)
    12981301                window->cb->minimize(window, window->arg);
    12991302        else
     
    13931396        else
    13941397                return ui_window_def_unfocus(window, nfocus);
     1398}
     1399
     1400/** Send window resize event.
     1401 *
     1402 * @param window Window
     1403 */
     1404void ui_window_send_resize(ui_window_t *window)
     1405{
     1406        if (window->cb != NULL && window->cb->resize != NULL)
     1407                window->cb->resize(window, window->arg);
     1408        else
     1409                return ui_window_def_resize(window);
    13951410}
    13961411
     
    15731588        if (window->control != NULL)
    15741589                ui_control_unfocus(window->control, nfocus);
     1590}
     1591
     1592/** Default window resize routine.
     1593 *
     1594 * @param window Window
     1595 * @return EOK on success or an error code
     1596 */
     1597void ui_window_def_resize(ui_window_t *window)
     1598{
     1599        ui_window_paint(window);
    15751600}
    15761601
Note: See TracChangeset for help on using the changeset viewer.