Changeset e1f5fb19 in mainline for uspace/lib/ui/src/window.c


Ignore:
Timestamp:
2023-04-14T12:56:27Z (8 months ago)
Author:
GitHub <noreply@…>
Children:
89bca606
Parents:
2a230b6
git-author:
SimonJRiddix <69309548+simonjriddix@…> (2023-04-14 12:56:27)
git-committer:
GitHub <noreply@…> (2023-04-14 12:56:27)
Message:

add relative bottom left/right taskbar coordinates

the absolute coordinates of the screen and relative to the taskbar have been added both in the lower left and in the lower right.
Absolute coordinates place the window above the taskbar, while non-absolute coordinates place the window above the taskbar.
The taskbar delta calculation is a fixed value that corresponds to the height of the taskbar. It is necessary to create a communication the size of the taskbar.

File:
1 edited

Legend:

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

    r2a230b6 re1f5fb19  
    11/*
    22 * Copyright (c) 2023 Jiri Svoboda
     3 * Copyright (c) 2023 SimonJRiddix
    34 * All rights reserved.
    45 *
     
    157158        pos->y = 0;
    158159
     160        int taskbar_height = 32;
     161
    159162        switch (params->placement) {
    160163        case ui_wnd_place_default:
     
    176179        case ui_wnd_place_bottom_left:
    177180                pos->x = drect->p0.x - params->rect.p0.x;
     181                pos->y = drect->p1.y - params->rect.p1.y - taskbar_height;
     182                break;
     183        case ui_wnd_place_bottom_right:
     184                pos->x = drect->p1.x - params->rect.p1.x;
     185                pos->y = drect->p1.y - params->rect.p1.y - taskbar_height;
     186                break;
     187        case ui_wnd_place_bottom_left_absolute:
     188                pos->x = drect->p0.x - params->rect.p0.x;
    178189                pos->y = drect->p1.y - params->rect.p1.y;
    179190                break;
    180         case ui_wnd_place_bottom_right:
     191        case ui_wnd_place_bottom_right_absolute:
    181192                pos->x = drect->p1.x - params->rect.p1.x;
    182193                pos->y = drect->p1.y - params->rect.p1.y;
Note: See TracChangeset for help on using the changeset viewer.