Changeset 192565b in mainline for uspace/app/vlaunch/vlaunch.c


Ignore:
Timestamp:
2013-05-27T13:18:13Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f2c19b0
Parents:
d120133 (diff), c90aed4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    rd120133 r192565b  
    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   196
     60#define LOGO_HEIGHT  66
    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);
     
    104121        }
    105122       
    106         pixel_t grd_bg = PIXEL(255, 240, 240, 240);
     123        pixel_t grd_bg = PIXEL(255, 255, 255, 255);
    107124        pixel_t btn_bg = PIXEL(255, 0, 0, 0);
    108125        pixel_t btn_fg = PIXEL(255, 240, 240, 240);
    109         pixel_t lbl_bg = PIXEL(255, 240, 240, 240);
     126        pixel_t lbl_bg = PIXEL(255, 255, 255, 255);
    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), 1, 5, 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, 0, 1, 1, 1);
     154        grid->add(grid, &btn_vterm->widget, 0, 2, 1, 1);
     155        grid->add(grid, &btn_vdemo->widget, 0, 3, 1, 1);
     156        grid->add(grid, &btn_vlaunch->widget, 0, 4, 1, 1);
    137157       
    138         window_resize(main_window, 180, 130);
     158        window_resize(main_window, 210, 130 + LOGO_HEIGHT);
    139159        window_exec(main_window);
     160       
    140161        task_retval(0);
    141162        async_manager();
Note: See TracChangeset for help on using the changeset viewer.