Changeset 62fbb7e in mainline for uspace/app


Ignore:
Timestamp:
2014-01-16T20:43:22Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6a3d0c7
Parents:
ba02baa
Message:

refactor window placement logic and introduce logical window placement flags

  • The original setup of window position during creation (window_open()) was quite useless, because the window had no surface yet.
  • Now the window position can be optinally set using window_resize() and various logical placement flags are available.
  • A separate window_move() routine could be introduced eventually if needed, but for the initial setup of the window the combination of window position and size works fine.
Location:
uspace/app
Files:
4 edited

Legend:

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

    rba02baa r62fbb7e  
    110110{
    111111        if (argc >= 2) {
    112                 window_t *main_window = window_open(argv[1], true, true, "vdemo", 0, 0);
     112                window_t *main_window = window_open(argv[1], true, true, "vdemo");
    113113                if (!main_window) {
    114114                        printf("Cannot open main window.\n");
     
    150150                grid->add(grid, &btn_confirm->widget, 0, 1, 1, 1);
    151151                grid->add(grid, &btn_cancel->widget, 1, 1, 1, 1);
    152                 window_resize(main_window, 200, 76);
     152                window_resize(main_window, 0, 0, 200, 76,
     153                    WINDOW_PLACEMENT_CENTER);
    153154
    154155                window_exec(main_window);
  • uspace/app/viewer/viewer.c

    rba02baa r62fbb7e  
    166166        }
    167167       
    168         main_window = window_open(argv[1], true, false, "viewer", 0, 0);
     168        main_window = window_open(argv[1], true, false, "viewer");
    169169        if (!main_window) {
    170170                printf("Cannot open main window.\n");
     
    192192        }
    193193       
    194         window_resize(main_window, WINDOW_WIDTH, WINDOW_HEIGHT);
     194        window_resize(main_window, 0, 0, WINDOW_WIDTH, WINDOW_HEIGHT,
     195            WINDOW_PLACEMENT_ABSOLUTE);
    195196        window_exec(main_window);
    196197       
  • uspace/app/vlaunch/vlaunch.c

    rba02baa r62fbb7e  
    115115       
    116116        winreg = argv[1];
    117         window_t *main_window = window_open(argv[1], true, true, "vlaunch", 0, 0);
     117        window_t *main_window = window_open(argv[1], true, true, "vlaunch");
    118118        if (!main_window) {
    119119                printf("Cannot open main window.\n");
     
    159159        grid->add(grid, &btn_vlaunch->widget, 0, 4, 1, 1);
    160160       
    161         window_resize(main_window, 210, 130 + LOGO_HEIGHT);
     161        window_resize(main_window, 0, 0, 210, 130 + LOGO_HEIGHT,
     162            WINDOW_PLACEMENT_RIGHT | WINDOW_PLACEMENT_TOP);
    162163        window_exec(main_window);
    163164       
  • uspace/app/vterm/vterm.c

    rba02baa r62fbb7e  
    4949        }
    5050       
    51         window_t *main_window = window_open(argv[1], true, true, "vterm", 0, 0);
     51        window_t *main_window = window_open(argv[1], true, true, "vterm");
    5252        if (!main_window) {
    5353                printf("%s: Cannot open main window.\n", NAME);
     
    5555        }
    5656       
    57         window_resize(main_window, 648, 510);
     57        window_resize(main_window, 0, 0, 648, 510, WINDOW_PLACEMENT_ANY);
    5858        terminal_t *terminal_widget =
    5959            create_terminal(window_root(main_window), 640, 480);
Note: See TracChangeset for help on using the changeset viewer.