With the change to use the new `platform` property,
the platform 'macos' also got renamed to 'darwin',
but the platform checks were not adjusted to the new name.
* feat: apply margin to `osd-margin-y` and `osd-margin-x`
The margins were already set for `osc-margins` and
`user-data/osc/margins`, but osd messages have their own properties
`osd-margin-x` and `osd-margin-y`.
Offsetting `osd-margin-x` and `osd-margin-y` by our margin prevents
overlap of osd messages with the GUI.
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>