Changeset 9b502dd in mainline
- Timestamp:
- 2020-03-15T18:16:58Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b3825aa
- Parents:
- 03c8081
- Location:
- uspace
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/display/include/types/display/wndparams.h
r03c8081 r9b502dd 48 48 /** Bounding rectangle */ 49 49 gfx_rect_t rect; 50 /** Minimum size (when being resized) */ 51 gfx_coord2_t min_size; 50 52 } display_wnd_params_t; 51 53 -
uspace/lib/display/test/display.c
r03c8081 r9b502dd 97 97 bool window_create_called; 98 98 gfx_rect_t create_rect; 99 gfx_coord2_t create_min_size; 99 100 bool window_destroy_called; 100 101 sysarg_t destroy_wnd_id; … … 183 184 params.rect.p0.x = 100; 184 185 params.rect.p0.y = 100; 186 params.min_size.x = 11; 187 params.min_size.y = 12; 185 188 186 189 rc = display_window_create(disp, ¶ms, &test_display_wnd_cb, … … 191 194 PCUT_ASSERT_EQUALS(params.rect.p1.x, resp.create_rect.p1.x); 192 195 PCUT_ASSERT_EQUALS(params.rect.p1.y, resp.create_rect.p1.y); 196 PCUT_ASSERT_EQUALS(params.min_size.x, resp.create_min_size.x); 197 PCUT_ASSERT_EQUALS(params.min_size.y, resp.create_min_size.y); 193 198 PCUT_ASSERT_ERRNO_VAL(resp.rc, rc); 194 199 PCUT_ASSERT_NULL(wnd); … … 1238 1243 resp->window_create_called = true; 1239 1244 resp->create_rect = params->rect; 1245 resp->create_min_size = params->min_size; 1240 1246 if (resp->rc == EOK) 1241 1247 *rwnd_id = resp->wnd_id; -
uspace/lib/gui/window.c
r03c8081 r9b502dd 645 645 wparams.rect.p1.x = 100; 646 646 wparams.rect.p1.y = 100; 647 wparams.min_size.x = 2 * border_thickness + header_min_width; 648 wparams.min_size.y = 2 * border_thickness + header_height; 647 649 648 650 rc = display_window_create(win->display, &wparams, &window_cb, -
uspace/srv/hid/display/types/display/window.h
r03c8081 r9b502dd 70 70 /** Display position */ 71 71 gfx_coord2_t dpos; 72 /** Minimum size */ 73 gfx_coord2_t min_size; 72 74 /** Window ID */ 73 75 ds_wnd_id_t id; -
uspace/srv/hid/display/window.c
r03c8081 r9b502dd 43 43 #include <io/log.h> 44 44 #include <io/pixelmap.h> 45 #include <macros.h> 45 46 #include <stdlib.h> 46 47 #include "client.h" … … 302 303 303 304 wnd->rect = params->rect; 305 wnd->min_size = params->min_size; 304 306 wnd->gc = gc; 305 307 *rgc = wnd; … … 750 752 gfx_rect_t *nrect) 751 753 { 752 *nrect = wnd->rect; 753 754 if ((wnd->rsztype & display_wr_top) != 0) 755 nrect->p0.y += dresize->y; 756 if ((wnd->rsztype & display_wr_left) != 0) 757 nrect->p0.x += dresize->x; 758 if ((wnd->rsztype & display_wr_bottom) != 0) 759 nrect->p1.y += dresize->y; 760 if ((wnd->rsztype & display_wr_right) != 0) 761 nrect->p1.x += dresize->x; 754 if ((wnd->rsztype & display_wr_top) != 0) { 755 nrect->p0.y = min(wnd->rect.p0.y + dresize->y, 756 wnd->rect.p1.y - wnd->min_size.y); 757 } else { 758 nrect->p0.y = wnd->rect.p0.y; 759 } 760 761 if ((wnd->rsztype & display_wr_left) != 0) { 762 nrect->p0.x = min(wnd->rect.p0.x + dresize->x, 763 wnd->rect.p1.x - wnd->min_size.x); 764 } else { 765 nrect->p0.x = wnd->rect.p0.x; 766 } 767 768 if ((wnd->rsztype & display_wr_bottom) != 0) { 769 nrect->p1.y = max(wnd->rect.p1.y + dresize->y, 770 wnd->rect.p0.y + wnd->min_size.y); 771 } else { 772 nrect->p1.y = wnd->rect.p1.y; 773 } 774 775 if ((wnd->rsztype & display_wr_right) != 0) { 776 nrect->p1.x = max(wnd->rect.p1.x + dresize->x, 777 wnd->rect.p0.x + wnd->min_size.x); 778 } else { 779 nrect->p1.x = wnd->rect.p1.x; 780 } 762 781 } 763 782
Note:
See TracChangeset
for help on using the changeset viewer.