Commit Graph

21 Commits

Author SHA1 Message Date
tomasklaen
128c76c3ba feat: menu items now accept selectable and align options
Allows creating placeholder items like "Empty" that can't be selected or clicked.
2023-05-15 11:22:53 +02:00
christoph-heinrich
5e2c930551 feat: scroll to new position after moving item in menu (#552) 2023-05-05 08:50:17 +02:00
natural-harmonia-gropius
9960906abb fix: show empty placeholder for empty menus (#546) 2023-05-03 10:46:21 +02:00
tomasklaen
618e4728f4 fix: remove redundant menu title translation 2023-04-27 08:48:42 +02:00
Eva
398947d931 perf: cache menu title translation (#524) 2023-04-25 09:35:32 +02:00
natural-harmonia-gropius
3c70ffd927 feat: internationalization (#518)
Adds `languages` option to specify localization language priority.
Built in languages can be found in `scripts/uosc_shared/intl`.
2023-04-24 11:37:58 +02:00
tomasklaen
808fa59418 fix: autohide un-registering cursor events when menu is open
closes #495
2023-04-03 21:53:30 +02:00
tomasklaen
21b37ce33b fix: submenus vertically misaligned when opened via show-submenu message
closes #459
2023-03-29 17:08:53 +02:00
christoph-heinrich
4dd9bf8a71 tweak: add padding to title (#484)
Long titles with short items would lead to the title touching the edge
of the menu, which doesn't look good. Adding padding like is already
with the items remedies this.
2023-03-29 09:13:35 +02:00
Tomas Klaen
f635df18f7 refactor: cursor events consolidated into one interface (#483)
`mbtn_left` and `wheel` events are now only fired on a `cursor.on_{event}` object, which resets at the beginning of each frame, so elements need to bind these listeners in their render functions. These properties are overwritable which allows elements to take over cursor event handling from their parents if necessary.
2023-03-29 09:08:18 +02:00
tomasklaen
f039af5732 feat: added menu keybinds to move and delete items in playlists
`ctrl+up/down` moves a selected item up/down, and `del` deletes it.
2023-02-20 16:12:22 +01:00
tomasklaen
e3c06eb814 feat: made ctrl+click in file menus behave just like ctrl+enter does
ref #378
2023-01-30 22:18:16 +01:00
tomasklaen
3b68314fcf fix: click to the left of file menus navigating up instead of closing the menu 2023-01-30 15:22:36 +01:00
tomasklaen
b9cc1ccc3c feat: ctrl+enter in file menus will load selected directory
closes #378
2023-01-30 14:05:26 +01:00
tomasklaen
188a579ebf fix: menus not toggling off after being updated
closes #400
2023-01-30 11:09:44 +01:00
tomasklaen
682fd81a85 feat: **back** in file menus now navigates up the directory tree
closes #367
2022-11-14 09:22:32 +01:00
tomasklaen
5f5bf4b842 fix: file menu not updating active item and other menu issues
- Preselecting previous folder wasn't working sometimes.
- `join_path()` didn't account for drive letters already having a separator.

Also refactors how `open_file_navigation_menu()` stores menu items value. As a side effect this is now a lot faster as we don't have to serialize each item's path into meta table, but instead we now store just a path string and handle it as needed.

closes #355
2022-10-31 11:10:25 +01:00
tomasklaen
972dd41b94 fix: menu prev/next navigation shouldn't smooth scroll
closes #352
2022-10-29 19:30:34 +02:00
tomasklaen
d8fad3306a feat: implement special spinner icon for menus
Allows menus to use `spinner` as an item icon, which will display a rotating spinner. Along with a no-op command on an item and `keep_open=true`, this can be used to display placeholder menus/items that are still loading.

Extracts spinner from `BufferingIndicator` into `ass:spinner()` utility.
2022-10-28 22:22:21 +02:00
christoph-heinrich
00d249a351 fix: selection on mbtn_up requires mbtn_down first (#348)
Without checking if mbtn_down happened first in the menu, it is possible
to select an item right after opening the menu from the controls.
(mbtn_down on control opens menu, mbtn_up selects item in menu)
2022-10-28 09:46:21 +02:00
tomasklaen
4399904bba refactor: change directory structure to support mpv 0.32 and lower 2022-10-27 12:09:59 +02:00