925 Commits

Author SHA1 Message Date
tomasklaen
b6736815ac refactor: use comma_split where appropriate 2023-10-14 11:20:31 +02:00
tomasklaen
aeaf562b44 feat: added idle indicator, and an ability to control indicator opacities 2023-10-14 11:10:39 +02:00
Tomas Klaen
3af5ccff9f feat: added disable_elements option and disable-elements script message (#695)
* feat: added `disable_elements` option and `disable-elements` script message

Allows disabling elements and various indicators by adding their IDs to the list:

```conf
disable_elements=timeline,audio_indicator
```

Also includes a new script message listener `disable-elements`, that does the same thing:

```lua
local id = mp.get_script_name()
mp.commandv('script-message-to', 'uosc', 'disable-elements', id, 'timeline,audio_indicator')
```

It'll register what elements each script wants disabled. The element will be enabled only when it is not disabled by neither user nor any script.

To cancel or re-enable the elements, just pass an empty list:

```lua
mp.commandv('script-message-to', 'uosc', 'disable-elements', id, '')
```

ref #686, closes #592
2023-10-14 10:09:47 +02:00
Tomas Klaen
b7529ea59a feat: scripts to install or update uosc with a single command (#691) 2023-10-12 18:00:06 +02:00
christoph-heinrich
7467e182d3 refactor: use math.huge (#692) 2023-10-11 20:47:38 +02:00
tomasklaen
3c5d814307 fix: element fadeout bugs when cursor leaves/re-enters window
- Controls weren't fading out.
- Some elements needed to fully fade out until they started reacting to proximity on re-enter.

closes #688
2023-10-11 18:03:52 +02:00
tomasklaen
a883ae9b41 feat: changed animation_factor option to animation_duration
Having the option be in milliseconds is more intuitive.

closes #689
2023-10-11 17:51:42 +02:00
tomasklaen
6138c2075d revert: home/end in menus are animated again 2023-10-11 09:28:41 +02:00
christoph-heinrich
4949930e01 fix: updated german translation (#684) 2023-10-09 13:41:18 +02:00
Tomas Klaen
6a91ad9339 feat: support for creating menu titles and separators in input.conf (#681)
* feat: support for creating menu titles and separators in `input.conf`

When defining menu items in `input.conf`, it is now possible to add an un-selectable+muted+italic menu items by using `#` as key, and omitting the command:

```
#    #! Section > Title
```

You can also add a separator between previous and next item by using `---` as title:

```
#    #! Section > ---
```

closes #69
2023-10-09 11:53:24 +02:00
tomasklaen
27fa983046 feat: added audio indicator for audio files without cover
ref #686
2023-10-09 11:41:07 +02:00
tomasklaen
c5de0823fe fix: elements instantly disappearing instead of fading out on mouse leave
ref #685
2023-10-09 11:09:50 +02:00
tomasklaen
484c553686 refactor: mouse position initialization
ref #687
2023-10-09 10:44:37 +02:00
tomasklaen
61ce3291f7 feat: navigating menu with up/down/home/end keys is now instant with no animation
Left Page Up/Down as the animation is useful there (gives a sense of where the menu has animated from & to), but up/down/home/end just work better when instant.
2023-10-08 14:28:46 +02:00
tomasklaen
1440fde298 feat: added animation_factor option to control animation speed
closes #471
2023-10-08 14:21:55 +02:00
Tomas Klaen
b800aebeff feat!: reworked opacity options (#680)
These options have been removed:

```
timeline_opacity
timeline_chapters_opacity
volume_opacity
speed_opacity
menu_opacity
menu_parent_opacity
top_bar_title_opacity
window_border_opacity
curtain_opacity
```

and replaced with one comma delimited `opacity` list to override all of the above and some new default opacity values.

Example:

```
opacity=timeline=0.5,title=0.5
```

List of opacity values available for override and their current defaults:

```
timeline=.9
position=1     # timeline progress or line
chapters=0.8
slider=0.9     # background of all sliders, such as volume
slider_gauge=1 # value bar of all sliders
speed=0.6
menu=1
submenu=0.4
border=1       # window border
title=1        # window title
tooltip=1      # tooltip background
thumbnail=1    # thumbnail border
curtain=0.5
```

closes #584, closes #636, closes #675
2023-10-08 11:59:56 +02:00
christoph-heinrich
2f46e23a9f feat: improved menu title & hint clipping logic (#668) 2023-10-07 16:24:03 +02:00
tomasklaen
f6837cab74 fix: default items not cached when input.conf was empty
closes #674
2023-10-07 11:32:41 +02:00
christoph-heinrich
149b009477 fix: user-data/uosc/menu/type backwards compatibility, and being nil means closed (#673)
`nil` being a valid menu type in the provided property was a mistake.
For backwards compatiblity we also set shared-script-properties now.
2023-10-07 11:29:17 +02:00
christoph-heinrich
51d45474e2 tweak: remove text shadow in menu (#679) 2023-10-07 11:23:19 +02:00
christoph-heinrich
f25dfc889e fix: volume slider crash when no audio (#678)
d2febcbd47 forgot the second parameter,
resulting in a crash because it's nil.
2023-10-07 10:46:04 +02:00
christoph-heinrich
73dc2ccf00 fix: updating the menu while using the internal search (#677)
Fixes #671
2023-10-07 10:45:07 +02:00
tomasklaen
eacfd6391d fix: search_submenus inheritance, missing docs, and ass_safe_title cache not clearing
ref #677
2023-10-07 00:16:19 +02:00
christoph-heinrich
a94db0c799 fix: window border enable logic for non windows (#676)
`top-bar` is only relevant on windows
2023-10-06 23:31:48 +02:00
tomasklaen
a4ac44a7dc feat: added border_radius option
closes #377
2023-10-06 23:24:20 +02:00
Tomas Klaen
d2febcbd47 feat!: reworked config options for fullscreen scale adjustments (#664)
* feat!: reworked config options for fullscreen scale adjustments

Removed options:

```
timeline_size_fullscreen
controls_size_fullscreen
volume_size_fullscreen
menu_item_height_fullscreen
menu_min_width_fullscreen
top_bar_size_fullscreen
```

Additionally, `ui_scale` has been renamed to `scale`.

The scaling can now be controlled by these two new options:

```
scale=1
scale_fullscreen=1.3
```

closes #543
2023-10-06 23:20:14 +02:00
Tomas Klaen
473278c4bd feat: inputs command to display a palette menu with all active keybindings (#665) 2023-10-06 11:12:38 +02:00
tomasklaen
e7371f61e0 fix: progress line width broken in #661
ref #661
2023-10-04 09:36:22 +02:00
tomasklaen
c324e07ff0 feat: windowed and fullscreen added to available element persistency states
closes #618
2023-10-03 13:32:40 +02:00
Tomas Klaen
7f9a8cae6d feat: reworked timeline progress mode (#661)
* feat: reworked timeline progress mode

Config options:

```
timeline_line_width_fullscreen=3
timeline_line_width_minimized_scale=10
timeline_size_min=2
timeline_size_max=40
timeline_size_min_fullscreen=0
timeline_size_max_fullscreen=60
timeline_start_hidden=no
```

have been replaced with:

```
timeline_size=40
timeline_size_fullscreen=60
progress=windowed
progress_size=2
progress_line_width=20
```

This simplifies stuff a bunch, and enables timeline's progress mode to be togglable at all times. Previously you could only toggle when it was configured to be visible in current context.

closes #630
2023-10-03 11:10:50 +02:00
dyphire
a0c544a4ba fix: add sbv to subtitle types (#663) 2023-10-02 17:54:09 +02:00
christoph-heinrich
2cad0d414e fix: menu title and search not clipped properly in extremely tiny windows (#658) 2023-10-02 17:02:22 +02:00
xfzv
5bf81228db fix: add cue to audio types (#662) 2023-10-02 15:44:11 +02:00
dyphire
3ac22679f5 fix: update simplified chinese translation (#660) 2023-10-02 10:40:42 +02:00
christoph-heinrich
4f519f45e1 feat: update german translation (#659) 2023-10-02 10:39:48 +02:00
Tomas Klaen
aab6d2ef13 fix: menu positioning and sizing polish (#654) 2023-10-02 10:38:37 +02:00
christoph-heinrich
483acc22d9 fix: search backspace deleting unicode characters (#657) 2023-10-01 20:32:27 +02:00
Tomas Klaen
cbfb2a62fb feat(api): added search_submenus prop to menus (#655)
`search_submenus` makes uosc's internal search handler (when no `on_search` callback is defined) look into submenus as well, effectively flattening the menu for the duration of the search.
2023-09-30 17:24:03 +02:00
christoph-heinrich
512281ac4b feat(api)!: menu script-message changes (#653)
- `open-menu` now only opens the menu, while closing any existing one first, even if it has the same `type`.
- `update-menu` will only update a currently opened menu of the same type. If no menu is open, or current menu's type is different, it doesn't do anything.
- `close-menu [type]` can be used to close any currently opened menu when called without a `[type]` argument, or only a menu of `[type]` type.
- uosc now keeps track of a currently opened menu type on the `user-data/uosc/menu/type` property, accessible via `mp.get_property_native('user-data/uosc/menu/type')`. This property is `nil` if no uosc menu is opened.

This is to achieve a predictable and granular control of menus with no implicit magic going on in the background.

The main difference is that `open-menu` can no longer be used to toggle the menu. You have to implement toggling manually by calling `open-menu` or `close-menu [type]` when appropriate. You can check if your menu is still opened either by getting or observing the `user-data/uosc/menu/type` property, or using the `on_close` menu callback.
2023-09-30 17:11:37 +02:00
tomasklaen
c88c476ec7 fix: search_suggestion submitting externally handled searches
ref #652
2023-09-30 16:57:36 +02:00
Tomas Klaen
9b251efbd9 feat(api): palette menus (#652)
Each (sub)menu can now enable palette mode by setting its `palette` property to `true`.

In this mode:

- search input is always visible, doesn't have to be enabled, and can't be disabled
- `title` is used as input placeholder while search is empty
- `search_suggestion` can be used to pre-populate search input with an initial query
2023-09-29 23:08:59 +02:00
Tomas Klaen
4b6cc2b8a7 feat: redesigned menu title & search input (#650)
- simpler & less cluttered design without textures
- search icon
- clickable icon for submittable searches
- search cursor
- localized placeholders
- clicking empty title now does nothing instead of closing the menu
2023-09-27 16:14:04 +02:00
Tomas Klaen
d9535b4151 fix: search not selecting 1st item in results (#651) 2023-09-27 15:51:43 +02:00
christoph-heinrich
00edb9659a refactor: rename first_word_chars() to initials() (#649)
I didn't like the name from the very beginning, but I couldn't think of
something better. Ever since I realized that such characters are called
"initials", this name bothered me every time I saw it.
2023-09-26 22:12:00 +02:00
christoph-heinrich
c6d89b2537 fix: render spaces at the end of the search query (#648)
Currently the text does not advance to the left when spaces are entered,
which must mean that libass trims any trailing spaces.
Appending a ZWNBSP at the end prevents any trimming.
2023-09-24 20:23:21 +02:00
tomasklaen
3766f583ae feat: added show_hidden_files option
This is currently limited to Mac & Linux only, since on Windows we have no way of telling a file is hidden (`file_info()` doesn't expose this information).

closes #647
2023-09-24 15:14:58 +02:00
tomasklaen
fec33b73f3 feat: added top_bar_flash_on option
closes #639
2023-09-24 14:41:21 +02:00
christoph-heinrich
c277acafd3 feat: search by first character of each word (#644) 2023-09-23 23:21:29 +02:00
christoph-heinrich
18170e2405 refactor: use itable_has for text wrapping (#646)
* refactor: use itable_has for text wrapping

* refactor: declare static lists outside of function
2023-09-23 23:19:42 +02:00
dyphire
442967b73b fix: adapt to the new title-bar state of mpv (#643)
mpv has added a new option to control window title bar state,
which requires relevant adjustments to be added in uosc
2023-09-23 23:17:17 +02:00