Changeset fdf55a3 in mainline for uspace/lib/ui/src/filelist.c


Ignore:
Timestamp:
2022-06-02T19:13:12Z (23 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
453f9645
Parents:
03fc3a9
Message:

Do not select/open last entry if user clicks below

This behavior, meticulously copied from NC, is not really meaningful,
especially considering other circumstances. We also did it for double
click / open, which is very confusing.

File:
1 edited

Legend:

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

    r03fc3a9 rfdf55a3  
    934934/** Find the n-th entry of the current file list page.
    935935 *
    936  * If the page is short and has less than n+1 entries, return the last entry.
    937  *
    938936 * @param flist File list
    939937 * @param n Which entry to get (starting from 0)
     
    945943{
    946944        ui_file_list_entry_t *entry;
    947         ui_file_list_entry_t *next;
    948945        size_t i;
    949946        size_t idx;
     
    957954        idx = flist->page_idx;
    958955        for (i = 0; i < n; i++) {
    959                 next = ui_file_list_next(entry);
    960                 if (next == NULL)
    961                         break;
    962 
    963                 entry = next;
     956                entry = ui_file_list_next(entry);
     957                if (entry == NULL)
     958                        return NULL;
     959
    964960                ++idx;
    965961        }
Note: See TracChangeset for help on using the changeset viewer.