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

Changeset 1455ea1 in mainline


Ignore:
Timestamp:
2021-10-24T22:14:11Z (3 months ago)
Author:
Jiri Svoboda <jiri@…>
Parents:
5e221a77
Message:

Simple way to prevent file names from overflowing the panel

File:
1 edited

Legend:

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

    r5e221a77 r1455ea1  
    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.