Changeset d70dc1c4 in mainline for uspace/lib/ui/src
- Timestamp:
- 2021-01-06T10:06:42Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7020d1f
- Parents:
- e037cf37
- git-author:
- Jiri Svoboda <jiri@…> (2021-01-05 18:06:37)
- git-committer:
- Jiri Svoboda <jiri@…> (2021-01-06 10:06:42)
- Location:
- uspace/lib/ui/src
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/entry.c
re037cf37 rd70dc1c4 173 173 gfx_text_fmt_t fmt; 174 174 gfx_coord2_t pos; 175 gfx_rect_t frame;176 175 gfx_rect_t inside; 177 176 errno_t rc; … … 179 178 /* Paint inset frame */ 180 179 181 rc = ui_paint_bevel(entry->res->gc, &entry->rect, 182 entry->res->wnd_shadow_color, entry->res->wnd_highlight_color, 183 1, &frame); 184 if (rc != EOK) 185 goto error; 186 187 rc = ui_paint_bevel(entry->res->gc, &frame, 188 entry->res->wnd_frame_sh_color, entry->res->wnd_frame_hi_color, 189 1, &inside); 180 rc = ui_paint_inset_frame(entry->res, &entry->rect, &inside); 190 181 if (rc != EOK) 191 182 goto error; -
uspace/lib/ui/src/paint.c
re037cf37 rd70dc1c4 39 39 #include <gfx/render.h> 40 40 #include <ui/paint.h> 41 #include "../private/resource.h" 41 42 42 43 /** Paint bevel. … … 118 119 } 119 120 121 /** Paint inset frame. 122 * 123 * @param resource UI resource 124 * @param rect Rectangle to paint onto 125 * @param inside Place to store inside rectangle or @c NULL 126 * @return EOK on success or an error code 127 */ 128 errno_t ui_paint_inset_frame(ui_resource_t *resource, gfx_rect_t *rect, 129 gfx_rect_t *inside) 130 { 131 gfx_rect_t frame; 132 errno_t rc; 133 134 rc = ui_paint_bevel(resource->gc, rect, 135 resource->wnd_shadow_color, resource->wnd_highlight_color, 136 1, &frame); 137 if (rc != EOK) 138 goto error; 139 140 rc = ui_paint_bevel(resource->gc, &frame, 141 resource->wnd_frame_sh_color, resource->wnd_frame_hi_color, 142 1, inside); 143 if (rc != EOK) 144 goto error; 145 146 return EOK; 147 error: 148 return rc; 149 } 150 120 151 /** @} 121 152 */ -
uspace/lib/ui/src/resource.c
re037cf37 rd70dc1c4 76 76 gfx_color_t *entry_fg_color = NULL; 77 77 gfx_color_t *entry_bg_color = NULL; 78 gfx_color_t *entry_act_bg_color = NULL; 78 79 errno_t rc; 79 80 … … 166 167 167 168 rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff, &entry_bg_color); 169 if (rc != EOK) 170 goto error; 171 172 rc = gfx_color_new_rgb_i16(0xc8c8, 0xc8c8, 0xc8c8, &entry_act_bg_color); 168 173 if (rc != EOK) 169 174 goto error; … … 193 198 resource->entry_fg_color = entry_fg_color; 194 199 resource->entry_bg_color = entry_bg_color; 200 resource->entry_act_bg_color = entry_act_bg_color; 195 201 196 202 *rresource = resource; … … 234 240 if (entry_bg_color != NULL) 235 241 gfx_color_delete(entry_bg_color); 242 if (entry_act_bg_color != NULL) 243 gfx_color_delete(entry_act_bg_color); 236 244 237 245 if (tface != NULL) … … 270 278 gfx_color_delete(resource->entry_fg_color); 271 279 gfx_color_delete(resource->entry_bg_color); 280 gfx_color_delete(resource->entry_act_bg_color); 272 281 273 282 gfx_font_close(resource->font);
Note:
See TracChangeset
for help on using the changeset viewer.