Changeset 65ec18d in mainline
- Timestamp:
- 2021-06-24T21:33:49Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f5819ca1
- Parents:
- 37d0dd4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/entry.c
r37d0dd4 r65ec18d 60 60 ui_entry_vpad = 4, 61 61 ui_entry_hpad_text = 1, 62 ui_entry_vpad_text = 0 62 ui_entry_vpad_text = 0, 63 ui_entry_cursor_overshoot = 1, 64 ui_entry_cursor_width = 2, 65 ui_entry_cursor_width_text = 1 63 66 }; 64 67 … … 178 181 179 182 return EOK; 183 } 184 185 static errno_t ui_entry_paint_cursor(ui_entry_t *entry, gfx_coord2_t *pos) 186 { 187 ui_resource_t *res; 188 gfx_rect_t rect; 189 gfx_font_metrics_t metrics; 190 gfx_coord_t w; 191 errno_t rc; 192 193 res = ui_window_get_res(entry->window); 194 195 gfx_font_get_metrics(res->font, &metrics); 196 197 w = res->textmode ? ui_entry_cursor_width_text : 198 ui_entry_cursor_width; 199 200 rect.p0.x = pos->x; 201 rect.p0.y = pos->y - ui_entry_cursor_overshoot; 202 rect.p1.x = pos->x + w; 203 rect.p1.y = pos->y + metrics.ascent + metrics.descent + 1 + 204 ui_entry_cursor_overshoot; 205 206 rc = gfx_set_color(res->gc, res->entry_fg_color); 207 if (rc != EOK) 208 goto error; 209 210 rc = gfx_fill_rect(res->gc, &rect); 211 if (rc != EOK) 212 goto error; 213 214 return EOK; 215 error: 216 return rc; 180 217 } 181 218 … … 261 298 pos.x += width; 262 299 263 rc = gfx_puttext(res->font, &pos, &fmt, "_");300 rc = ui_entry_paint_cursor(entry, &pos); 264 301 if (rc != EOK) { 265 302 (void) gfx_set_clip_rect(res->gc, NULL);
Note:
See TracChangeset
for help on using the changeset viewer.