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

Changeset d0fd86a in mainline


Ignore:
Timestamp:
2021-10-25T00:32:45Z (5 weeks ago)
Author:
jxsvoboda <5887334+jxsvoboda@…>
Branches:
master
Children:
805a149
Parents:
9ee55cd
git-author:
Jiri Svoboda <jiri@…> (2021-10-24 22:14:11)
git-committer:
jxsvoboda <5887334+jxsvoboda@…> (2021-10-25 00:32:45)
Message:

Simple way to prevent file names from overflowing the panel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/nav/panel.c

    r9ee55cd rd0fd86a  
    207207                return rc;
    208208
     209        /*
     210         * Make sure name does not overflow the entry rectangle.
     211         *
     212         * XXX We probably want to measure the text width, and,
     213         * if it's too long, use gfx_text_find_pos() to find where
     214         * it should be cut off (and append some sort of overflow
     215         * marker.
     216         */
     217        rc = gfx_set_clip_rect(gc, &rect);
     218        if (rc != EOK)
     219                return rc;
     220
    209221        rc = gfx_puttext(font, &pos, &fmt, entry->name);
    210         if (rc != EOK)
    211                 return rc;
    212 
    213         return EOK;
     222        if (rc != EOK) {
     223                (void) gfx_set_clip_rect(gc, NULL);
     224                return rc;
     225        }
     226
     227        return gfx_set_clip_rect(gc, NULL);
    214228}
    215229
Note: See TracChangeset for help on using the changeset viewer.