Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/hello/hello.c

    r68698ba r552b69f  
    11/*
    2  * Copyright (c) 2020 Jiri Svoboda
     2 * Copyright (c) 2021 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    8080        ui_wnd_params_init(&params);
    8181        params.caption = "Hello World";
    82         params.rect.p0.x = 0;
    83         params.rect.p0.y = 0;
    84         params.rect.p1.x = 200;
    85         params.rect.p1.y = 60;
     82        if (ui_is_textmode(ui)) {
     83                params.rect.p0.x = 0;
     84                params.rect.p0.y = 0;
     85                params.rect.p1.x = 24;
     86                params.rect.p1.y = 5;
     87        } else {
     88                params.rect.p0.x = 0;
     89                params.rect.p0.y = 0;
     90                params.rect.p1.x = 200;
     91                params.rect.p1.y = 60;
     92        }
    8693
    8794        memset((void *) &hello, 0, sizeof(hello));
     
    111118        }
    112119
    113         rect.p0.x = 10;
    114         rect.p0.y = 35;
    115         rect.p1.x = 190;
    116         rect.p1.y = 50;
     120        ui_window_get_app_rect(window, &rect);
    117121        ui_label_set_rect(hello.label, &rect);
    118122        ui_label_set_halign(hello.label, gfx_halign_center);
     123        ui_label_set_valign(hello.label, gfx_valign_center);
    119124
    120125        rc = ui_fixed_add(hello.fixed, ui_label_ctl(hello.label));
     
    147152int main(int argc, char *argv[])
    148153{
    149         const char *display_spec = UI_DISPLAY_DEFAULT;
     154        const char *display_spec = UI_ANY_DEFAULT;
    150155        errno_t rc;
    151156        int i;
Note: See TracChangeset for help on using the changeset viewer.