Changeset 61b5b73d in mainline
- Timestamp:
- 2014-01-17T14:33:02Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 476f62c, 66be0288
- Parents:
- 6a3d0c7
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/vterm/vterm.c
r6a3d0c7 r61b5b73d 55 55 } 56 56 57 window_resize(main_window, 0, 0, 648, 5 10, WINDOW_PLACEMENT_ANY);57 window_resize(main_window, 0, 0, 648, 508, WINDOW_PLACEMENT_ANY); 58 58 terminal_t *terminal_widget = 59 59 create_terminal(window_root(main_window), 640, 480); -
uspace/lib/gui/common.c
r6a3d0c7 r61b5b73d 38 38 #include "common.h" 39 39 40 #define CROSS_WIDTH 14 41 #define CROSS_HEIGHT 14 42 43 static uint8_t cross_texture[] = { 44 0x00, 0x00, 0x02, 0x08, 0x04, 0x04, 0x08, 0x02, 0x10, 0x01, 0xa0, 0x00, 45 0x40, 0x00, 0xa0, 0x00, 0x10, 0x01, 0x08, 0x02, 0x04, 0x04, 0x02, 0x08, 46 0x01, 0x10, 0x00, 0x00 47 }; 48 49 static uint8_t cross_mask[] = { 50 0x00, 0x00, 0x02, 0x18, 0x06, 0x0c, 0x0c, 0x06, 0x18, 0x03, 0xb0, 0x01, 51 0xe0, 0x00, 0xe0, 0x00, 0xb0, 0x01, 0x18, 0x03, 0x0c, 0x06, 0x06, 0x0c, 52 0x03, 0x18, 0x00, 0x00 53 }; 54 55 void draw_icon_cross(surface_t *surface, sysarg_t hpos, sysarg_t vpos, 56 pixel_t highlight, pixel_t shadow) 57 { 58 for (unsigned int y = 0; y < CROSS_HEIGHT; y++) { 59 for (unsigned int x = 0; x < CROSS_WIDTH; x++) { 60 size_t offset = y * ((CROSS_WIDTH - 1) / 8 + 1) + x / 8; 61 bool visible = cross_mask[offset] & (1 << (x % 8)); 62 pixel_t pixel = (cross_texture[offset] & (1 << (x % 8))) ? 63 highlight : shadow; 64 65 if (visible) 66 surface_put_pixel(surface, hpos + x, vpos + y, pixel); 67 } 68 } 69 } 70 40 71 void draw_bevel(drawctx_t *drawctx, source_t *source, sysarg_t hpos, 41 72 sysarg_t vpos, sysarg_t width, sysarg_t height, pixel_t highlight, -
uspace/lib/gui/common.h
r6a3d0c7 r61b5b73d 40 40 #include <drawctx.h> 41 41 42 extern void draw_icon_cross(surface_t *, sysarg_t, sysarg_t, pixel_t, pixel_t); 42 43 extern void draw_bevel(drawctx_t *, source_t *, sysarg_t, sysarg_t, sysarg_t, 43 44 sysarg_t, pixel_t, pixel_t); -
uspace/lib/gui/window.c
r6a3d0c7 r61b5b73d 63 63 static sysarg_t border_thickness = 4; 64 64 static sysarg_t bevel_thickness = 1; 65 static sysarg_t header_height = 2 2;65 static sysarg_t header_height = 20; 66 66 static sysarg_t header_min_width = 40; 67 static sysarg_t close_thickness = 2 2;67 static sysarg_t close_thickness = 20; 68 68 69 69 static pixel_t color_highlight = PIXEL(255, 255, 255, 255); … … 155 155 /* Close button icon */ 156 156 157 draw_bevel(&drawctx, &source, close_hpos + 6, close_vpos + 9, 158 close_thickness - 12, close_thickness - 18, color_highlight, 159 color_shadow); 157 draw_icon_cross(surface, close_hpos + 3, close_vpos + 3, 158 color_highlight, color_shadow); 160 159 161 160 /* Window caption */
Note:
See TracChangeset
for help on using the changeset viewer.