Changeset 9389aaa in mainline
- Timestamp:
- 2026-05-15T19:38:36Z (3 weeks ago)
- Branches:
- master
- Children:
- 08499f0
- Parents:
- 2f1be23
- File:
-
- 1 edited
-
uspace/lib/ui/src/progress.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/progress.c
r2f1be23 r9389aaa 40 40 #include <gfx/text.h> 41 41 #include <io/pos_event.h> 42 #include <stdio.h> 42 43 #include <stdlib.h> 43 44 #include <str.h> … … 153 154 gfx_coord2_t pos; 154 155 gfx_text_fmt_t fmt; 156 char buf[6]; 155 157 errno_t rc; 156 158 … … 184 186 fmt.valign = gfx_valign_center; 185 187 186 rc = gfx_puttext(&pos, &fmt, "42 %"); 188 snprintf(buf, sizeof(buf), "%u %%", progress->value); 189 190 rc = gfx_puttext(&pos, &fmt, buf); 187 191 if (rc != EOK) 188 192 goto error; … … 207 211 gfx_rect_t inside; 208 212 gfx_rect_t part; 213 gfx_coord_t width; 209 214 errno_t rc; 210 215 … … 221 226 } 222 227 228 width = inside.p1.x - inside.p0.x; 229 223 230 /* Paint completed part. */ 224 231 part.p0 = inside.p0; 225 part.p1.x = (inside.p0.x + inside.p1.x) / 2;232 part.p1.x = inside.p0.x + width * progress->value / 100; 226 233 part.p1.y = inside.p1.y; 227 234
Note:
See TracChangeset
for help on using the changeset viewer.
