Changeset 2f106b0 in mainline for uspace/app/taskbar/wndlist.c
- Timestamp:
- 2022-11-12T20:48:05Z (2 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a5c7b865
- Parents:
- c48192e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskbar/wndlist.c
rc48192e r2f106b0 64 64 }; 65 65 66 enum { 67 /** X distance between left edges of two consecutive buttons */ 68 wndlist_button_pitch = 145, 69 /** X distance between left edges of two consecutive buttons (text) */ 70 wndlist_button_pitch_text = 17, 71 /** Padding between buttons */ 72 wndlist_button_pad = 5, 73 /** Padding between buttons (text) */ 74 wndlist_button_pad_text = 1 75 }; 76 66 77 /** Create task bar window list. 67 78 * … … 91 102 error: 92 103 return rc; 104 } 105 106 /** Set window list rectangle. 107 * 108 * @param wndlist Window list 109 * @param rect Rectangle 110 */ 111 void wndlist_set_rect(wndlist_t *wndlist, gfx_rect_t *rect) 112 { 113 wndlist->rect = *rect; 93 114 } 94 115 … … 287 308 gfx_rect_t rect; 288 309 ui_resource_t *res; 310 gfx_coord_t pitch; 311 gfx_coord_t pad; 289 312 size_t idx; 290 313 … … 301 324 302 325 if (ui_resource_is_textmode(res)) { 303 rect.p0.x = 17 * idx + 9; 326 pitch = wndlist_button_pitch_text; 327 pad = wndlist_button_pad_text; 328 } else { 329 pitch = wndlist_button_pitch; 330 pad = wndlist_button_pad; 331 } 332 333 rect.p0.x = wndlist->rect.p0.x + pitch * idx; 334 rect.p0.y = wndlist->rect.p0.y; 335 rect.p1.x = wndlist->rect.p0.x + pitch * (idx + 1) - pad; 336 rect.p1.y = wndlist->rect.p1.y; 337 338 /* Entry does not fit? */ 339 if (rect.p1.x > wndlist->rect.p1.x) { 340 /* Make entry invisible */ 341 rect.p0.x = 0; 304 342 rect.p0.y = 0; 305 rect.p1.x = 17 * idx + 25; 306 rect.p1.y = 1; 307 } else { 308 rect.p0.x = 145 * idx + 90; 309 rect.p0.y = 4; 310 rect.p1.x = 145 * idx + 230; 311 rect.p1.y = 28; 343 rect.p1.x = 0; 344 rect.p1.y = 0; 312 345 } 313 346
Note:
See TracChangeset
for help on using the changeset viewer.