Changeset 9c7dc8e in mainline for uspace/lib/ui/src/entry.c


Ignore:
Timestamp:
2021-03-01T10:50:25Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cd74fa8
Parents:
77ffa01
git-author:
Jiri Svoboda <jiri@…> (2021-02-28 10:50:05)
git-committer:
Jiri Svoboda <jiri@…> (2021-03-01 10:50:25)
Message:

Print text as text in textmode UI. Make calculator smaller in text mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/entry.c

    r77ffa01 r9c7dc8e  
    4646#include <ui/paint.h>
    4747#include <ui/entry.h>
     48#include <ui/ui.h>
    4849#include "../private/entry.h"
    4950#include "../private/resource.h"
     
    5556enum {
    5657        ui_entry_hpad = 4,
    57         ui_entry_vpad = 4
     58        ui_entry_vpad = 4,
     59        ui_entry_hpad_text = 1,
     60        ui_entry_vpad_text = 0
    5861};
    5962
     
    173176        gfx_text_fmt_t fmt;
    174177        gfx_coord2_t pos;
     178        gfx_coord_t hpad;
     179        gfx_coord_t vpad;
    175180        gfx_rect_t inside;
    176181        errno_t rc;
     182
     183        if (entry->res->textmode) {
     184                hpad = ui_entry_hpad_text;
     185                vpad = ui_entry_vpad_text;
     186        } else {
     187                hpad = ui_entry_hpad;
     188                vpad = ui_entry_vpad;
     189        }
    177190
    178191        /* Paint inset frame */
     
    195208        case gfx_halign_left:
    196209        case gfx_halign_justify:
    197                 pos.x = inside.p0.x + ui_entry_hpad;
     210                pos.x = inside.p0.x + hpad;
    198211                break;
    199212        case gfx_halign_center:
     
    201214                break;
    202215        case gfx_halign_right:
    203                 pos.x = inside.p1.x - ui_entry_hpad;
     216                pos.x = inside.p1.x - hpad;
    204217                break;
    205218        }
    206219
    207         pos.y = inside.p0.y + ui_entry_vpad;
     220        pos.y = inside.p0.y + vpad;
    208221
    209222        gfx_text_fmt_init(&fmt);
Note: See TracChangeset for help on using the changeset viewer.