Commit Graph

145 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
tomasklaen
9c544bf565 fix: removed add-intl-directory API
It doesn't make sense for uosc to be the internationalization provider for other scripts.
2023-05-15 09:51:16 +02:00
tomasklaen
e23eea6e43 feat: add-intl-directory APi for scripts to extend localization 2023-04-25 10:51:39 +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
christoph-heinrich
30d6e12001 feat: add on_close command to menu API (#449) 2023-02-07 08:45:04 +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
b9cc1ccc3c feat: ctrl+enter in file menus will load selected directory
closes #378
2023-01-30 14:05:26 +01:00
tomasklaen
54bb9d6a77 feat: split media_types option into video_types, audio_types, and image_types 2023-01-30 11:44:15 +01:00
tomasklaen
9ebc600d37 feat: added show-submenu-blurred message listener
closes #441
2023-01-30 10:14:39 +01:00
tomasklaen
8183163f2a feat: added options to display alternative top bar title
Added option `top_bar_alt_title`, which accepts an alternative title template to be displayed, and `top_bar_alt_title_place` that controls where it should be displayed. It can be either `below` to place it below the main one, or `toggle` to show it in place of the main title when user clicks the top bar or calls the `toggle-title` binding.

The `top_bar_title` now also accepts a custom top bar title template if user wants it to be different from the one defined in `mpv.conf`.

closes #402
2023-01-18 12:06:10 +01:00
Tomas Klaen
c5ccd1b4ef feat: added an API to overwrite uosc key bindings (#430)
This allows 3rd party scripts to replace the handling of built in uosc key bindings with their own logic.

Example that replaces uosc's basic stream quality menu with christoph-heinrich/mpv-quality-menu:

```lua
mp.commandv('script-message-to', 'uosc', 'overwrite-binding', 'stream-quality', 'script-binding quality_menu/video_formats_toggle')
```
2023-01-18 09:48:31 +01:00
Till
ed58830ca7 docs: minor additions and cleanup (#428) 2023-01-14 11:34:56 +01: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
tomasklaen
d4697134a1 docs: use no-osd in keybind examples 2022-10-26 10:03:31 +02:00
tomasklaen
5995bfb7ae feat: implement set-min-visibility message listener
closes #317
2022-10-11 17:55:35 +02:00
Tomas Klaen
97bf03bc77 chore: update previews 2022-10-11 13:00:14 +02:00
tomasklaen
ef1753e27e feat: update default menu items 2022-10-11 12:12:51 +02:00
tomasklaen
30a3ec195d feat: move @ in control badge props from prefix to suffix for consistency
The old `@prop` syntax will still work, but consider it deprecated.
2022-10-10 10:20:46 +02:00
tomasklaen
75ab13f2e3 feat: make toggle and cycle controls work with external properties
ref #310
2022-10-10 09:56:16 +02:00
tomasklaen
6ebc257fe4 docs: adjust outdated navigation looping instructions 2022-10-05 09:03:53 +02:00
Tomas Klaen
a3bbc0d7a0 chore: update readme 2022-10-03 17:06:40 +02:00
tomasklaen
e8b8a69c25 feat: implement flash-ui binding and flash-elements message 2022-10-03 17:01:04 +02:00
tomasklaen
78c09e51da feat!: implement toggle-elements <elements> message
Allows toggling one or multiple elements at the same time. Example:

```
script-message-to uosc toggle-elements timeline,speed
```

BREAKING: Removes `toggle-timeline`, `toggle-volume`, and `toggle-top-bar` script bindings.
2022-10-01 10:35:04 +02:00
tomasklaen
08e0aed8b2 feat: implement external properties API
closes #278
2022-09-30 11:31:47 +02:00
tomasklaen
0ad72e5f85 refactor: simplified create_self_updating_menu_opener interface 2022-09-30 11:02:09 +02:00
dyphire
b194618e98 feat: add editions menu,editions control and has_many_editon disposition (#277) 2022-09-30 10:22:36 +02:00
tomasklaen
4fbc437382 release: 4.0.1 2022-09-24 17:23:31 +02:00
tomasklaen
5e2192acbd chore: update readme 2022-09-24 09:49:33 +02:00
tomasklaen
e47e7e59bb chore: bump version 2022-09-24 09:41:34 +02:00
Tomas Klaen
d967110dbc Update README.md 2022-09-24 01:19:46 +02:00
tomasklaen
de41a10c07 feat: implemented menu-blurred command
Opens a menu without preselecting any item. Suitable when opening menu with a mouse input.

closes #248
2022-09-23 12:28:05 +02:00
tomasklaen
273374f4bd feat!: changed peek-{x} commands to toggle-{x}
Previously, all of the `peek-{element}` commands such as `peek-ui` would force the elements' visibility only until pressed again, OR MOUSE MOVED. This was sometimes annoying (small mouse movements would reset it), and limiting, for no really good reason.

With this, the commands are renamed to `toggle-{x}`, and toggle each element's permanent `min_visibility` between `0` and `1`.

ref #48
2022-09-19 16:25:32 +02:00
tomasklaen
d99194d297 feat: added peek-ui, peek-volume, and peek-top-bar commands
ref #48
2022-09-14 15:05:45 +02:00
tomasklaen
193f0706af refactor!: active and selected_index menu API
Allows multiple items in a menu to be `active`. `select` flag is no longer on the item, but moved to the menu properties as `selected_index`.
2022-09-13 10:22:36 +02:00
tomasklaen
d82863e718 chore: fix broken changelog link in the readme 2022-09-13 09:10:01 +02:00
tomasklaen
d8ffaf60b4 docs: update update-menu example 2022-09-13 00:24:40 +02:00
tomasklaen
e5f248e9ea docs: outdated example snippet 2022-09-13 00:21:24 +02:00
tomasklaen
aeac6523d6 feat: add update-menu API
closes #171
2022-09-13 00:11:30 +02:00
tomasklaen
9b64c529ac refactor!: element system, menu implementation, ...
With this, the codebase is mostly typed (as much as sumneko's type checking allows), and finally go-to-definition-able.

This refactor changed or touched more than 90% of the codebase, so here's just the most notable changes I can recall:

Menu implementation is now way more robust, and supports:
- live menu updates
- opening submenus allows navigating to parent menus
- items icons and bold & italic styling
- keeping menu open after selecting the item
- peeking submenus
- and a lot of other small tweaks

The menu input data structure changed. It no longer accepts `active_index` and `selected_index`, instead, each item can now have `active` or `selected` property.

And I'm sure there's a lot I'm forgetting to mention, but it's midnight here T.T

closes #144, ref #171, closes #176
2022-09-12 23:53:37 +02:00
tomasklaen
a501ded419 feat: improve track selection menus
Adds `load-audio`, `load-video` menus, adds load file item to all track selection menus, makes disabled subtitle item a bit more prominent and styled appropriately.

Notable addition: new `muted` property for menu items which makes the title half the opacity.

closes #169, closes #170
2022-09-07 11:45:12 +02:00
tomasklaen
0109e5ce8e feat: improve menu styling
Fixes couple things, makes menu prettier with borders, and adds `bold` and `italic` props to each menu item.
2022-09-07 10:25:05 +02:00
tomasklaen
fa1b2112ec feat: implement controls bar
Also includes a lot of refactoring around codebase to make it work as needed.

Notable addition: new `items` command that displays playlist if any, or open-file otherwise.

ref #167, closes #71
2022-09-06 20:02:35 +02:00
tomasklaen
a6aa1c9351 docs: move performance tip to installation instructions 2022-09-02 08:58:03 +02:00
hooke007
4b42ba9d58 docs: simplify the feasible workaround for smooth (#164) 2022-09-01 20:21:16 +02:00
tomasklaen
b7ef9b1c0e chore: update development links 2022-08-30 16:27:03 +02:00
hooke007
146e605152 feat: add audio-device command (#140)
Co-authored-by: christoph-heinrich <christoph-heinrich@users.noreply.github.com>
2022-08-30 08:42:35 +02:00
tomasklaen
7608bb96e3 feat: improve show-menu api
Added `type`, `active_index`, `selected_index` props, menu toggling, and fixed table command values being passed to `mp.command()` instead of `mp.commandv()`.

closes #142, closes #143
2022-08-29 16:24:57 +02:00
tomasklaen
21e3e159a4 feat: add get-version message handler
closes #138
2022-08-28 12:56:18 +02:00
tomasklaen
56a3157f99 feat: add show-menu message handler 2022-08-28 12:39:12 +02:00
tomasklaen
016d80e477 feat: provide default context menu 2022-08-24 13:12:37 +02:00