Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 294fc3cc in mainline


Ignore:
Timestamp:
2021-09-25T18:47:29Z (4 weeks ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
45b7d4d
Parents:
c1c7c20
Message:

Make editor window non-decorated and full-screen

Need to enhance ui_window_create() to support full-screen placement
in the console.

Location:
uspace
Files:
2 edited

Legend:

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

    rc1c7c20 r294fc3cc  
    156156static pane_t pane;
    157157
    158 static sysarg_t scr_rows;
    159 static sysarg_t scr_columns;
    160 
    161158#define ROW_BUF_SIZE 4096
    162159#define BUF_SIZE 64
     
    269266        (void) pane_row_display;
    270267
    271 //      console_get_size(con, &scr_columns, &scr_rows);
    272         scr_columns = 80;
    273         scr_rows = 25;
    274 
    275         pane.rows = scr_rows - 1;
    276         pane.columns = scr_columns;
    277268        pane.sh_row = 1;
    278269        pane.sh_column = 1;
     
    310301        /* Move to beginning of file. */
    311302        pt_get_sof(&sof);
    312         caret_move(sof, true, true);
    313303
    314304        /* Create UI */
     
    316306        if (rc != EOK)
    317307                return 1;
     308
     309        caret_move(sof, true, true);
    318310
    319311        /* Initial display */
     
    363355        ui_wnd_params_init(&params);
    364356        params.caption = "Text Editor";
    365         params.rect.p0.x = 0;
    366         params.rect.p0.y = 0;
    367         params.rect.p1.x = 80;
    368         params.rect.p1.y = 25;
     357        params.style &= ~ui_wds_decorated;
     358        params.placement = ui_wnd_place_full_screen;
    369359
    370360        rc = ui_window_create(edit->ui, &params, &edit->window);
     
    12911281                /* If it already fits, we're done */
    12921282                n = str_width(text);
    1293                 if (n <= scr_columns - 2)
     1283                if ((int)n <= pane->columns - 2)
    12941284                        break;
    12951285
    12961286                /* Compute number of excess characters */
    1297                 nextra = n - (scr_columns - 2);
     1287                nextra = n - (pane->columns - 2);
    12981288                /** With of the file name part */
    12991289                fnw = str_width(fname);
  • uspace/lib/ui/src/window.c

    rc1c7c20 r294fc3cc  
    256256        } else if (ui->console != NULL) {
    257257                gc = console_gc_get_ctx(ui->cgc);
     258
     259                if (params->placement == ui_wnd_place_full_screen) {
     260                        /* Make window the size of the screen */
     261                        gfx_rect_dims(&ui->rect, &scr_dims);
     262                        gfx_coord2_add(&dparams.rect.p0, &scr_dims,
     263                            &dparams.rect.p1);
     264                }
    258265        } else {
    259266                /* Needed for unit tests */
     
    275282
    276283        /* Move rectangle so that top-left corner is 0,0 */
    277         gfx_rect_rtranslate(&params->rect.p0, &params->rect, &bparams.rect);
     284        gfx_rect_rtranslate(&dparams.rect.p0, &dparams.rect, &bparams.rect);
    278285
    279286        rc = gfx_bitmap_create(gc, &bparams, NULL, &bmp);
Note: See TracChangeset for help on using the changeset viewer.