-
Notifications
You must be signed in to change notification settings - Fork 0
List enhancements #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
60cbc96
Improve sorting and display names.
nchapman 5f18c47
Delay thumb load and fix memory issues in lists.
nchapman 2265d02
Threaded thumbnail generation.
nchapman c3f84e8
Optimize thumbnail generation.
nchapman 329c2ea
Add fade-in to thumbs.
nchapman 3d50a51
Wider selected items with thumbs.
nchapman 84f2305
New and improved nointro name parser.
nchapman b0a3012
Full width selected items with thumbs.
nchapman 6d6a3e8
Improve quality of list rendering code with better config.
nchapman 301966a
Remove fixed-point bilinear scaling optimization.
nchapman 40fb374
Review fixes.
nchapman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,167 @@ | ||
| # List Views | ||
|
|
||
| This document describes the list view system in minui (the launcher). | ||
|
|
||
| ## Overview | ||
|
|
||
| List views are the primary UI element in minui, used for ROM browsing, tools, recents, and collections. | ||
|
|
||
| **Implementation:** `workspace/all/minui/minui.c` | ||
|
|
||
| ## Current Features | ||
|
|
||
| ### Sorting | ||
|
|
||
| ROM lists are sorted using natural sort with No-Intro conventions: | ||
|
|
||
| | Feature | Description | | ||
| |---------|-------------| | ||
| | Natural sort | Numbers compared by value: "Game 2" < "Game 10" | | ||
| | Article skipping | "The Legend of Zelda" sorts under "L", not "T" | | ||
| | Case insensitive | "mario" and "Mario" sort together | | ||
|
|
||
| Supported articles for sort skipping: "The ", "A ", "An " (must have trailing space) | ||
|
|
||
| ### Navigation | ||
|
|
||
| | Feature | Description | | ||
| |---------|-------------| | ||
| | Single item scroll | D-pad up/down moves one item at a time | | ||
| | Page jump | D-pad left/right jumps by visible row count | | ||
| | Alphabetic jump | L1/R1 jumps to next/previous letter group (A-Z, #) | | ||
| | Wrap-around | Scrolling past bottom wraps to top and vice versa | | ||
| | Button repeat | 300ms initial delay, then 100ms repeat interval | | ||
|
|
||
| ### Selection & Highlighting | ||
|
|
||
| | Feature | Description | | ||
| |---------|-------------| | ||
| | Selection pill | White rounded rectangle behind selected item | | ||
| | Text color flip | Selected text changes from white to black | | ||
|
|
||
| ### Text Display | ||
|
|
||
| | Feature | Description | | ||
| |---------|-------------| | ||
| | Text truncation | Names exceeding available width get ellipsis (...) | | ||
| | Display name cleaning | Strips file extensions, region codes, parenthetical metadata | | ||
| | Article fixing | "Legend of Zelda, The" displays as "The Legend of Zelda" | | ||
| | Sorting prefix removal | Strips "NNN) " prefixes used for custom sort order | | ||
| | Duplicate disambiguation | Shows filename or emulator name when display names collide | | ||
|
|
||
| ### Display Name Aliasing (map.txt) | ||
|
|
||
| Custom display names can be defined via `map.txt` files using tab-delimited format: | ||
|
|
||
| ``` | ||
| mario.gb Super Mario Land | ||
| tetris.gb Tetris DX | ||
| unwanted.gb .hidden | ||
| ``` | ||
|
|
||
| | Location | Purpose | | ||
| |----------|---------| | ||
| | `/Roms/GB/map.txt` | Aliases for ROMs in that system folder | | ||
| | `/Roms/map.txt` | Aliases for system folder names at root | | ||
| | `/Collections/map.txt` | Aliases for collection entries | | ||
|
|
||
| **Special behaviors:** | ||
| - Alias starting with `.` hides the entry from the list | ||
| - List re-sorts alphabetically after aliases are applied | ||
| - Aliases are also used by minarch for in-game title display | ||
|
|
||
| ### Thumbnails | ||
|
|
||
| | Feature | Description | | ||
| |---------|-------------| | ||
| | Thumbnail display | Shows image on right side when ROM is selected | | ||
| | Path convention | ROM at `/Roms/GB/game.gb` → thumbnail at `/Roms/GB/.res/game.gb.png` | | ||
| | Scaling | Preserves aspect ratio, max 50% screen width | | ||
| | Caching | Thumbnail cached to avoid reloading on every frame | | ||
|
|
||
| ### List Types | ||
|
|
||
| | List | Description | | ||
| |------|-------------| | ||
| | ROM list | Files within a system folder | | ||
| | Root directory | System folders, Tools, Recently Played, Collections | | ||
| | Recently Played | Last 24 games launched (stored in `.minui/recent.txt`) | | ||
| | Collections | Custom ROM lists defined by `.txt` files | | ||
| | Multi-disc | Disc selection for games with `.m3u` playlists | | ||
|
|
||
| ### Hardware Status | ||
|
|
||
| | Feature | Description | | ||
| |---------|-------------| | ||
| | Battery indicator | Shows current charge level (top-right) | | ||
| | Brightness indicator | Shows when adjusting brightness | | ||
| | Volume indicator | Shows when adjusting volume | | ||
|
|
||
| ### Button Hints | ||
|
|
||
| Context-sensitive button labels displayed at bottom of screen: | ||
| - OPEN / SELECT - A button action | ||
| - BACK - B button action | ||
| - RESUME - X button when save state exists | ||
| - Action-specific labels per menu context | ||
|
|
||
| ### Visual Styling | ||
|
|
||
| | Property | Value | | ||
| |----------|-------| | ||
| | Indentation | Tabs (4-wide) | | ||
| | Font sizes | Large (16pt), Medium (14pt), Small (12pt), Tiny (10pt) | | ||
| | Colors | White text on dark background, black text when selected | | ||
| | Spacing | DP-scaled padding and margins for cross-device consistency | | ||
| | Row height | Dynamically calculated based on screen PPI | | ||
|
|
||
| ## Implementation Details | ||
|
|
||
| ### Scrolling Window | ||
|
|
||
| Lists maintain a visible window with `start` and `end` indices: | ||
|
|
||
| ```c | ||
| // When selection moves below visible area | ||
| if (selected >= end) { | ||
| start++; | ||
| end++; | ||
| } | ||
|
|
||
| // When selection moves above visible area | ||
| if (selected < start) { | ||
| start--; | ||
| end--; | ||
| } | ||
| ``` | ||
|
|
||
| ### Alphabetic Index | ||
|
|
||
| Each directory builds an index array mapping letters (A-Z, #) to entry positions: | ||
|
|
||
| ```c | ||
| // getIndexChar() returns 0 for non-alpha, 1-26 for A-Z | ||
| int alpha = getIndexChar(entry->name); | ||
| if (alphas[alpha] == -1) { | ||
| alphas[alpha] = entry_index; // First entry for this letter | ||
| } | ||
| ``` | ||
|
|
||
| L1/R1 navigation uses this index to jump between letter groups. | ||
|
|
||
| ### Display Name Processing | ||
|
|
||
| Names go through several transformations: | ||
|
|
||
| 1. `getDisplayName()` - Strips extensions, region codes, parentheticals, fixes articles | ||
| 2. `trimSortingMeta()` - Removes "NNN) " prefixes | ||
| 3. `map.txt` lookup - Applies custom aliases | ||
| 4. `getUniqueName()` - Generates disambiguator for duplicates | ||
|
|
||
| ### Sorting Algorithm | ||
|
|
||
| Sorting uses `strnatcasecmp()` which provides: | ||
|
|
||
| 1. Natural number ordering ("Game 2" < "Game 10") | ||
| 2. Article skipping for sort ("The Zelda" sorts under "Z") | ||
| 3. Case-insensitive comparison |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.