Includes how mouse events are dispatched which now handles deduplication and ensures `down` event won't fine `move` as well, which was causing exact and slow seeks in quick succession when clicking on timeline without moving the mouse, causing glitchy looking seeking.
ref #496
The keybindings 'mbtn_left' and 'wheel' were enabled/disabled on every
render, resulting in log files being spammed with corresponding debug
messages.
To avoid that only call the enable/disable function when the current
decision is different to the last one.
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.
`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.
A recently merged PR https://github.com/mpv-player/mpv/pull/11226 made
the console use the new user-data property instead of
shared-script-properties, resulting in our margins being ignored.
This sets the `user-data/osc/margins` property in addition to the old
shared-script-property to keep compatiblity with older mpv versions.
* fix: constant width for hovered time
* fix: respect the trimmed time width in the buffered time indicator
* perf: cache timestamp substitutes for width calculation
Co-authored-by: tomasklaen <tomas.klaen@gmail.com>
---------
Co-authored-by: tomasklaen <tomas.klaen@gmail.com>
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
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')
```
`mouse-pos.hover` may or may not be false during touch input
(contrary to mouse input, where false means the cursor left the window)
Detecting a change to false as a leave event, while allowing any
other mouse-pos update to cause an enter event solves this.
`destination_time` accepts one of `total`, `playtime-remaining` (scaled by the current speed), `time-remaining` (remaining length of file).
`total_time` is deprecated, but still works as expected.