Changeset 8a9a41e in mainline for uspace/lib/ui/src/wdecor.c
- Timestamp:
- 2021-10-24T08:28:43Z (4 years ago)
- Children:
- 9ea3a41
- Parents:
- 2ce943a (diff), cd981f2a (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. - git-author:
- Erik Kučák <35500848+Riko196@…> (2021-10-24 08:28:43)
- git-committer:
- GitHub <noreply@…> (2021-10-24 08:28:43)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/wdecor.c
r2ce943a r8a9a41e 61 61 wdecor_edge_h = 4, 62 62 wdecor_tbar_h = 22, 63 wdecor_tbar_h_text = 1,64 63 wdecor_frame_w = 4, 65 64 wdecor_frame_w_text = 1 … … 170 169 gfx_rect_t rect; 171 170 gfx_rect_t trect; 171 gfx_rect_t text_rect; 172 172 gfx_text_fmt_t fmt; 173 173 gfx_coord2_t pos; … … 180 180 181 181 if (wdecor->res->textmode != false) { 182 rc = ui_paint_bevel(wdecor->res->gc, &rect, 183 wdecor->res->wnd_frame_hi_color, 184 wdecor->res->wnd_frame_sh_color, 1, &rect); 182 rc = ui_paint_text_box(wdecor->res, &rect, 183 ui_box_double, wdecor->res->wnd_face_color); 185 184 if (rc != EOK) 186 185 return rc; … … 208 207 if (rc != EOK) 209 208 return rc; 209 210 rc = gfx_set_color(wdecor->res->gc, wdecor->active ? 211 wdecor->res->tbar_act_bg_color : 212 wdecor->res->tbar_inact_bg_color); 213 if (rc != EOK) 214 return rc; 215 216 rc = gfx_fill_rect(wdecor->res->gc, &trect); 217 if (rc != EOK) 218 return rc; 210 219 } 211 212 rc = gfx_set_color(wdecor->res->gc, wdecor->active ?213 wdecor->res->tbar_act_bg_color :214 wdecor->res->tbar_inact_bg_color);215 if (rc != EOK)216 return rc;217 218 rc = gfx_fill_rect(wdecor->res->gc, &trect);219 if (rc != EOK)220 return rc;221 220 222 221 gfx_text_fmt_init(&fmt); … … 230 229 pos.y = (trect.p0.y + trect.p1.y) / 2; 231 230 231 if (wdecor->res->textmode) { 232 /* Make space around caption text */ 233 gfx_text_rect(wdecor->res->font, &pos, &fmt, 234 wdecor->caption, &text_rect); 235 236 /* Only make space if caption is non-empty */ 237 if (text_rect.p0.x < text_rect.p1.x) { 238 text_rect.p0.x -= 1; 239 text_rect.p1.x += 1; 240 } 241 242 rc = gfx_set_color(wdecor->res->gc, wdecor->active ? 243 wdecor->res->tbar_act_bg_color : 244 wdecor->res->tbar_inact_bg_color); 245 if (rc != EOK) 246 return rc; 247 248 rc = gfx_fill_rect(wdecor->res->gc, &text_rect); 249 if (rc != EOK) 250 return rc; 251 } 252 232 253 rc = gfx_puttext(wdecor->res->font, &pos, &fmt, wdecor->caption); 233 254 if (rc != EOK) … … 301 322 { 302 323 gfx_coord_t frame_w; 303 gfx_coord_t tbar_h;304 324 305 325 /* Does window have a frame? */ … … 318 338 /* Does window have a title bar? */ 319 339 if ((wdecor->style & ui_wds_titlebar) != 0) { 320 tbar_h = wdecor->res->textmode ? 321 wdecor_tbar_h_text : wdecor_tbar_h; 322 323 geom->title_bar_rect.p0 = geom->interior_rect.p0; 324 geom->title_bar_rect.p1.x = geom->interior_rect.p1.x; 325 geom->title_bar_rect.p1.y = geom->interior_rect.p0.y + tbar_h; 340 if (wdecor->res->textmode) { 341 geom->title_bar_rect.p0 = wdecor->rect.p0; 342 geom->title_bar_rect.p1.x = wdecor->rect.p1.x; 343 geom->title_bar_rect.p1.y = wdecor->rect.p0.y + 1; 344 } else { 345 geom->title_bar_rect.p0 = geom->interior_rect.p0; 346 geom->title_bar_rect.p1.x = geom->interior_rect.p1.x; 347 geom->title_bar_rect.p1.y = geom->interior_rect.p0.y + 348 wdecor_tbar_h; 349 } 326 350 327 351 geom->app_area_rect.p0.x = geom->interior_rect.p0.x;
Note:
See TracChangeset
for help on using the changeset viewer.