Changeset 211fd68 in mainline for uspace/lib/ui/src/wdecor.c
- Timestamp:
- 2024-03-08T10:41:31Z (10 months ago)
- Branches:
- master
- Children:
- 0a411bbf
- Parents:
- cd27cd1
- git-author:
- Jiri Svoboda <jiri@…> (2024-03-07 18:41:21)
- git-committer:
- Jiri Svoboda <jiri@…> (2024-03-08 10:41:31)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/wdecor.c
rcd27cd1 r211fd68 1 1 /* 2 * Copyright (c) 202 3Jiri Svoboda2 * Copyright (c) 2024 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 45 45 #include <ui/paint.h> 46 46 #include <ui/pbutton.h> 47 #include <ui/ui.h> 47 48 #include <ui/wdecor.h> 48 49 #include "../private/resource.h" … … 94 95 /** Window resizing edge height */ 95 96 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, 96 101 /** Title bar height */ 97 102 wdecor_tbar_h = 22, … … 860 865 * and its decoration. 861 866 * 867 * @param ui UI 862 868 * @param style Decoration style 863 869 * @param app Application area rectangle 864 870 * @param rect Place to store (outer) window decoration rectangle 865 871 */ 866 void ui_wdecor_rect_from_app(ui_wdecor_style_t style, gfx_rect_t *app, 867 gfx_rect_t *rect) 868 { 872 void 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; 869 877 *rect = *app; 870 878 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 871 888 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; 880 897 } 881 898
Note:
See TracChangeset
for help on using the changeset viewer.