Changeset 61b5b73d in mainline


Ignore:
Timestamp:
2014-01-17T14:33:02Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
476f62c, 66be0288
Parents:
6a3d0c7
Message:

make the title bar more subtle, change the close icon to the easily recognizable cross

Location:
uspace
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/vterm/vterm.c

    r6a3d0c7 r61b5b73d  
    5555        }
    5656       
    57         window_resize(main_window, 0, 0, 648, 510, WINDOW_PLACEMENT_ANY);
     57        window_resize(main_window, 0, 0, 648, 508, WINDOW_PLACEMENT_ANY);
    5858        terminal_t *terminal_widget =
    5959            create_terminal(window_root(main_window), 640, 480);
  • uspace/lib/gui/common.c

    r6a3d0c7 r61b5b73d  
    3838#include "common.h"
    3939
     40#define CROSS_WIDTH   14
     41#define CROSS_HEIGHT  14
     42
     43static 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
     49static 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
     55void 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
    4071void draw_bevel(drawctx_t *drawctx, source_t *source, sysarg_t hpos,
    4172    sysarg_t vpos, sysarg_t width, sysarg_t height, pixel_t highlight,
  • uspace/lib/gui/common.h

    r6a3d0c7 r61b5b73d  
    4040#include <drawctx.h>
    4141
     42extern void draw_icon_cross(surface_t *, sysarg_t, sysarg_t, pixel_t, pixel_t);
    4243extern void draw_bevel(drawctx_t *, source_t *, sysarg_t, sysarg_t, sysarg_t,
    4344    sysarg_t, pixel_t, pixel_t);
  • uspace/lib/gui/window.c

    r6a3d0c7 r61b5b73d  
    6363static sysarg_t border_thickness = 4;
    6464static sysarg_t bevel_thickness = 1;
    65 static sysarg_t header_height = 22;
     65static sysarg_t header_height = 20;
    6666static sysarg_t header_min_width = 40;
    67 static sysarg_t close_thickness = 22;
     67static sysarg_t close_thickness = 20;
    6868
    6969static pixel_t color_highlight = PIXEL(255, 255, 255, 255);
     
    155155        /* Close button icon */
    156156       
    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);
    160159       
    161160        /* Window caption */
Note: See TracChangeset for help on using the changeset viewer.