Changeset a0aeb8f in mainline for uspace/app/hello/hello.c


Ignore:
Timestamp:
2021-09-05T08:11:37Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8ce56a6
Parents:
ab3bfc1
git-author:
Jiri Svoboda <jiri@…> (2021-09-05 08:09:56)
git-committer:
Jiri Svoboda <jiri@…> (2021-09-05 08:11:37)
Message:

Fix broken T-shirt slogan

Need to make sure "# hello -d cons@" works well

File:
1 edited

Legend:

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

    rab3bfc1 ra0aeb8f  
    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));
Note: See TracChangeset for help on using the changeset viewer.