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


Ignore:
Timestamp:
2024-04-07T09:52:47Z (14 months ago)
Author:
Nataliia Korop <n.corop08@…>
Children:
e55d2c1
Parents:
6c1e7c0 (diff), 34aad53d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'topic/packet-capture' into topic/packet-capture-choose-nic

File:
1 edited

Legend:

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

    r6c1e7c0 rc37c24c  
    11/*
    2  * Copyright (c) 2023 Jiri Svoboda
     2 * Copyright (c) 2024 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    4545#include <ui/paint.h>
    4646#include <ui/pbutton.h>
     47#include <ui/ui.h>
    4748#include <ui/wdecor.h>
    4849#include "../private/resource.h"
     
    9495        /** Window resizing edge height */
    9596        wdecor_edge_h = 4,
     97        /** Window resizing edge witdth */
     98        wdecor_edge_w_text = 1,
     99        /** Window resizing edge height */
     100        wdecor_edge_h_text = 1,
    96101        /** Title bar height */
    97102        wdecor_tbar_h = 22,
     
    860865 * and its decoration.
    861866 *
     867 * @param ui UI
    862868 * @param style Decoration style
    863869 * @param app Application area rectangle
    864870 * @param rect Place to store (outer) window decoration rectangle
    865871 */
    866 void ui_wdecor_rect_from_app(ui_wdecor_style_t style, gfx_rect_t *app,
    867     gfx_rect_t *rect)
    868 {
     872void ui_wdecor_rect_from_app(ui_t *ui, ui_wdecor_style_t style,
     873    gfx_rect_t *app, gfx_rect_t *rect)
     874{
     875        bool textmode;
     876        gfx_coord_t edge_w, edge_h;
    869877        *rect = *app;
    870878
     879        textmode = ui_is_textmode(ui);
     880        if (textmode) {
     881                edge_w = wdecor_edge_w_text;
     882                edge_h = wdecor_edge_h_text;
     883        } else {
     884                edge_w = wdecor_edge_w;
     885                edge_h = wdecor_edge_h;
     886        }
     887
    871888        if ((style & ui_wds_frame) != 0) {
    872                 rect->p0.x -= wdecor_edge_w;
    873                 rect->p0.y -= wdecor_edge_h;
    874                 rect->p1.x += wdecor_edge_w;
    875                 rect->p1.y += wdecor_edge_h;
    876         }
    877 
    878         if ((style & ui_wds_titlebar) != 0)
    879                 rect->p0.y -= 22;
     889                rect->p0.x -= edge_w;
     890                rect->p0.y -= edge_h;
     891                rect->p1.x += edge_w;
     892                rect->p1.y += edge_h;
     893        }
     894
     895        if ((style & ui_wds_titlebar) != 0 && !textmode)
     896                rect->p0.y -= wdecor_tbar_h;
    880897}
    881898
Note: See TracChangeset for help on using the changeset viewer.