Changeset b8f1a349 in mainline


Ignore:
Timestamp:
2013-04-09T17:30:11Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c43b89e8
Parents:
e31ea20d
Message:

add HelenOS logo to the launcher
(the grid layout widget currently creates uniform cells and ignores widget dimension hints, therefore the window needs to be so high and ugly)

Location:
uspace
Files:
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/app/vlaunch/Makefile

    re31ea20d rb8f1a349  
    3535
    3636SOURCES = \
    37         vlaunch.c
     37        vlaunch.c \
     38        images.c
     39
     40IMAGES = \
     41        gfx/helenos.tga
     42
     43PRE_DEPEND = images.c images.h
     44EXTRA_CLEAN = images.c images.h
    3845
    3946include $(USPACE_PREFIX)/Makefile.common
     47
     48images.c images.h: $(IMAGES)
     49        $(ROOT_PATH)/tools/mkarray.py images COMPOSITOR_IMAGES $^
  • uspace/app/vlaunch/vlaunch.c

    re31ea20d rb8f1a349  
    4646#include <button.h>
    4747#include <label.h>
     48#include <canvas.h>
    4849
    49 #define NAME "vlaunch"
     50#include <surface.h>
     51#include <source.h>
     52#include <drawctx.h>
     53#include <codec/tga.h>
     54
     55#include "images.h"
     56
     57#define NAME  "vlaunch"
     58
     59#define LOGO_WIDTH   64
     60#define LOGO_HEIGHT  60
    5061
    5162static char *winreg = NULL;
     
    97108        }
    98109       
     110        surface_t *logo = decode_tga((void *) helenos_tga, helenos_tga_size, 0);
     111        if (!logo) {
     112                printf("Unable to decode logo.\n");
     113                return 1;
     114        }
     115       
    99116        winreg = argv[1];
    100117        window_t *main_window = window_open(argv[1], true, true, "vlaunch", 0, 0);
     
    110127        pixel_t lbl_fg = PIXEL(255, 0, 0, 0);
    111128       
     129        canvas_t *logo_canvas = create_canvas(NULL, LOGO_WIDTH, LOGO_HEIGHT,
     130            logo);
    112131        label_t *lbl_caption = create_label(NULL, "Launch application:", 16,
    113132            lbl_bg, lbl_fg);
     
    118137        button_t *btn_vlaunch = create_button(NULL, "vlaunch", 16, btn_bg,
    119138            btn_fg);
    120         grid_t *grid = create_grid(window_root(main_window), 4, 1, grd_bg);
     139        grid_t *grid = create_grid(window_root(main_window), 5, 1, grd_bg);
    121140       
    122         if ((!lbl_caption) || (!btn_vterm) || (!btn_vdemo) ||
    123             (!btn_vlaunch) || (!grid)) {
     141        if ((!logo_canvas) || (!lbl_caption) || (!btn_vterm) ||
     142            (!btn_vdemo) || (!btn_vlaunch) || (!grid)) {
    124143                window_close(main_window);
    125144                printf("Cannot create widgets.\n");
     
    131150        sig_connect(&btn_vlaunch->clicked, NULL, on_vlaunch);
    132151       
    133         grid->add(grid, &lbl_caption->widget, 0, 0, 1, 1);
    134         grid->add(grid, &btn_vterm->widget, 1, 0, 1, 1);
    135         grid->add(grid, &btn_vdemo->widget, 2, 0, 1, 1);
    136         grid->add(grid, &btn_vlaunch->widget, 3, 0, 1, 1);
     152        grid->add(grid, &logo_canvas->widget, 0, 0, 1, 1);
     153        grid->add(grid, &lbl_caption->widget, 1, 0, 1, 1);
     154        grid->add(grid, &btn_vterm->widget, 2, 0, 1, 1);
     155        grid->add(grid, &btn_vdemo->widget, 3, 0, 1, 1);
     156        grid->add(grid, &btn_vlaunch->widget, 4, 0, 1, 1);
    137157       
    138         window_resize(main_window, 180, 130);
     158        window_resize(main_window, 180, 280 + LOGO_HEIGHT);
    139159        window_exec(main_window);
     160       
    140161        task_retval(0);
    141162        async_manager();
  • uspace/lib/gui/Makefile

    re31ea20d rb8f1a349  
    3535SOURCES = \
    3636        button.c \
     37        canvas.c \
    3738        connection.c \
    3839        grid.c \
  • uspace/srv/hid/compositor/Makefile

    re31ea20d rb8f1a349  
    3838
    3939IMAGES = \
    40         gfx/helenos.tga \
    4140        gfx/nameic.tga
    4241
  • uspace/srv/hid/compositor/compositor.c

    re31ea20d rb8f1a349  
    19621962                }
    19631963                list_prepend(&blue_win->link, &window_list);
    1964 
    1965                 window_t *helenos_win = window_create(0, 0);
    1966                 helenos_win->surface = decode_tga((void *) helenos_tga, helenos_tga_size, 0);
    1967                 list_prepend(&helenos_win->link, &window_list);
    1968 
     1964               
    19691965                window_t *nameic_win = window_create(0, 0);
    19701966                nameic_win->surface = decode_tga((void *) nameic_tga, nameic_tga_size, 0);
Note: See TracChangeset for help on using the changeset viewer.